msight-tech / research-charnet

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

How to improve the results of recognizing numbers? #17

Open sisrfeng opened 4 years ago

sisrfeng commented 4 years ago

White applying the code to pictures like this as some problems arise: 1.numbers in 2-digits can not be detected 2.some number is recognized as English letterr. e.g. 4→A

while some numbers in one picture can be recognized, the txt file in coresponding to another picture with the same content but in a slightly different view is empty.

Could you please tell how to solve the problems? Can your code generate bbox? Thanks a lot!

IgorDavidyuk commented 4 years ago

If you look into tools/test_net.py you will find that the model returns char_bboxes, char_scores and word_instances. https://github.com/MalongTech/research-charnet/blob/2b13ad978fa927bb903a82561dad75b97f0e0ab9/tools/test_net.py#L77

sisrfeng commented 4 years ago

Thank you! Change the test.py like this can generate BB: https://github.com/sisrfeng/research-charnet/blob/5801f8f6cd7a099c4a87ef11b35c42bd9103a2be/tools/test_net.py#L82

To improve the recall of number detection , we can change these thresholds in research-charnet/charnet/config/defaults.py :

_C.WORD_MIN_SCORE = 0.95 _C.WORD_NMS_IOU_THRESH = 0.15 _C.CHAR_MIN_SCORE = 0.25 _C.CHAR_NMS_IOU_THRESH = 0.3

I set _C.WORD_NMS_IOU_THRESH =0.99 _C.CHAR_NMS_IOU_THRESH=0.99 _C.CHAR_MIN_SCORE =0.1

Then the results of recognition become terrible. Maybe I need to train the network on pictures with abundant numbers.