openfoodfacts / robotoff

🤖 Real-time and batch prediction service for Open Food Facts
https://openfoodfacts.github.io/robotoff/
GNU Affero General Public License v3.0
80 stars 56 forks source link

feat: add nutrient extractor #1437

Closed raphael0202 closed 1 month ago

raphael0202 commented 1 month ago

Add the nutrient extractor model. For every new image, we run the model inference and save the raw prediction in ImagePrediction table. If the prediction is not empty (=if some values were found), we create a prediction. If the product has no nutrient, an insight is created.

A new API route was not added, it will be dealt with in a subsequent PR.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 48.67925% with 136 lines in your changes missing coverage. Please review.

Project coverage is 54.65%. Comparing base (463a1f1) to head (91ef024). Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
robotoff/prediction/nutrition_extraction.py 57.44% 80 Missing :warning:
robotoff/workers/tasks/import_image.py 8.82% 31 Missing :warning:
robotoff/cli/main.py 13.33% 13 Missing :warning:
robotoff/insights/importer.py 62.50% 6 Missing :warning:
robotoff/triton.py 14.28% 6 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1437 +/- ## ========================================== - Coverage 54.79% 54.65% -0.14% ========================================== Files 84 85 +1 Lines 8359 8625 +266 ========================================== + Hits 4580 4714 +134 - Misses 3779 3911 +132 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.