updates
This commit is contained in:
parent
90daf8f19c
commit
cd1f1eeecc
|
@ -39,9 +39,9 @@ def create_modules(module_defs):
|
||||||
elif module_def['type'] == 'maxpool':
|
elif module_def['type'] == 'maxpool':
|
||||||
kernel_size = int(module_def['size'])
|
kernel_size = int(module_def['size'])
|
||||||
stride = int(module_def['stride'])
|
stride = int(module_def['stride'])
|
||||||
|
maxpool = nn.MaxPool2d(kernel_size=kernel_size, stride=stride, padding=int((kernel_size - 1) // 2))
|
||||||
if kernel_size == 2 and stride == 1: # yolov3-tiny
|
if kernel_size == 2 and stride == 1: # yolov3-tiny
|
||||||
modules.add_module('_debug_padding_%d' % i, nn.ZeroPad2d((0, 1, 0, 1)))
|
modules.add_module('_debug_padding_%d' % i, nn.ZeroPad2d((0, 1, 0, 1)))
|
||||||
maxpool = nn.MaxPool2d(kernel_size=kernel_size, stride=stride, padding=int((kernel_size - 1) // 2))
|
|
||||||
modules.add_module('maxpool_%d' % i, maxpool)
|
modules.add_module('maxpool_%d' % i, maxpool)
|
||||||
|
|
||||||
elif module_def['type'] == 'upsample':
|
elif module_def['type'] == 'upsample':
|
||||||
|
|
|
@ -338,7 +338,7 @@ def build_targets(model, targets):
|
||||||
nt = len(targets)
|
nt = len(targets)
|
||||||
txy, twh, tcls, tbox, indices, anchor_vec = [], [], [], [], [], []
|
txy, twh, tcls, tbox, indices, anchor_vec = [], [], [], [], [], []
|
||||||
for i in model.yolo_layers:
|
for i in model.yolo_layers:
|
||||||
layer = model.module_list[i][0]
|
layer = model.module_list[i]
|
||||||
|
|
||||||
# iou of targets-anchors
|
# iou of targets-anchors
|
||||||
t, a = targets, []
|
t, a = targets, []
|
||||||
|
|
Loading…
Reference in New Issue