Skip to content

Commit

Permalink
minor fix for ocr (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird authored Aug 20, 2024
1 parent c47483a commit 955ef9e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vision_agent/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ def ocr(image: np.ndarray) -> List[Dict[str, Any]]:

pil_image = Image.fromarray(image).convert("RGB")
image_size = pil_image.size[::-1]
if image_size[0] < 1 and image_size[1] < 1:
return []
image_buffer = io.BytesIO()
pil_image.save(image_buffer, format="PNG")
buffer_bytes = image_buffer.getvalue()
Expand Down

0 comments on commit 955ef9e

Please sign in to comment.