Skip to content

Commit

Permalink
Merge pull request #961 from roboflow/fix-google-vision-block-bbox-pa…
Browse files Browse the repository at this point in the history
…rsing

Fix Google Vision Block bounding box parsing
  • Loading branch information
grzegorz-roboflow authored Jan 19, 2025
2 parents 6b987a7 + d48005a commit 3ab2d10
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ def run(
for block in page["blocks"]:
# Get bounding box coordinates
box = block["boundingBox"]["vertices"]
x_min = min(v["x"] for v in box)
y_min = min(v["y"] for v in box)
x_max = max(v["x"] for v in box)
y_max = max(v["y"] for v in box)
x_min = min(v.get("x", 0) for v in box)
y_min = min(v.get("y", 0) for v in box)
x_max = max(v.get("x", 0) for v in box)
y_max = max(v.get("y", 0) for v in box)
xyxy.append([x_min, y_min, x_max, y_max])

# Only DOCUMENT_TEXT_DETECTION provides confidence score, use 1.0 otherwise
Expand Down

0 comments on commit 3ab2d10

Please sign in to comment.