alicewish / MomoTranslator

Pure OpenCV comic translation tool
MIT License
203 stars 28 forks source link

Installing on linux issues #29

Closed wwardaww closed 7 months ago

wwardaww commented 7 months ago

image

Hi, we cannot open the gui

Traceback (most recent call last):
  File "/media/arda/E64E3CD94E3CA3E91/Projeler/MomoTranslator/pyqt5_momotranslator.py", line 45, in <module>
    from PyQt6.QtCore import QPointF, QRectF, QSettings, QSize, QTranslator, Qt, pyqtSignal
ImportError: /home/arda/.local/lib/python3.10/site-packages/PyQt6/QtCore.abi3.so: undefined symbol: _ZN14QReadWriteLock16destroyRecursiveEP21QReadWriteLockPrivate, version Qt_6_PRIVATE_API
alicewish commented 7 months ago

What device and OS are you using?

wwardaww commented 7 months ago

Ubuntu 22.04 and desktop

wwardaww commented 7 months ago

and also im using python 3.10

wwardaww commented 7 months ago

hi i found it!! i install pyqt6==6.2.0 and then i un comment nltk but now i have another problem:

Traceback (most recent call last):
  File "/media/arda/E64E3CD94E3CA3E91/Projeler/MomoTranslator/pyqt5_momotranslator.py", line 9315, in <module>
    msyh_font20 = ImageFont.truetype(msyh_font_ttc, 20)
  File "/home/arda/.local/lib/python3.10/site-packages/PIL/ImageFont.py", line 797, in truetype
    return freetype(font)
  File "/home/arda/.local/lib/python3.10/site-packages/PIL/ImageFont.py", line 794, in freetype
    return FreeTypeFont(font, size, index, encoding, layout_engine)
  File "/home/arda/.local/lib/python3.10/site-packages/PIL/ImageFont.py", line 230, in __init__
    load_from_bytes(font)
  File "/home/arda/.local/lib/python3.10/site-packages/PIL/ImageFont.py", line 210, in load_from_bytes
    self.font_bytes = f.read()
AttributeError: 'NoneType' object has no attribute 'read'

image

wwardaww commented 7 months ago

Hi i fix the all issue but interface is chiniese is there a way to change it or should i translate it? i willopen a pr for fixes it's looks like when program cant found the font it's fails

alicewish commented 7 months ago

comment lang_code = 'zh_CN' uncomment # lang_code = 'en_US'

alicewish commented 7 months ago

Install font 微软雅黑 or change global_font_name and font_dic accordingly in your MomoTranslator_XXX_config.yml file

wwardaww commented 7 months ago

now i can access gui bu i cant process this image

RCO007_1663976825

console output

image

trace:

image

gui:

image

check_pts image:

check_pts

alicewish commented 7 months ago

There is one bubble so there should only be one textblock but the check_pts image shows two textblocks, one with blue filling and one with white filling. Give me the whole name of the scan file, I'll use it to find the file and get a proper WLB_ext_px value.

wwardaww commented 7 months ago

what is scan file? iamge name is : RCO003_1663976825.jpg

alicewish commented 7 months ago

You can get the newest code and try again. Remember to download comictextdetector.pt.onnx if you hadn't.

Also I tried the image myself: 287463623-e8118492-4643-4c8d-bb0c-f3843fce82e6-画格 287463623-e8118492-4643-4c8d-bb0c-f3843fce82e6-CTD

alicewish commented 7 months ago

If you are famaliar with Python then change config file to do_mode: 'do_dev_folder' The error message might be clearer without the GUI.

wwardaww commented 7 months ago

thx for the assist i will try tomorrow

wwardaww commented 7 months ago

Progress update

AND ITS WORKING !!!

image

alicewish commented 7 months ago

In the config file, when using do_mode: 'do_dev_folder', change folder_name to your actual folder name, also make sure there is a corresponding folder under ComicProcess folder with that name.

alicewish commented 7 months ago

Search for comictextdetector.pt.onnx in the code and you'll get the path. Or you can change the path in the code.

alicewish commented 7 months ago

In the config file, change target_lang: 'zh-CN' to your desired language, and make sure it is valid. See more at https://github.com/nidhaloff/deep-translator

The ChatGPT web translator is written for Mac automation and does not work on any other system.

alicewish commented 7 months ago

I forgot to put in from statistics import median, multimode, mean can be from statistics or from cv2 or from numpy, not much difference. Code updated on that.

wwardaww commented 7 months ago

I forgot to put in from statistics import median, multimode, mean can be from statistics or from cv2 or from numpy, not much difference. Code updated on that.

mean on cv2 expecting diffrent format (some numpy) so it's also must import from statistics