Unverified Commit a35ea570 authored by Sounak Dey's avatar Sounak Dey Committed by GitHub
Browse files

Update image_processing_deformable_detr.py (#28561)

* Update image_processing_deformable_detr.py

* Changes after running make fix-copies
parent e201864b
......@@ -1414,6 +1414,7 @@ class ConditionalDetrImageProcessor(BaseImageProcessor):
boxes = torch.gather(boxes, 1, topk_boxes.unsqueeze(-1).repeat(1, 1, 4))
# and from relative [0, 1] to absolute [0, height] coordinates
if target_sizes is not None:
if isinstance(target_sizes, List):
img_h = torch.Tensor([i[0] for i in target_sizes])
img_w = torch.Tensor([i[1] for i in target_sizes])
......
......@@ -1411,6 +1411,7 @@ class DeformableDetrImageProcessor(BaseImageProcessor):
boxes = torch.gather(boxes, 1, topk_boxes.unsqueeze(-1).repeat(1, 1, 4))
# and from relative [0, 1] to absolute [0, height] coordinates
if target_sizes is not None:
if isinstance(target_sizes, List):
img_h = torch.Tensor([i[0] for i in target_sizes])
img_w = torch.Tensor([i[1] for i in target_sizes])
......
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