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

[Bug]: 在放入长图片时如720*7000的尺寸时在导出时会报错误 #784

Open
yyf20010622 opened this issue Dec 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@yyf20010622
Copy link

Issue

在放入长图片时如720*7000的尺寸时在导出时会报错误
0
](url)

Command Line Arguments

No response

Console logs

New `submit` task c2562fc13719e06db968e4961a1cc6e691573fa9644f3d6f6f90301a686d36c9-1536-m2m100_big-CHS-default-auto
[web_client] Processing task c2562fc13719e06db968e4961a1cc6e691573fa9644f3d6f6f90301a686d36c9-1536-m2m100_big-CHS-default-auto
[web_client] Translating: "E:\ai.photo\manga-image-translator\manga-image-translator\result\c2562fc13719e06db968e4961a1cc6e691573fa9644f3d6f6f90301a686d36c9-1536-m2m100_big-CHS-default-auto\input.jpg"
[web_client] Loading models
[web_client] Running text detection
Task state c2562fc13719e06db968e4961a1cc6e691573fa9644f3d6f6f90301a686d36c9-1536-m2m100_big-CHS-default-auto to {'info': 'detection', 'finished': False}
Input image will be rearranged to square batches before fed into network.
 Rearranged batches will be saved to result/rearrange_%d.png
