Skip to content

Commit

Permalink
fix: only run nutrition table detection for food type
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Sep 3, 2024
1 parent da2b685 commit fb14ba2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions robotoff/workers/tasks/import_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,15 @@ def run_import_image_job(product_id: ProductIdentifier, image_url: str, ocr_url:
image_url=image_url,
ocr_url=ocr_url,
)
enqueue_job(
run_nutrition_table_object_detection,
get_high_queue(product_id),
job_kwargs={"result_ttl": 0},
product_id=product_id,
image_url=image_url,
)

if product_id.server_type.is_food():
enqueue_job(
run_nutrition_table_object_detection,
get_high_queue(product_id),
job_kwargs={"result_ttl": 0},
product_id=product_id,
image_url=image_url,
)

# Run UPC detection to detect if the image is dominated by a UPC (and thus
# should not be a product selected image)
Expand Down

0 comments on commit fb14ba2

Please sign in to comment.