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

不支持识别中文路径吗? #479

Open
qq14909 opened this issue Mar 8, 2024 · 2 comments
Open

不支持识别中文路径吗? #479

qq14909 opened this issue Mar 8, 2024 · 2 comments

Comments

@qq14909
Copy link

qq14909 commented Mar 8, 2024

iopaint run --model=lama --device=cpu --image=E:\水印图片 --mask=E:\水印图片\Mask.png --output=E:\去除水印后
2024-03-08 18:21:03.632 | INFO | iopaint.runtime:setup_model_dir:82 - Model directory: C:\Users\Administrator.cache
2024-03-08 18:21:06.277 | INFO | iopaint.batch_processing:batch_inpaint:65 - Using default config: image=None mask=None ldm_steps=20 ldm_sampler=<LDMSampler.plms: 'plms'> zits_wireframe=True hd_strategy=<HDStrategy.CROP: 'Crop'> hd_strategy_crop_trigger_size=800 hd_strategy_crop_margin=128 hd_strategy_resize_limit=1280 prompt='' negative_prompt='' use_croper=False croper_x=0 croper_y=0 croper_height=512 croper_width=512 use_extender=False extender_x=0 extender_y=0 extender_height=640 extender_width=640 sd_scale=1.0 sd_mask_blur=11 sd_strength=1.0 sd_steps=50 sd_guidance_scale=7.5 sd_sampler=<SDSampler.uni_pc: 'UniPC'> sd_seed=42 sd_match_histograms=False sd_outpainting_softness=20.0 sd_outpainting_space=20.0 sd_freeu=False sd_freeu_config=FREEUConfig(s1=0.9, s2=0.2, b1=1.2, b2=1.4) sd_lcm_lora=False sd_keep_unmasked_area=True cv2_flag=<CV2Flag.INPAINT_NS: 'INPAINT_NS'> cv2_radius=4 paint_by_example_example_image=None p2p_image_guidance_scale=1.5 enable_controlnet=False controlnet_conditioning_scale=0.4 controlnet_method='lllyasviel/control_v11p_sd15_canny' powerpaint_task=<PowerPaintTask.text_guided: 'text-guided'> fitting_degree=1.0
2024-03-08 18:21:06.278 | INFO | iopaint.model_manager:init_model:38 - Loading model: lama
2024-03-08 18:21:06.279 | INFO | iopaint.helper:load_jit_model:107 - Loading model from: C:\Users\Administrator.cache\torch\hub\checkpoints\big-lama.pt
⠋ Batch processing... ---------------------------------------- 0% 0/6 0:00:00[ WARN:[email protected]] global loadsave.cpp:248 cv::findDecoder imread_('E:\姘村嵃鍥剧墖\082826baqc53xr35xza45u.jpg'): can't open/read file: check file path/integrity
⠋ Batch processing... ---------------------------------------- 0% 0/6 0:00:00
┌─────────────────────────────── Traceback (most recent call last) ────────────────────────────────┐
│ C:\Program Files\Python312\Lib\site-packages\iopaint\cli.py:94 in run │
│ │
│ 91 │ │
│ 92 │ from iopaint.batch_processing import batch_inpaint │
│ 93 │ │
│ > 94 │ batch_inpaint(model, device, image, mask, output, config, concat) │
│ 95 │
│ 96 │
│ 97 @typer_app.command(help="Start IOPaint server") │
│ │
│ C:\Program Files\Python312\Lib\site-packages\iopaint\batch_processing.py:96 in batch_inpaint │
│ │
│ 93 │ │ │ infos = Image.open(image_p).info │
│ 94 │ │ │ │
│ 95 │ │ │ img = cv2.imread(str(image_p)) │
│ > 96 │ │ │ img = cv2.cvtColor(img, cv2.COLOR_BGRA2RGB) │
│ 97 │ │ │ mask_img = cv2.imread(str(mask_p), cv2.IMREAD_GRAYSCALE) │
│ 98 │ │ │ if mask_img.shape[:2] != img.shape[:2]: │
│ 99 │ │ │ │ progress.log( │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:196: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

@yumianhuli1
Copy link

是的

@waylake
Copy link

waylake commented Mar 26, 2024

The path problem of the file being read by opencv.
If there are Chinese, Korean, or Japanese in the path of the image, an error occurs.
In my case, I solved it through a relative path that does not include the above language, but it is fundamentally a path problem.

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

3 participants