[DefaultDetector] Detection resolution: 720x14429
[web_client] Running ocr
Task state c2562fc13719e06db968e4961a1cc6e691573fa9644f3d6f6f90301a686d36c9-1536-m2m100_big-CHS-default-auto to {'info': 'ocr', 'finished': False}
[Model48pxCTCOCR] prob: 0.7147981722212554 5taff fg: (246, 239, 238) bg: (247, 237, 239)
[Model48pxCTCOCR] prob: 0.999373748726751 I'VE fg: (4, 5, 6) bg: (5, 7, 7)
[Model48pxCTCOCR] prob: 0.9988596779779901 YES, fg: (3, 5, 3) bg: (3, 6, 4)
[Model48pxCTCOCR] prob: 0.9984378940482913 STOP. fg: (3, 4, 6) bg: (2, 4, 6)
[Model48pxCTCOCR] prob: 0.9504783583379958 BUT I fg: (1, 0, 1) bg: (3, 1, 2)
[Model48pxCTCOCR] prob: 0.9997997379894811 TRUE. fg: (4, 5, 6) bg: (3, 5, 7)
[Model48pxCTCOCR] prob: 0.9979440586795659 TIME... fg: (4, 4, 6) bg: (3, 3, 5)
[Model48pxCTCOCR] prob: 0.9393118272293118 I KNOW fg: (1, 2, 5) bg: (1, 3, 6)
[Model48pxCTCOCR] prob: 0.9988271167716505 CLOSE, fg: (4, 3, 5) bg: (4, 3, 5)
[Model48pxCTCOCR] prob: 0.9040863992784227 Chapter 留B fg: (239, 233, 233) bg: (239, 232, 233)
[Model48pxCTCOCR] prob: 0.9996909204186353 SHE WAS, fg: (4, 6, 6) bg: (3, 5, 6)
[Model48pxCTCOCR] prob: 0.9987013018034377 OBSERVED fg: (2, 2, 4) bg: (2, 3, 5)
[Model48pxCTCOCR] prob: 0.9986486980032174 FATHER. fg: (103, 38, 40) bg: (103, 37, 41)
[Model48pxCTCOCR] prob: 0.9961666553562908 I SHOULD fg: (3, 3, 4) bg: (2, 2, 3)
[Model48pxCTCOCR] prob: 0.9677116010220882 SO I WAS fg: (3, 3, 5) bg: (3, 3, 6)
[Model48pxCTCOCR] prob: 0.9992403534536762 DOHYUN. fg: (4, 5, 7) bg: (3, 5, 6)
[Model48pxCTCOCR] prob: 0.9990920288559605 THAT GIRL fg: (3, 2, 4) bg: (4, 3, 5)
[Model48pxCTCOCR] prob: 0.9840175434329098 SOMIN. YOU fg: (4, 6, 7) bg: (3, 6, 7)
[Model48pxCTCOCR] prob: 0.9978704291402143 PUT A STOP TO fg: (1, 1, 1) bg: (0, 2, 2)
[Model48pxCTCOCR] prob: 0.9616383346135128 YOU ALL THIS fg: (1, 1, 3) bg: (1, 2, 3)
[Model48pxCTCOCR] prob: 0.6095331633510439 Tiansat監en fg: (241, 235, 237) bg: (240, 235, 237)
[Model48pxCTCOCR] prob: 0.996633796821481 CURIOUS WHAT fg: (2, 3, 4) bg: (2, 3, 4)
[Model48pxCTCOCR] prob: 0.9809296664494641 SOMIN.... AND fg: (3, 5, 7) bg: (3, 5, 6)
[Model48pxCTCOCR] prob: 0.9506450393053308 TOLERATE. IT'S  fg: (1, 2, 4) bg: (2, 4, 5)
[Model48pxCTCOCR] prob: 0.9997005433343557 ABOUT BOTH fg: (1, 1, 6) bg: (1, 1, 5)
[Model48pxCTCOCR] prob: 0.9981101215504058 KIND OF PERSON fg: (2, 3, 3) bg: (2, 4, 3)
[Model48pxCTCOCR] prob: 0.9997584185619834 YOU'RE NOT THE fg: (1, 1, 3) bg: (1, 2, 3)
[Model48pxCTCOCR] prob: 0.9979031697668271 I JUST COULDN'T fg: (2, 1, 4) bg: (2, 2, 4)
[Model48pxCTCOCR] prob: 0.9537286346006555 TO PLAY DUMB fg: (2, 1, 4) bg: (1, 2, 3)
[Model48pxCTCOCR] prob: 0.9449425618289673  LUNAR SCANS fg: (248, 242, 243) bg: (246, 244, 244)
[Model48pxCTCOCR] prob: 0.9998615632148268 ABOUT THINGS fg: (2, 2, 3) bg: (2, 3, 4)
[Model48pxCTCOCR] prob: 0.9952334063869228 STOP IT NOW, fg: (50, 15, 17) bg: (53, 15, 18)
[Model48pxCTCOCR] prob: 0.9999714434201111 SOMETHING THAT fg: (1, 1, 2) bg: (2, 2, 3)
[Model48pxCTCOCR] prob: 0.9972619677903966 TWO ARE VERY fg: (2, 3, 5) bg: (2, 4, 6)
[Model48pxCTCOCR] prob: 0.9654955405452114 TYPE OF PERSON fg: (0, 0, 3) bg: (0, 1, 3)
[Model48pxCTCOCR] prob: 0.8881804991967154 THAT'S NIT HIW YOU DOIT fg: (251, 247, 250) bg: (250, 248, 250)
[Model48pxCTCOCR] prob: 0.9997891089933486 YOU'RE RIGHT. fg: (2, 4, 4) bg: (1, 4, 5)
Task state c2562fc13719e06db968e4961a1cc6e691573fa9644f3d6f6f90301a686d36c9-1536-m2m100_big-CHS-default-auto to {'info': 'textline_merge', 'finished': False}
[web_client] Running text translation
Task state c2562fc13719e06db968e4961a1cc6e691573fa9644f3d6f6f90301a686d36c9-1536-m2m100_big-CHS-default-auto to {'info': 'translating', 'finished': False}
[M2M100BigTranslator] Translating into Chinese (Simplified)
[M2M100BigTranslator] 0: LUNAR SCANS THAT'S NIT HIW YOU DOIT Chapter 留B 5taff Tiansat監en => LUNAR SCANS THAT'S NIT HIW You Doit Chapter 留B 5taff Tiansat监禁
[M2M100BigTranslator] 1: STOP IT NOW, FATHER. => 现在就停止吧, 父亲。
[M2M100BigTranslator] 2: I'VE OBSERVED YOU ALL THIS TIME... => 我一直在观察你这一次......
[M2M100BigTranslator] 3: I KNOW YOU'RE NOT THE TYPE OF PERSON TO PLAY DUMB ABOUT THINGS => 我知道你不是那种玩傻的事情的 人。
[M2M100BigTranslator] 4: ABOUT BOTH SOMIN.... AND DOHYUN. => 關於兩個 Somin...和 Dohyun。
[M2M100BigTranslator] 5: YES, I SHOULD STOP. => 是的, 我应该停止。
[M2M100BigTranslator] 6: YOU'RE RIGHT. => 你是对的。
[M2M100BigTranslator] 7: THAT GIRL SOMIN. YOU TWO ARE VERY CLOSE, => 你們兩人是非常接近的,
[M2M100BigTranslator] 8: SO I WAS CURIOUS WHAT KIND OF PERSON SHE WAS, => 我很奇怪, 她是怎样的人。
[M2M100BigTranslator] 9: BUT I PUT A STOP TO SOMETHING THAT I JUST COULDN'T TOLERATE. IT'S  TRUE. => 但是我要停止做一些 我不忍受的事情, 这是真的。
[web_client] Running mask refinement
Task state c2562fc13719e06db968e4961a1cc6e691573fa9644f3d6f6f90301a686d36c9-1536-m2m100_big-CHS-default-auto to {'info': 'mask-generation', 'finished': False}
[mask]: 100%|█████████████████████████████████████████████████████████████████████████| 37/37 [00:00<00:00, 231.87it/s]
Task state c2562fc13719e06db968e4961a1cc6e691573fa9644f3d6f6f90301a686d36c9-1536-m2m100_big-CHS-default-auto to {'info': 'inpainting', 'finished': False}
[LamaMPEInpainter] Inpainting resolution: 104x2048
[web_client] Running rendering
Task state c2562fc13719e06db968e4961a1cc6e691573fa9644f3d6f6f90301a686d36c9-1536-m2m100_big-CHS-default-auto to {'info': 'rendering', 'finished': False}
[render] font_size_minimum 101
[render]:   0%|                                                                                 | 0/10 [00:00<?, ?it/s]
Task state c2562fc13719e06db968e4961a1cc6e691573fa9644f3d6f6f90301a686d36c9-1536-m2m100_big-CHS-default-auto to {'info': 'error', 'finished': True}
ERROR: [web_client] TypeError: 'numpy.float64' object cannot be interpreted as an integer
Traceback (most recent call last):
  File "E:\ai.photo\manga-image-translator\manga-image-translator\manga_translator\__main__.py", line 73, in <module>
    loop.run_until_complete(dispatch(args))
  File "E:\ai.photo\manga-image-translator\manga-image-translator\env\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "E:\ai.photo\manga-image-translator\manga-image-translator\manga_translator\__main__.py", line 50, in dispatch
    await translator.listen(args_dict)
  File "E:\ai.photo\manga-image-translator\manga-image-translator\manga_translator\manga_translator.py", line 653, in listen
    await self.translate_path(self._result_path('input.jpg'), self._result_path('final.jpg'), params=self._params)
  File "E:\ai.photo\manga-image-translator\manga-image-translator\manga_translator\manga_translator.py", line 136, in translate_path
    await self._translate_file(path, _dest, params)
  File "E:\ai.photo\manga-image-translator\manga-image-translator\manga_translator\manga_translator.py", line 182, in _translate_file
    translation_dict = await self.translate(img, params)
  File "E:\ai.photo\manga-image-translator\manga-image-translator\manga_translator\manga_translator.py", line 248, in translate
    return await self._translate(ctx)
  File "E:\ai.photo\manga-image-translator\manga-image-translator\manga_translator\manga_translator.py", line 388, in _translate
    ctx.img_rendered = await self._run_text_rendering(ctx)
  File "E:\ai.photo\manga-image-translator\manga-image-translator\manga_translator\manga_translator.py", line 476, in _run_text_rendering
    output = await dispatch_rendering(ctx.img_inpainted, ctx.text_regions, ctx.font_path, ctx.font_size, ctx.font_size_offset,
  File "E:\ai.photo\manga-image-translator\manga-image-translator\manga_translator\rendering\__init__.py", line 116, in dispatch
    img = render(img, region, dst_points, hyphenate)
  File "E:\ai.photo\manga-image-translator\manga-image-translator\manga_translator\rendering\__init__.py", line 134, in render
    temp_box = text_render.put_text_horizontal(
  File "E:\ai.photo\manga-image-translator\manga-image-translator\manga_translator\rendering\text_render.py", line 663, in put_text_horizontal
    canvas_text = np.zeros((canvas_h, canvas_w), dtype=np.uint8)
TypeError: 'numpy.float64' object cannot be interpreted as an integer
Restarting translator process
[web_client] Namespace(mode='web_client', input=None, dest='', target_lang='CHS', verbose=True, format=None, detector='default', ocr='48px_ctc', inpainter='lama_mpe', upscaler='esrgan', upscale_ratio=None, colorizer=None, translator='google', translator_chain=None, selective_translation=None, use_cuda=True, use_cuda_limited=False, model_dir=None, attempts=0, ignore_errors=False, overwrite=False, 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, inpainting_size=2048, colorization_size=576, denoise_sigma=30, font_size=None, font_size_offset=0, font_size_minimum=-1, 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, 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='8add8648b2fedf054f9cad513e4b0cc4', ws_url='ws://localhost:5000', save_quality=100, ignore_bubble=0)
@yyf20010622 yyf20010622 added the bug Something isn't working label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant