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

Support Robotoff multi-project mode #8319

Open
Tracked by #5555 ...
raphael0202 opened this issue Apr 14, 2023 · 4 comments
Open
Tracked by #5555 ...

Support Robotoff multi-project mode #8319

raphael0202 opened this issue Apr 14, 2023 · 4 comments
Labels
🧴 Open Beauty Facts Our cosmetic analysis project https://world.openbeautyfacts.org 🐾 Open Pet Food Facts Our pet food analysis project https://world.openpetfoodfacts.org 📸 Open Products Facts Our project to increase the lifespan of objects. https://world.openproductsfacts.org 🎯 P1 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers 🤖 Robotoff

Comments

@raphael0202
Copy link
Contributor

raphael0202 commented Apr 14, 2023

There are discrepancies between O*F flavors (OFF, OBF, OFF-PRO,...) and environments (prod/preprod) that prevent a real multi-project support from Robotoff.

  • (most urgent) it looks like we don't perform OCR on all images on the pro platform (ex: https://fr.pro.openfoodfacts.org/images/products/org-lea-nature/345/630/001/6208/3.json does not exist). It looks like it's the case on OBF, I haven't checked the other platforms. We should perform OCR on images of all platforms.
  • If possible, we should have JSONL dump available on all platforms, and on preprod (currently we don't dump the database as a JSONL file on preprod even for OFF)
  • [after Robotoff deployment] Call Robotoff webhook during product update or new image upload for all platforms (off-pro, obf, opf,...)

Part of

@raphael0202 raphael0202 added 🧴 Open Beauty Facts Our cosmetic analysis project https://world.openbeautyfacts.org 🐾 Open Pet Food Facts Our pet food analysis project https://world.openpetfoodfacts.org 📸 Open Products Facts Our project to increase the lifespan of objects. https://world.openproductsfacts.org 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers 🤖 Robotoff labels Apr 14, 2023
@raphael0202
Copy link
Contributor Author

raphael0202 commented May 23, 2023

@manon-corneille @stephanegigandet I ping you here following our conversation at the last weekly meeting.

In order to add Robotoff nutrition image detection capabilities on the pro platform, we need OCR files for the pro platform. From what I see from the server logs, we do generate OCR for the pro platform, but not for "raw" images (1.jpg, 2.jpg,...). Robotoff only uses raw images as input.

JSONL dump shouldn't be difficult to set up, I can take care of it (now that I start to contribute to openfoodfacts-server ;))

On Robotoff side, what needs to be done based on the differences between the pro and public platform (@stephanegigandet tell me if I'm missing something):

  • images are stored in a different folder (with a prefix folder named after the organization ID)
  • the _id field in mongo contains organization ID + barcode, so we need to provide both when querying mongoDB. Does it actually matter by the way? Are there some duplicated barcodes between organizations?
  • does the API work the same way as on the public platform?

@stephanegigandet
Copy link
Contributor

There are duplicated barcodes in the pro platform, because different entities can provide data for the same products. e.g. we can get data from the producer, from some labels (they may send us a list of barcodes of products with their label from many different producers), or from other databases like codeonline or usda. That's why the id is org + barcode. We need to keep this combination of org + barcode on the robotoff side as well.

Note that there may be also experimental data on the pro platform (tests from producers etc.), so that's one more reason to make sure we keep the org in the id of the product.

I don't think that I added API support to the pro platform yet. It might be working if you use a pro platform moderator account and pass some extra parameters to identify the org, but no guarantees. We should add proper support + integration tests etc.

Copy link
Contributor

This issue has been open 90 days with no activity. Can you give it a little love by linking it to a parent issue, adding relevant labels and projets, creating a mockup if applicable, adding code pointers from https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/labeler.yml, giving it a priority, editing the original issue to have a more comprehensive description… Thank you very much for your contribution to 🍊 Open Food Facts

@github-actions github-actions bot added the Stale label Nov 14, 2023
@teolemon teolemon added ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. and removed Stale labels Nov 24, 2023
@alexgarel
Copy link
Member

(most urgent) it looks like we don't perform OCR on all images on the pro platform (ex: https://fr.pro.openfoodfacts.org/images/products/org-lea-nature/345/630/001/6208/3.json does not exist). It looks like it's the case on OBF, I haven't checked the other platforms. We should perform OCR on images of all platforms.

@raphael0202 with the new install, images are now systematically sent to OCR (but it means old photos do not have it yet)

@github-actions github-actions bot removed the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧴 Open Beauty Facts Our cosmetic analysis project https://world.openbeautyfacts.org 🐾 Open Pet Food Facts Our pet food analysis project https://world.openpetfoodfacts.org 📸 Open Products Facts Our project to increase the lifespan of objects. https://world.openproductsfacts.org 🎯 P1 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers 🤖 Robotoff
Projects
Status: To discuss and validate
Status: To Discuss and Validate
Status: Done
Status: To do
Status: To do
Status: To Discuss & Validate
Development

No branches or pull requests

4 participants