Skip to content

Commit

Permalink
fix: convert image to RGB before nutrition extraction (#1448)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 authored Oct 28, 2024
1 parent 022a788 commit 96401ef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions robotoff/prediction/nutrition_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ def preprocess(
words = []
char_offsets = []
bboxes = []

if image.mode != "RGB":
image = image.convert("RGB")

width, height = image.size
for page in ocr_result.full_text_annotation.pages:
for block in page.blocks:
Expand Down

0 comments on commit 96401ef

Please sign in to comment.