"awq/git@developer.sourcefind.cn:OpenDAS/autoawq.git" did not exist on "321d74ff7d75e6a434b598a8f2e1c4f85b9ce590"
Commit 8f7507eb authored by youkaichao's avatar youkaichao Committed by Kai Chen
Browse files

manually add type promotion (#1114)

parent 7b75de4d
...@@ -164,10 +164,10 @@ def anchor_inside_flags(flat_anchors, valid_flags, img_shape, ...@@ -164,10 +164,10 @@ def anchor_inside_flags(flat_anchors, valid_flags, img_shape,
img_h, img_w = img_shape[:2] img_h, img_w = img_shape[:2]
if allowed_border >= 0: if allowed_border >= 0:
inside_flags = valid_flags & \ inside_flags = valid_flags & \
(flat_anchors[:, 0] >= -allowed_border) & \ (flat_anchors[:, 0] >= -allowed_border).type(torch.uint8) & \
(flat_anchors[:, 1] >= -allowed_border) & \ (flat_anchors[:, 1] >= -allowed_border).type(torch.uint8) & \
(flat_anchors[:, 2] < img_w + allowed_border) & \ (flat_anchors[:, 2] < img_w + allowed_border).type(torch.uint8) & \
(flat_anchors[:, 3] < img_h + allowed_border) (flat_anchors[:, 3] < img_h + allowed_border).type(torch.uint8)
else: else:
inside_flags = valid_flags inside_flags = valid_flags
return inside_flags return inside_flags
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment