From 426d5b82c645b26ec7bbf5de35a2b447ca9bd596 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 17 Feb 2020 12:36:11 -0800 Subject: [PATCH] updates --- models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models.py b/models.py index 65f95450..69bf0c9b 100755 --- a/models.py +++ b/models.py @@ -54,10 +54,10 @@ def create_modules(module_defs, img_size, arc): elif mdef['type'] == 'upsample': if ONNX_EXPORT: # explicitly state size, avoid scale_factor - g = (yolo_index + 1) * 2 # gain - modules = nn.Upsample(size=(10 * g, 6 * g), mode='nearest') # assume img_size = (320, 192) + g = (yolo_index + 1) * 2 / 32 # gain + modules = nn.Upsample(size=tuple(int(x * g) for x in img_size)) # img_size = (320, 192) else: - modules = nn.Upsample(scale_factor=int(mdef['stride']), mode='nearest') + modules = nn.Upsample(scale_factor=int(mdef['stride'])) elif mdef['type'] == 'route': # nn.Sequential() placeholder for 'route' layer layers = [int(x) for x in mdef['layers'].split(',')]