Improve OWL-ViT postprocessing (#20980)

* add post_process_object_detection method

* style changes
This commit is contained in:
Alara Dirik
2023-01-03 19:25:09 +03:00
committed by GitHub
parent e901914da7
commit cd2457809f
6 changed files with 87 additions and 18 deletions

View File

@@ -131,7 +131,8 @@ class ZeroShotObjectDetectionPipelineTests(unittest.TestCase, metaclass=Pipeline
object_detector = pipeline("zero-shot-object-detection")
outputs = object_detector(
"http://images.cocodataset.org/val2017/000000039769.jpg", candidate_labels=["cat", "remote", "couch"]
"http://images.cocodataset.org/val2017/000000039769.jpg",
candidate_labels=["cat", "remote", "couch"],
)
self.assertEqual(
nested_simplify(outputs, decimals=4),