openfoodfacts-ai icon indicating copy to clipboard operation
openfoodfacts-ai copied to clipboard

Try to detect the name based on the size of the text

Open teolemon opened this issue 4 years ago • 1 comments

A simplistic assumption: the name of the product should be the largest text on the front of the product. Based on this, we could compute a ratio between the area of the bounding boxes (width by height) and the amount of letters inside it . Based on this ratio, we could have candidates for the product name

teolemon avatar May 10 '20 19:05 teolemon

I was thinking a good pipeline also could be:

  • get all text from front image
  • look for brand candidates from barcode group
  • remove labels ("fat free")
  • remove quantity (360g/similar regexp)
  • extract remaining sentences
  • weight "x with y" or "x & y" heavily (perhaps a good list of title patterns)

... and provide these as autocomplete suggestions for the name field.

These steps might help (particularly brands) filter put false positives

CloCkWeRX avatar Jul 30 '20 10:07 CloCkWeRX