Skip to content

Commit f49dcea

Browse files
committed
# Update python scrypt
For multi scale training
1 parent 7fa25e1 commit f49dcea

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

utils/yolo.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import cv2
2-
import os
32
import numpy as np
43
from .im_transform import imcv2_affine_trans, imcv2_recolor
54
# from box import BoundBox, box_iou, prob_compare
@@ -49,8 +48,9 @@ def _offset_boxes(boxes, im_shape, scale, offs, flip):
4948
return boxes
5049

5150

52-
def preprocess_train(data):
51+
def preprocess_train(data, size_index):
5352
im_path, blob, inp_size = data
53+
inp_size = inp_size[size_index]
5454
boxes, gt_classes = blob['boxes'], blob['gt_classes']
5555

5656
im = cv2.imread(im_path)
@@ -128,7 +128,6 @@ def postprocess(bbox_pred, iou_pred, prob_pred, im_shape, cfg, thresh=0.05):
128128
bbox_pred = bbox_pred[keep]
129129
scores = scores[keep]
130130
cls_inds = cls_inds[keep]
131-
# print scores.shape
132131

133132
# NMS
134133
keep = np.zeros(len(bbox_pred), dtype=np.int)

0 commit comments

Comments
 (0)