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

src is not a numerical tuple #46

Closed
rspreet92 opened this issue Mar 14, 2022 · 2 comments
Closed

src is not a numerical tuple #46

rspreet92 opened this issue Mar 14, 2022 · 2 comments

Comments

@rspreet92
Copy link
Contributor

Giving error, here is the cmd log

\manga-image-translator>python translate_demo.py --mode web --use-inpainting --verbose --translator=google --target-lang=ENG
Namespace(mode='web', image='', image_dst='', size=1536, use_inpainting=True, use_cuda=False, force_horizontal=False, inpainting_size=2048, unclip_ratio=2.3, box_threshold=0.7, text_threshold=0.5, text_mag_ratio=1, translator='google', target_lang='ENG', use_ctd=False, verbose=True)
 -- Loading models
 -- Running in web service mode
 -- Waiting for translation tasks
fail to initialize deepl :
auth_key must not be empty
switch to google translator
Serving up app on 127.0.0.1:5003
 -- Processing task eaab3f4452a83debc847ca8cb754d493e94717ba9052c4b194b4e974b4b9c136-M-google-ENG-default-horizontal
 -- Detection resolution 1536
 -- Detector using default
 -- Render text direction is h
Task state eaab3f4452a83debc847ca8cb754d493e94717ba9052c4b194b4e974b4b9c136-M-google-ENG-default-horizontal to detection
 -- Running text detection
Detection resolution: 1280x1536
Task state eaab3f4452a83debc847ca8cb754d493e94717ba9052c4b194b4e974b4b9c136-M-google-ENG-default-horizontal to ocr
 -- Running OCR
0.8592585325241089 石伸,来自 fg: (38, 38, 41) bg: (38, 38, 41)
0.9998165369033813 莫非这留痕 fg: (46, 49, 55) bg: (45, 50, 55)
0.9551085233688354 远古的星空? fg: (66, 61, 68) bg: (67, 65, 69)
0.9972514510154724 邀游,可这黑色 fg: (68, 64, 73) bg: (68, 68, 76)
0.9320383667945862 么?即便是武帝 fg: (79, 73, 80) bg: (79, 73, 80)
0.9866024255752563 强者,也不敢说 fg: (67, 60, 69) bg: (66, 60, 69)
0.9399910569190979 石碑,竟然是来 fg: (63, 59, 66) bg: (63, 59, 66)
0.9985544681549072 宇宙星空中有什 fg: (78, 74, 81) bg: (77, 73, 78)
0.9888063073158264 自那么一个地方。 fg: (79, 72, 83) bg: (79, 72, 81)
 -- spliting {0, 1, 2}
to split [0, 1, 2]
edge_weights [25.019992006393608, 23.0]
std: 1.0099960031968038, mean: 24.009996003196804
 -- spliting {3, 4, 5, 6, 7, 8}
to split [3, 4, 5, 6, 7, 8]
edge_weights [26.1725046566048, 25.0, 24.0, 23.0, 22.0]
std: 1.463818630272171, mean: 24.03450093132096
region_indices [{0, 1, 2}, {3, 4, 5, 6, 7, 8}]
 -- Generating text mask
Task state eaab3f4452a83debc847ca8cb754d493e94717ba9052c4b194b4e974b4b9c136-M-google-ENG-default-horizontal to mask_generation
100%|███████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 287.99it/s]
 -- Translating
Task state eaab3f4452a83debc847ca8cb754d493e94717ba9052c4b194b4e974b4b9c136-M-google-ENG-default-horizontal to translating
translator google
target_language ENG
 -- Running inpainting
Task state eaab3f4452a83debc847ca8cb754d493e94717ba9052c4b194b4e974b4b9c136-M-google-ENG-default-horizontal to inpainting
Inpainting resolution: 800x1136
_GatheringFuture exception was never retrieved
future: <_GatheringFuture finished exception=error("OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function 'cvtColor'\n> Overload resolution failed:\n>  - src is not a numerical tuple\n>  - Expected Ptr<cv::UMat> for argument 'src'\n")>
Traceback (most recent call last):
  File "F:\xampp\htdocs\manga-rock\manga-image-translator\translate_demo.py", line 148, in infer
    cv2.imwrite(f'result/{task_id}/inpainted.png', cv2.cvtColor(img_inpainted, cv2.COLOR_RGB2BGR))
cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function 'cvtColor'
> Overload resolution failed:
>  - src is not a numerical tuple
>  - Expected Ptr<cv::UMat> for argument 'src'


@zyddnys
Copy link
Owner

zyddnys commented Mar 14, 2022

fixed in d337b52

@rspreet92
Copy link
Contributor Author

rspreet92 commented Mar 15, 2022

Thank you, It's working now.

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

2 participants