提交 17dfff41 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!5658 fix yolov3_darknet53 bug in r0.5

Merge pull request !5658 from yangyongjie/r0.5
......@@ -166,7 +166,7 @@ def _preprocess_true_boxes(true_boxes, anchors, in_shape, num_classes,
valid_mask = boxes_wh[..., 0] > 0
wh = boxes_wh[valid_mask]
if wh:
if wh.size > 0:
wh = np.expand_dims(wh, -2)
boxes_max = wh / 2.
boxes_min = -boxes_max
......@@ -319,7 +319,7 @@ def _choose_candidate_by_constraints(max_trial, input_w, input_h, image_w, image
dx = int(_rand(0, input_w - nw))
dy = int(_rand(0, input_h - nh))
if box:
if box.size > 0:
t_box = copy.deepcopy(box)
t_box[:, [0, 2]] = t_box[:, [0, 2]] * float(nw) / float(image_w) + dx
t_box[:, [1, 3]] = t_box[:, [1, 3]] * float(nh) / float(image_h) + dy
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册