Unverified Commit d3c05666 authored by Nicolas Patry's avatar Nicolas Patry Committed by GitHub
Browse files

Fix object-detection bug (height, width inversion). (#20167)

parent 61a51f5f
...@@ -102,7 +102,7 @@ class ObjectDetectionPipeline(Pipeline): ...@@ -102,7 +102,7 @@ class ObjectDetectionPipeline(Pipeline):
if self.tokenizer is not None: if self.tokenizer is not None:
# This is a LayoutLMForTokenClassification variant. # This is a LayoutLMForTokenClassification variant.
# The OCR got the boxes and the model classified the words. # The OCR got the boxes and the model classified the words.
width, height = target_size[0].tolist() height, width = target_size[0].tolist()
def unnormalize(bbox): def unnormalize(bbox):
return self._get_bounding_box( return self._get_bounding_box(
......
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