diff --git a/detect.py b/detect.py index 46d6de76..67aceb19 100644 --- a/detect.py +++ b/detect.py @@ -183,6 +183,9 @@ if __name__ == '__main__': parser.add_argument('--agnostic-nms', action='store_true', help='class-agnostic NMS') parser.add_argument('--augment', action='store_true', help='augmented inference') opt = parser.parse_args() + opt.cfg = list(glob.iglob('./**/' + opt.cfg, recursive=True))[0] # find file + opt.names = list(glob.iglob('./**/' + opt.names, recursive=True))[0] # find file + opt.weights = list(glob.iglob('./**/' + opt.weights, recursive=True))[0] # find file print(opt) with torch.no_grad(): diff --git a/test.py b/test.py index a4b2ab6b..b902fb1b 100644 --- a/test.py +++ b/test.py @@ -242,6 +242,9 @@ if __name__ == '__main__': parser.add_argument('--augment', action='store_true', help='augmented inference') opt = parser.parse_args() opt.save_json = opt.save_json or any([x in opt.data for x in ['coco.data', 'coco2014.data', 'coco2017.data']]) + opt.weights = list(glob.iglob('./**/' + opt.weights, recursive=True))[0] # find file + opt.cfg = list(glob.iglob('./**/' + opt.cfg, recursive=True))[0] # find file + opt.data = list(glob.iglob('./**/' + opt.data, recursive=True))[0] # find file print(opt) # task = 'test', 'study', 'benchmark' diff --git a/train.py b/train.py index 0f4997e1..d3bd51fd 100644 --- a/train.py +++ b/train.py @@ -251,6 +251,7 @@ def train(hyp): if 'momentum' in x: x['momentum'] = np.interp(ni, [0, n_burn], [0.9, hyp['momentum']]) + # Multi-Scale if opt.multi_scale: if ni / accumulate % 1 == 0: #  adjust img_size (67% - 150%) every 1 batch @@ -396,6 +397,8 @@ if __name__ == '__main__': opt = parser.parse_args() opt.weights = last if opt.resume else opt.weights check_git_status() + opt.cfg = list(glob.iglob('./**/' + opt.cfg, recursive=True))[0] # find file + opt.data = list(glob.iglob('./**/' + opt.data, recursive=True))[0] # find file print(opt) opt.img_size.extend([opt.img_size[-1]] * (3 - len(opt.img_size))) # extend to 3 sizes (min, max, test) device = torch_utils.select_device(opt.device, apex=mixed_precision, batch_size=opt.batch_size)