Kocarus / Manga-Translator-TesseractOCR

Automatically translates manga pages with Tesseract-OCR and Google Translate API for Python
100 stars 24 forks source link

I need help #1

Closed ghost closed 5 years ago

ghost commented 5 years ago

Traceback (most recent call last): File "C:/Users/topra/Desktop/Manga-Translator-TesseractOCR-master/manga_translate.py", line 67, in main() File "C:/Users/topra/Desktop/Manga-Translator-TesseractOCR-master/manga_translate.py", line 25, in main blurbs = locate_bubbles.get_blurbs(img) File "C:\Users\topra\Desktop\Manga-Translator-TesseractOCR-master\locate_bubbles.py", line 84, in get_blurbs text = pytesseract.image_to_string(pil_image, lang="jpn_vert", config=get_params()) File "C:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 294, in image_to_string return run_and_get_output(*args) File "C:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 202, in run_and_get_output run_tesseract(**kwargs) File "C:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 172, in run_tesseract raise TesseractNotFoundError() pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your path

ghost commented 5 years ago

and i try something and it says another problem Traceback (most recent call last): File "C:/Users/topra/Desktop/Manga-Translator-TesseractOCR-master/manga_translate.py", line 67, in main() File "C:/Users/topra/Desktop/Manga-Translator-TesseractOCR-master/manga_translate.py", line 25, in main blurbs = locate_bubbles.get_blurbs(img) File "C:\Users\topra\Desktop\Manga-Translator-TesseractOCR-master\locate_bubbles.py", line 88, in get_blurbs print ("Attempt: " + text + ' -> ' + translator.translate(text,dest='vi').text) File "C:\Python27\lib\site-packages\googletrans\client.py", line 172, in translate data = self._translate(text, dest, src) File "C:\Python27\lib\site-packages\googletrans\client.py", line 75, in _translate token = self.token_acquirer.do(text) File "C:\Python27\lib\site-packages\googletrans\gtoken.py", line 180, in do self._update() File "C:\Python27\lib\site-packages\googletrans\gtoken.py", line 59, in _update code = unicode(self.RE_TKK.search(r.text).group(1)).replace('var ', '') AttributeError: 'NoneType' object has no attribute 'group'

Kocarus commented 5 years ago

first, you need to install Tesseract to your system, follow this one: https://github.com/tesseract-ocr/tesseract/wiki#installation

ghost commented 5 years ago

i download tesseract succesfully and it says: Traceback (most recent call last): File "C:\Users\topra\Downloads\Compressed\Manga-Translator-TesseractOCR-master\manga_translate.py", line 67, in main() File "C:\Users\topra\Downloads\Compressed\Manga-Translator-TesseractOCR-master\manga_translate.py", line 25, in main blurbs = locate_bubbles.get_blurbs(img) File "C:\Users\topra\Downloads\Compressed\Manga-Translator-TesseractOCR-master\locate_bubbles.py", line 88, in get_blurbs print ("Attempt: " + text + ' -> ' + translator.translate(text,dest='vi').text) File "C:\Python27\lib\site-packages\googletrans\client.py", line 172, in translate data = self._translate(text, dest, src) File "C:\Python27\lib\site-packages\googletrans\client.py", line 75, in _translate token = self.token_acquirer.do(text) File "C:\Python27\lib\site-packages\googletrans\gtoken.py", line 180, in do self._update() File "C:\Python27\lib\site-packages\googletrans\gtoken.py", line 59, in _update code = unicode(self.RE_TKK.search(r.text).group(1)).replace('var ', '') AttributeError: 'NoneType' object has no attribute 'group'

Kocarus commented 5 years ago

Search phrase for these kinds of bug is mostly some part at the end of the error: "code = unicode(self.RE_TKK.search(r.text).group(1)).replace('var ', '') AttributeError: 'NoneType' object has no attribute 'group' "

You should try searching Google first instead of just posting errors ...

Kocarus commented 5 years ago

This is an issue from Googletrans library: https://github.com/ssut/py-googletrans/issues/88 https://stackoverflow.com/questions/52455774/googletrans-stopped-working-with-error-nonetype-object-has-no-attribute-group/52487148#52487148

ghost commented 5 years ago

man im new i dont know codding and like this i just want use this please help. I try anything i have a tesseract and pytesseract too but it says: FTraceback (most recent call last): File "C:\Users\topra\Downloads\Compressed\Manga-Translator-TesseractOCR-master\Manga-Translator-TesseractOCR-master\manga_translate.py", line 67, in main() File "C:\Users\topra\Downloads\Compressed\Manga-Translator-TesseractOCR-master\Manga-Translator-TesseractOCR-master\manga_translate.py", line 25, in main blurbs = locate_bubbles.get_blurbs(img) File "C:\Users\topra\Downloads\Compressed\Manga-Translator-TesseractOCR-master\Manga-Translator-TesseractOCR-master\locate_bubbles.py", line 84, in get_blurbs text = pytesseract.image_to_string(pil_image, lang="jpn_vert", config=get_params()) File "C:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 294, in image_to_string return run_and_get_output(*args) File "C:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 202, in run_and_get_output run_tesseract(**kwargs) File "C:\Python27\lib\site-packages\pytesseract\pytesseract.py", line 178, in run_tesseract raise TesseractError(status_code, get_errors(error_string)) pytesseract.pytesseract.TesseractError: (1, u'read_params_file: parameter not found:')

Kocarus commented 5 years ago

No, you don't have pytesseract yet. That's exactly what the errors point out. You have to install pytesseract inside PyCharm along with necessary packages: https://i.imgur.com/EwPHY1p.png https://pypi.org/project/pytesseract/

These things are open-source, errors surely happen all the time. Noone can fix everything you encounter. People can only give suggestion. You have to figure out on your own. This is how Github works.

Kocarus commented 5 years ago

Also, it's really hard to use these stuff without basic knowledge of programming. It's definitely not a tool. If you just wanna read translated manga, use translation software around instead. For ex: http://translator.fatginger.cat/ (register account, then upload manga pages in Japanese and let it handle the rest)

Kocarus commented 5 years ago

Certainly, you will wanna scrape images from manga sites. The instruction along with some other non-technical techniques are shared on my blog: https://kocarus.blogspot.com/2018/08/translate-raw-manga-to-english.html

ghost commented 5 years ago

Dude i finally did it !!!!!! but i want translate to turkish, i think turkish characters are not supported

ghost commented 5 years ago

https://i.imgur.com/GboDuDy.jpg i tried eng but hmph its like random alphabet how can i fix this?

Kocarus commented 5 years ago

Congratz, you made it

The reason why it's glitchy as f*ck is because it's a side project from a student. I forked and modified to make it work. He didn't focus much on accuracy, like how to split sentence and combine Japanese grammar logically beforehand. Tbh, that's researcher duty to optimize it. If you 'd like to do so, you have to learn programming :D If you need to read mangas with high accuracy, just use the site I recommended above: https://i.imgur.com/KrPywbN.png

Cheers

ghost commented 5 years ago

Okay man thanks for help i close this issue Cheers