Skip to content

Commit 9291e09

Browse files
authored
Merge pull request #457 from YuanmingLeee/master
fix bug
2 parents 0f970d2 + dab0859 commit 9291e09

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ def _get_image_blob(im):
321321
pred_boxes = clip_boxes(pred_boxes, im_info.data, 1)
322322
else:
323323
# Simply repeat the boxes, once for each class
324-
pred_boxes = np.tile(boxes, (1, scores.shape[1]))
324+
_ = torch.from_numpy(np.tile(boxes, (1, scores.shape[1])))
325+
pred_boxes = _.cuda() if args.cuda > 0 else _
325326

326327
pred_boxes /= im_scales[0]
327328

‎test_net.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ def parse_args():
259259
pred_boxes = clip_boxes(pred_boxes, im_info.data, 1)
260260
else:
261261
# Simply repeat the boxes, once for each class
262-
pred_boxes = np.tile(boxes, (1, scores.shape[1]))
262+
_ = torch.from_numpy(np.tile(boxes, (1, scores.shape[1])))
263+
pred_boxes = _.cuda() if args.cuda > 0 else _
263264

264265
pred_boxes /= data[1][0][2].item()
265266

0 commit comments

Comments
 (0)