From 4e4b67b3c56c20410aa8e05a15cebbe298e1e281 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 21 Nov 2018 18:01:18 +0100 Subject: [PATCH] updates --- detect.py | 4 +--- train.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/detect.py b/detect.py index 09b45994..b20859b3 100755 --- a/detect.py +++ b/detect.py @@ -25,7 +25,6 @@ parser.add_argument('-img_size', type=int, default=32 * 13, help='size of each i opt = parser.parse_args() print(opt) - def detect(opt): os.system('rm -rf ' + opt.output_folder) os.makedirs(opt.output_folder, exist_ok=True) @@ -66,8 +65,7 @@ def detect(opt): # Get detections with torch.no_grad(): - chip = torch.from_numpy(img).unsqueeze(0).to(device) - pred = model(chip) + pred = model(torch.from_numpy(img).unsqueeze(0).to(device)) pred = pred[pred[:, :, 4] > opt.conf_thres] if len(pred) > 0: diff --git a/train.py b/train.py index 842a56fa..6b44e284 100644 --- a/train.py +++ b/train.py @@ -1,6 +1,5 @@ import argparse import time -import test from models import * from utils.datasets import * @@ -182,6 +181,7 @@ def main(opt): os.system('cp weights/latest.pt weights/backup' + str(epoch) + '.pt') # Calculate mAP + import test test.opt.weights_path = 'weights/latest.pt' mAP = test.main(test.opt)