update post_process_image_guided_detection (#20521)

This commit is contained in:
fatih 2022-12-01 20:03:17 +03:00 committed by GitHub
parent d51e7c7e82
commit b67ac44296
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -416,7 +416,7 @@ class OwlViTImageProcessor(BaseImageProcessor):
# Convert from relative [0, 1] to absolute [0, height] coordinates
img_h, img_w = target_sizes.unbind(1)
scale_fct = torch.stack([img_w, img_h, img_w, img_h], dim=1)
scale_fct = torch.stack([img_w, img_h, img_w, img_h], dim=1).to(target_boxes.device)
target_boxes = target_boxes * scale_fct[:, None, :]
# Compute box display alphas based on prediction scores