From 0d770e14df0f16524164f8f67955ddeaa3bb4822 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 18 Apr 2019 22:55:50 +0200 Subject: [PATCH] updates --- test.py | 17 +++-------------- utils/gcp.sh | 2 +- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/test.py b/test.py index d85c5162..d4b75d62 100644 --- a/test.py +++ b/test.py @@ -125,7 +125,7 @@ def test( iou, bi = bbox_iou(pbox, tbox).max(0) # If iou > threshold and class is correct mark as correct - if iou > iou_thres and bi not in detected: + if iou > iou_thres and bi not in detected: # and pcls == tcls[bi] correct[i] = 1 detected.append(bi) @@ -139,17 +139,6 @@ def test( p, r, ap, f1, ap_class = ap_per_class(*stats) mp, mr, map, mf1 = p.mean(), r.mean(), ap.mean(), f1.mean() - if any(r > 1): - chkpt = {'epoch': -1, - 'best_loss': None, - 'model': model.module.state_dict() if type( - model) is nn.parallel.DistributedDataParallel else model.state_dict(), - 'optimizer': None} - - # Save problem checkpoint - torch.save(chkpt, 'recall_issue.pt') - del chkpt - # Print results pf = '%20s' + '%10.3g' * 6 # print format print(pf % ('all', seen, nt.sum(), mp, mr, map, mf1), end='\n\n') @@ -187,8 +176,8 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(prog='test.py') parser.add_argument('--batch-size', type=int, default=32, help='size of each image batch') parser.add_argument('--cfg', type=str, default='cfg/yolov3-spp.cfg', help='cfg file path') - parser.add_argument('--data-cfg', type=str, default='data/coco.data', help='coco.data file path') - parser.add_argument('--weights', type=str, default='weights/yolov3-spp.weights', help='path to weights file') + parser.add_argument('--data-cfg', type=str, default='data/coco_100img.data', help='coco.data file path') + parser.add_argument('--weights', type=str, default='weights/recall_issue.pt', help='path to weights file') parser.add_argument('--iou-thres', type=float, default=0.5, help='iou threshold required to qualify as detected') parser.add_argument('--conf-thres', type=float, default=0.001, help='object confidence threshold') parser.add_argument('--nms-thres', type=float, default=0.5, help='iou threshold for non-maximum suppression') diff --git a/utils/gcp.sh b/utils/gcp.sh index 1d647acd..060e13b7 100755 --- a/utils/gcp.sh +++ b/utils/gcp.sh @@ -61,7 +61,7 @@ git clone https://github.com/ultralytics/yolov3 # master cp -r weights yolov3 cp -r cocoapi/PythonAPI/pycocotools yolov3 cd yolov3 -python3 train.py --evolve --data data/coco_100img.data --batch-size 8 --epochs 100 --num-workers 2 +python3 train.py --evolve --data data/coco_100img.data --num-workers 2 gsutil cp evolve.txt gs://ultralytics sudo shutdown