Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new game: Ingredient crop #714

Closed
alexfauquette opened this issue Aug 10, 2023 · 6 comments · Fixed by #769
Closed

new game: Ingredient crop #714

alexfauquette opened this issue Aug 10, 2023 · 6 comments · Fixed by #769
Assignees
Labels

Comments

@alexfauquette
Copy link
Member

The idea would be to create a simple page to crop images with ingredients

image

Would requires APIs to

  • get image to crop
  • get crop estimated by robotoff
  • send the crop (does robotoff needs it?)

Open question: how do we store which image has been correctly cropped and then is ready for the future ingredient extraction game?

@raphael0202 is it what you have in mind?

@alexfauquette alexfauquette added the ✨ Enhancement New feature or request label Aug 10, 2023
@raphael0202
Copy link
Contributor

The idea was not only to select and crop the ingredient image, but also to update the ingredient list. We now have an ingredient detection model in production (demo: https://huggingface.co/spaces/raphael0202/ingredient-extraction?barcode=3800106400226)

If the ingredient list is correct, we're 100% sure about the crop, as cropping coordinates are inferred from the words bounding boxes.

Concerning the input feed of products, we can fetch products that have quality errors/warnings related to ingredients, ordered by descending popularity.

I'm not certain of what the interface should look like, as there are many use cases we want to cover (products without ingredient lists, products with ingredient list but without quality errors), products with more recent ingredient lists detected by the model,...

@alexfauquette
Copy link
Member Author

alexfauquette commented Aug 25, 2023

I'm trying the API to reproduce this example:

https://huggingface.co/spaces/raphael0202/ingredient-extraction?barcode=3800106400226

The OCR exists: https://static.openfoodfacts.org/images/products/380/010/640/0226/2.json

But this API call returns Internale server error
https://robotoff.openfoodfacts.org/api/v1/predict/ingredient_list?ocr_url=https://static.openfoodfacts.org/images/products/380/010/640/0226/2.json

By the way is it possible to get the result for multiple images of a product?

@raphael0202
Copy link
Contributor

It was not fully deployed on prod, only on staging. I'm finishing the deployment on prod.

@raphael0202
Copy link
Contributor

It's working now. To get the result for multiple images, for now you can simply send multiple requests!

@alexfauquette
Copy link
Member Author

Yes, perfectly 👍

@teolemon
Copy link
Member

teolemon commented Mar 10, 2024

Some padding for the loading message would be nice

image

Some padding everywhere + converting off into Open Food Facts + "ingredient text currently on Open Food Facts" + "Get ingredient list predictions from Robotoff" or "Get ingredient list predictions"
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants