Skip to content

Commit ec37fc8

Browse files
authored
Fix failing owlv2 image processor integration test (#42714)
Fixed failing owlv2 image processor integration test.
1 parent c1ac182 commit ec37fc8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/models/owlv2/test_image_processing_owlv2.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ def test_image_processor_integration_test_resize(self):
151151
with torch.no_grad():
152152
outputs = model(**inputs)
153153

154-
results = processor.post_process_object_detection(outputs, threshold=0.2, target_sizes=[target_size])[0]
154+
results = processor.image_processor.post_process_object_detection(
155+
outputs, threshold=0.2, target_sizes=[target_size]
156+
)[0]
155157

156158
boxes = results["boxes"]
157159
torch.testing.assert_close(boxes, expected_boxes, atol=1e-1, rtol=1e-1)
@@ -160,7 +162,7 @@ def test_image_processor_integration_test_resize(self):
160162
inputs = processor(text=[text, text], images=[image, image], return_tensors="pt")
161163
with torch.no_grad():
162164
outputs = model(**inputs)
163-
results = processor.post_process_object_detection(
165+
results = processor.image_processor.post_process_object_detection(
164166
outputs, threshold=0.2, target_sizes=[target_size, target_size]
165167
)
166168

0 commit comments

Comments
 (0)