ksasso1028 / EasyOCR-cpp

Custom C++ implementation of deep learning based OCR
41 stars 8 forks source link

output do not make sense in Linux #8

Closed rmsalinas closed 5 months ago

rmsalinas commented 5 months ago

Hi, could you please help me to understand what is happening? This is the output I obtain when I run it in linux. The text detected completely messed up.

0 [blank] 95 z 94 y 93 x 92 w 91 v 90 u 89 t 88 s 87 r 86 q 85 p 84 o 83 n 82 m 81 l 80 k 79 j 78 i 77 h 76 g 75 f 74 e 73 d 72 c 71 b 70 a 69 Z 68 Y 67 X 66 W 65 V 64 U 63 T 62 S 61 R 60 Q 29 = 28 < 27 ; 26 : 25 / 24 . 23 - 22 , 21 + 20 * 19 ) 18 ( 17 ' 16 & 15 % 14 $ 1 0 2 1 3 2 4 3 5 4 6 5 7 6 8 7 9 8 10 9 11 ! 12 " 13 # 30 > 31 ? 32 @ 33 [ 34 \ 35 ] 36 ^ 37 _ 38 ` 39 { 40 | 41 } 42 ~ 43
44 A 45 B 46 C 47 D 48 E 49 F 50 G 51 H 52 I 53 J 54 K 55 L 56 M 57 N 58 O 59 P MODEL TIME 45.7036 ms LOCATION: [0, 1] [20, 20] TEXT: Q CONFIDENCE 0.999953 ################################################ LOCATION: [21, 5] [68, 18] TEXT: IPMPOJ CONFIDENCE 0.999209 ################################################ LOCATION: [71, 5] [108, 18] TEXT: UISFF CONFIDENCE 0.999888 ################################################ LOCATION: [115, 5] [349, 18] TEXT: 490054792 Pqfofe cw QXIpmpo NEDbsejp CONFIDENCE 0.995813 ################################################ LOCATION: [13, 29] [38, 40] TEXT: Ubdl CONFIDENCE 0.999953 ################################################ LOCATION: [53, 29] [78, 42] TEXT: Feju CONFIDENCE 0.999371 ################################################ LOCATION: [91, 29] [118, 40] TEXT: Kjfm CONFIDENCE 0.0257791 ################################################ LOCATION: [135, 29] [176, 42] TEXT: Qbujfou CONFIDENCE 0.999988 ################################################ LOCATION: [191, 29] [222, 42] TEXT: Dibsu CONFIDENCE 0.999963 ################################################ LOCATION: [237, 29] [266, 40] TEXT: Mjolf CONFIDENCE 0.999889 ################################################ LOCATION: [281, 29] [353, 40] TEXT: Opujgjdbujpot CONFIDENCE 0.982506 ################################################ LOCATION: [367, 29] [427, 42] TEXT: Obwjrbujpo CONFIDENCE 0.996567 ################################################ LOCATION: [443, 29] [473, 44] TEXT: Ifmq CONFIDENCE 0.998373 ################################################ LOCATION: [15, 55] [28, 68] TEXT: J CONFIDENCE 0.010791 ################################################ LOCATION: [29, 55] [64, 66] TEXT: Ipnf CONFIDENCE 0.987937 ################################################ LOCATION: [89, 55] [168, 66] TEXT: Dbsejpwbtdvmbs CONFIDENCE 0.999805 ################################################ LOCATION: [177, 55] [186, 68] TEXT: Jb CONFIDENCE 0.00381894 ################################################ LOCATION: [191, 55] [377, 70] TEXT: Qbujfou Mjtu Qfsjpqfsbujwf Usbdljoh CONFIDENCE 0.999996 ################################################ LOCATION: [401, 55] [603, 66] TEXT: Qspwjefs Iboepgg F Nfttbef Dfoufs CONFIDENCE 0.999982 ################################################ LOCATION: [624, 55] [722, 66] TEXT: Ewobnjd Xpslmjtu CONFIDENCE 0.999048 ################################################ LOCATION: [742, 55] [858, 68] TEXT: Sfgfssbm Nbobhfnfou CONFIDENCE 0.997839 ################################################ LOCATION: [882, 55] [958, 68] TEXT: NzFyqfsjfodf CONFIDENCE 0.999368 ################################################ LOCATION: [15, 81] [28, 94] TEXT: M CONFIDENCE 0.999945 ################################################ LOCATION: [29, 79] [86, 94] TEXT: VqUpEbuf CONFIDENCE 0.999511 ################################################ LOCATION: [29, 107] [56, 120] TEXT: EBa CONFIDENCE 0.999826 ################################################ LOCATION: [13, 133] [28, 146] TEXT: XpMb CONFIDENCE 0.0275535 ################################################ LOCATION: [35, 133] [74, 144] TEXT: Qspop CONFIDENCE 0.999905 ################################################ LOCATION: [89, 133] [130, 144] TEXT: Lcopo CONFIDENCE 0.990057

strfic commented 5 months ago

Doesn't work in Windows either. The output heatmap works but the OCR result is just gibberish and garbage.

ksasso1028 commented 5 months ago

@strfic @rmsalinas thank you for bringing this to my attention. I made a fix just now that gives coherent results. Seems like I initially uploaded an older implementation. The issue was due to the character map implementation, I have moved over to a txt file based approach. I dont have a ton of time to keep up with this project, but I will eventually add a config based approach that will utilize the exact char mappings from EasyOCR for all languages supported. For now english g2 only supported - >https://github.com/JaidedAI/EasyOCR/blob/c999505ef6b43be1c4ee36aa04ad979175178352/easyocr/config.py#L145

My output from the update, easyocr-output.txt please note the best accuracy results come from a beam search decoder which I have yet to implement. Thank you for raising issues and I will try to prioritize this repo a bit more

ksasso1028 commented 5 months ago

The issue has been fixed in the latest commit. The commit message is: 28da1ff