From d884c33d2116fc4f021751e6bd94873f2ea80d28 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 15 Dec 2019 12:43:30 -0800 Subject: [PATCH] updates --- data/{coco.data => coco2017.data} | 0 detect.py | 2 +- test.py | 4 ++-- train.py | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) rename data/{coco.data => coco2017.data} (100%) diff --git a/data/coco.data b/data/coco2017.data similarity index 100% rename from data/coco.data rename to data/coco2017.data diff --git a/detect.py b/detect.py index 6da45c3b..21ce7716 100644 --- a/detect.py +++ b/detect.py @@ -155,7 +155,7 @@ def detect(save_txt=False, save_img=False): if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--cfg', type=str, default='cfg/yolov3-spp.cfg', help='cfg file path') - parser.add_argument('--data', type=str, default='data/coco.data', help='coco.data file path') + parser.add_argument('--data', type=str, default='data/coco2017.data', help='*.data file path') parser.add_argument('--weights', type=str, default='weights/yolov3-spp.weights', help='path to weights file') parser.add_argument('--source', type=str, default='data/samples', help='source') # input file/folder, 0 for webcam parser.add_argument('--output', type=str, default='output', help='output folder') # output folder diff --git a/test.py b/test.py index caffb552..3cc52dd7 100644 --- a/test.py +++ b/test.py @@ -204,7 +204,7 @@ def test(cfg, if __name__ == '__main__': parser = argparse.ArgumentParser(prog='test.py') parser.add_argument('--cfg', type=str, default='cfg/yolov3-spp.cfg', help='cfg file path') - parser.add_argument('--data', type=str, default='data/coco.data', help='coco.data file path') + parser.add_argument('--data', type=str, default='data/coco2017.data', help='*.data file path') parser.add_argument('--weights', type=str, default='weights/yolov3-spp.weights', help='path to weights file') parser.add_argument('--batch-size', type=int, default=16, help='size of each image batch') parser.add_argument('--img-size', type=int, default=416, help='inference size (pixels)') @@ -225,4 +225,4 @@ if __name__ == '__main__': opt.iou_thres, opt.conf_thres, opt.nms_thres, - opt.save_json or (opt.data == 'data/coco.data')) + opt.save_json or any([x in opt.data for x in ['coco.data', 'coco2014.data', 'coco2017.data']])) diff --git a/train.py b/train.py index 4c1eaeeb..329d9443 100644 --- a/train.py +++ b/train.py @@ -324,13 +324,14 @@ def train(): print_model_biases(model) elif not opt.notest or final_epoch: # Calculate mAP with torch.no_grad(): + is_coco = any([x in data for x in ['coco.data', 'coco2014.data', 'coco2017.data']]) and model.nc == 80 results, maps = test.test(cfg, data, batch_size=batch_size, img_size=opt.img_size, model=model, conf_thres=0.001 if final_epoch else 0.1, # 0.1 for speed - save_json=final_epoch and 'coco.data' in data and model.nc == 80, + save_json=final_epoch and is_coco, dataloader=testloader) # Write epoch results @@ -419,7 +420,7 @@ if __name__ == '__main__': parser.add_argument('--batch-size', type=int, default=16) # effective bs = batch_size * accumulate = 16 * 4 = 64 parser.add_argument('--accumulate', type=int, default=4, help='batches to accumulate before optimizing') parser.add_argument('--cfg', type=str, default='cfg/yolov3-spp.cfg', help='cfg file path') - parser.add_argument('--data', type=str, default='data/coco.data', help='*.data file path') + parser.add_argument('--data', type=str, default='data/coco2017.data', help='*.data file path') parser.add_argument('--multi-scale', action='store_true', help='adjust (67% - 150%) img_size every 10 batches') parser.add_argument('--img-size', type=int, default=416, help='inference size (pixels)') parser.add_argument('--rect', action='store_true', help='rectangular training')