mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
update post_process_image_guided_detection (#20521)
This commit is contained in:
parent
d51e7c7e82
commit
b67ac44296
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user