msight-tech / research-charnet

CharNet: Convolutional Character Networks
Other
610 stars 142 forks source link

One and two character recognition/detection #7

Closed luistelmocosta closed 4 years ago

luistelmocosta commented 4 years ago

Hello, I am having some issues trying to recognize images with only one character (or two) I'm runing this model on Racing Bib Numbers and some runners have 2 digits numbers on their bibs.

Is there any parameter regarding to the char/text length?

dfayzur commented 4 years ago

I am having the same issue. My use use is for numbers. I inference can detect 3 and 3+ digits, but does not detect anything for 1 or 2 digits.

Can you guide me, if I need to change any parameters for make it working?

mscottml commented 4 years ago

The model outputs are corrected with a lexicon as evaluated in ICDAR 2015, and the text instances with < 3 characters are discarded. Please comment out the corresponding code here: https://github.com/MalongTech/research-charnet/blob/361d7fa07bdbfa857b4c24ce76c4d5686473eb67/charnet/modeling/postprocessing.py#L170 and try again.

dfayzur commented 4 years ago

@mscottml : Thank you very much for your reply and the direction.

if len(word_ins.text) < 1:

in filter_and_correct function, and the inference returns detection for digits with 2 numbers. Thanks.

But, my change does not work for digit with 1 number. Is it something to do with word_ins.text_score?

mscottml commented 4 years ago

@dfayzur

It might be due to this. But please print "word_instances" before this filtering to check. The code is here https://github.com/MalongTech/research-charnet/blob/361d7fa07bdbfa857b4c24ce76c4d5686473eb67/charnet/modeling/postprocessing.py#L194.

dfayzur commented 4 years ago

@mscottml I did print as you suggested. The output is as follows:

<charnet.modeling.postprocessing.WordInstance object at 0x7fbb085180f0> <charnet.modeling.postprocessing.WordInstance object at 0x7fbb08518160> <charnet.modeling.postprocessing.WordInstance object at 0x7fbb085181d0> <charnet.modeling.postprocessing.WordInstance object at 0x7fbb08518240> <charnet.modeling.postprocessing.WordInstance object at 0x7fbb085182b0> <charnet.modeling.postprocessing.WordInstance object at 0x7fbb08518320> <charnet.modeling.postprocessing.WordInstance object at 0x7fbb08518390> <charnet.modeling.postprocessing.WordInstance object at 0x7fbb08518400> <charnet.modeling.postprocessing.WordInstance object at 0x7fbb08518470> <charnet.modeling.postprocessing.WordInstance object at 0x7fbb085184e0> <charnet.modeling.postprocessing.WordInstance object at 0x7fbb08518550>

it is returning "WordInstance". I also did print word_ins.text. And it is returning the word. But it is not printing any digit with one number.

Maybe I need to see the function parse_words, how it is parsing a word.