Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including manga ocr in android app? #83

Open
clausagerskov opened this issue Nov 5, 2024 · 3 comments
Open

Including manga ocr in android app? #83

clausagerskov opened this issue Nov 5, 2024 · 3 comments

Comments

@clausagerskov
Copy link

How feasible would it be to use manga ocr to power a manga reading app?
Would a typical smartphone be able to run ocr on a line of text in a reasonable amount of time?
How big would the installation be?
And would it even be technically possible to include it in the app code?

@Mar2ck
Copy link
Contributor

Mar2ck commented Nov 20, 2024

I got manga-ocr running on Android via termux and it took about 3-4 seconds per image on a Snapdragon 8+ Gen 1. That's a significant delay but not unuseably slow.

Shipping PyTorch in an app is very impractical though, realistically you would port to ONNX and run the model on NPU via NNAPI to speed up inference and reduce battery consumption. Also the model itself is 444 MB so quantizing to int8/int4 would be a must to keep storage requirements down.

@lifes71
Copy link

lifes71 commented Dec 5, 2024

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1726, in _slow_forward result = self.forward(*input, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\models\bert\modeling_bert.py", line 1357, in forward outputs = self.bert( ^^^^^^^^^^ File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1736, in _wrapped_call_impl return self._call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1747, in _call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch\nn\modules\module.py", line 1726, in _slow_forward result = self.forward(*input, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python311\Lib\site-packages\transformers\models\bert\modeling_bert.py", line 1062, in forward raise ValueError("You have to specify either input_ids or inputs_embeds") ValueError: You have to specify either input_ids or inputs_embeds
@Mar2ck can you help?

@Mar2ck
Copy link
Contributor

Mar2ck commented Dec 9, 2024

can you help?

You should make a seperate issue for this. In the issue put how you're getting to this error: installing from pip or cloning the repo, the command you're running, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants