SubhamTyagi / android-ocr

Tesseract based OCR for android
Apache License 2.0
401 stars 67 forks source link

[FIXED] Help needed side loading trained data? #32

Open older-pack opened 3 years ago

older-pack commented 3 years ago

Hi, internet access doesn't work on my device. So I can't directly download the trained data. But I can side load data.

I've read #29 and I can the see data goes in /storage/emulated/0/Android/data/io.github.subhamtyagi.ocr/files/best

As an example, I've downloaded the "Fast" english data from here https://github.com/tesseract-ocr/tessdata_fast/blob/master/eng.traineddata

And I copied that eng.traineddata to /storage/emulated/0/Android/data/io.github.subhamtyagi.ocr/files/fast But the app still doesn't see it!

Am I doing it correctly? I noticed another directory called .../fast/tesstata Should I put something in there too?

Any help on side loading would be much appreciated. Thanks

SubhamTyagi commented 3 years ago

Choose data type as "fast" in setting also.

older-pack commented 3 years ago

Thanks for the reply. I have selected "Fast" in the settings but the screen just stays black and a message "You are not connected to the internet" appears. I tried rebooting the device too, but it didn't help.

I'm definitely not a developer, but I have got adb installed. I don't suppose I could use it to do anything extra that might help?

SubhamTyagi commented 3 years ago

for convenience I will provide a option in Setting to locate previously downloaded training data.

older-pack commented 3 years ago

Thank you. That's great news. I really appreciate it :smile: :thumbsup:

older-pack commented 2 years ago

Hi I'd just like to report back that I managed to get this working.

Firstly I updated to the latest 3.0 version but I don't think that was the main fix.

I think the actual fix was simply to move the eng.traineddata into the sub-folder .../fast/tesstata that I mentioned in my first post.

Then I opened the OCR app. The app screen was all black as before. I didn't think it was working. But I hit the red icon in the bottom corner. This time instead of trying to go online to get the traineddata it asked what source to use (choice of two camera apps or file manager)

Once it had an image I could crop it. And presto it OCRed it very quickly.

This is just great. Very impressed. And all done offline. :thumbsup: :thumbsup: :thumbsup:

I don't know why I didn't try the tessdata sub-directory before... :roll_eyes: :blush: :woozy_face:

So to summaries how I side loaded the traineddata:

Very easy.

Thanks for the great app. :smiley: :thumbsup: :icecream: