ilovin / lstm_ctc_ocr

Use CTC + tensorflow to OCR
https://ilovin.github.io/2017-04-06/tensorflow-lstm-ctc-ocr/
354 stars 140 forks source link

字符的长度应该是63个吧 #51

Closed fancyerii closed 6 years ago

fancyerii commented 6 years ago

有效的字符是a-zA-Z0-9 62个,然后加上一个空(epsilon),共63个。我测试了一下把它改成63,效果没有任何变化。

$ git diff diff --git a/lib/lstm/config.py b/lib/lstm/config.py index 3b1a322..e61cc3b 100644 --- a/lib/lstm/config.py +++ b/lib/lstm/config.py @@ -20,7 +20,7 @@ C.IMG_HEIGHT = 32 C.MAX_CHAR_LEN = 6 C.BLANK_TOKEN=0 C.CHARSET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' -C.NCLASSES = len(C.CHARSET)+2 +C.NCLASSES = len(C.CHARSET)+1

ilovin commented 6 years ago

https://github.com/ilovin/lstm_ctc_ocr/issues/35 https://github.com/ilovin/lstm_ctc_ocr/issues/49 it's only a trick

fancyerii commented 6 years ago

哦,是为了兼容warpctc和tf的ctc。