Skip to content

Commit 889d652

Browse files
authored
yolox demo: cast input dtype to float32 for dtype-sensitive backends (#210)
1 parent c177492 commit 889d652

File tree

1 file changed

+1
-1
lines changed
  • models/object_detection_yolox

1 file changed

+1
-1
lines changed

models/object_detection_yolox/demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
'vase', 'scissors', 'teddy bear', 'hair drier', 'toothbrush')
3434

3535
def letterbox(srcimg, target_size=(640, 640)):
36-
padded_img = np.ones((target_size[0], target_size[1], 3)) * 114.0
36+
padded_img = np.ones((target_size[0], target_size[1], 3)).astype(np.float32) * 114.0
3737
ratio = min(target_size[0] / srcimg.shape[0], target_size[1] / srcimg.shape[1])
3838
resized_img = cv.resize(
3939
srcimg, (int(srcimg.shape[1] * ratio), int(srcimg.shape[0] * ratio)), interpolation=cv.INTER_LINEAR

0 commit comments

Comments
 (0)