zyddnys / manga-image-translator

Translate manga/image 一键翻译各类图片内文字 https://cotrans.touhou.ai/
https://cotrans.touhou.ai/
GNU General Public License v3.0
5.09k stars 523 forks source link

[Bug]: Web server giving FileNotFoundError on any inputs #627

Closed Aikin-Ai closed 2 months ago

Aikin-Ai commented 4 months ago

Issue

After the latest commit c101755d774a37c610feb0f80fe648166840cdfb, the web server gives this error when trying to submit any image. Reverting the commit fixes the problem.

Command Line Arguments

python -m manga_translator -v --mode web

Console logs

[web] Running in web mode
Serving up app on http://127.0.0.1:5003

[web_client] Namespace(mode='web_client', input=None, dest='', target_lang='CHS', verbose=True, format=None, attempts=0, ignore_errors=False, overwrite=False, skip_no_text=False, model_dir=None, skip_lang=None, use_gpu=True, use_gpu_limited=False, detector='default', ocr='48px', use_mocr_merge=False, inpainter='lama_large', upscaler='esrgan', upscale_ratio=None, colorizer=None, translator='google', translator_chain=None, selective_translation=None, revert_upscaling=False, detection_size=1536, det_rotate=False, det_auto_rotate=False, det_invert=False, det_gamma_correct=False, unclip_ratio=2.3, box_threshold=0.7, text_threshold=0.5, min_text_length=0, no_text_lang_skip=False, inpainting_size=2048, inpainting_precision='fp32', colorization_size=576, denoise_sigma=30, mask_dilation_offset=0, font_size=None, font_size_offset=0, font_size_minimum=-1, font_color=None, line_spacing=None, force_horizontal=False, force_vertical=False, align_left=False, align_center=False, align_right=False, uppercase=False, lowercase=False, no_hyphenation=False, manga2eng=False, gpt_config=None, use_mtpe=False, save_text=False, save_text_file='', filter_text=None, prep_manual=False, font_path='', gimp_font='Sans-serif', host='127.0.0.1', port=5003, nonce='023a439297e16a7ca00ab6b505c5bcd2', ws_url='ws://localhost:5000', save_quality=100, ignore_bubble=0, kernel_size=3)
[web_client] Running in web_client mode
[web_client] Waiting for translation tasks
[SakuraTranslator] 您当前选择了Sakura 0.9版本,暂不支持术语表
New `submit` task bbb1cec1c6077926810d1b4db82ae4d80fd87039730e1beffc3187260fc83fc3-1536-google-CHS-default-auto
[web_client] Processing task bbb1cec1c6077926810d1b4db82ae4d80fd87039730e1beffc3187260fc83fc3-1536-google-CHS-default-auto
ERROR: [web_client] FileNotFoundError: G:\manga-image-translator\result\bbb1cec1c6077926810d1b4db82ae4d80fd87039730e1beffc3187260fc83fc3-1536-google-CHS-default-auto\input.jpg
Traceback (most recent call last):
  File "G:\manga-image-translator\manga_translator\__main__.py", line 73, in <module>
    loop.run_until_complete(dispatch(args))
  File "C:\Users\andre\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "G:\manga-image-translator\manga_translator\__main__.py", line 50, in dispatch
    await translator.listen(args_dict)
  File "G:\manga-image-translator\manga_translator\manga_translator.py", line 747, in listen
    await self.translate_path(self._result_path('input.jpg'), self._result_path('final.jpg'),
  File "G:\manga-image-translator\manga_translator\manga_translator.py", line 125, in translate_path
    raise FileNotFoundError(path)
FileNotFoundError: G:\manga-image-translator\result\bbb1cec1c6077926810d1b4db82ae4d80fd87039730e1beffc3187260fc83fc3-1536-google-CHS-default-auto\input.jpg
Restarting translator process
RicardoLee2020 commented 4 months ago

Hello, bro. The same FileNotFound error here. A beginner no idea what is docker and how it works. just follow the instructions. Could you please tell me how to revert to the previous version. I would really appreciate if it could be more detailed steps. Thank you.

zyddnys commented 2 months ago

it's fixed now