Sanster / IOPaint

Image inpainting tool powered by SOTA AI Model. Remove any unwanted object, defect, people from your pictures or erase and replace(powered by stable diffusion) any thing on your pictures.
https://www.iopaint.com/
Apache License 2.0
17.34k stars 1.75k forks source link

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

Open qq14909 opened 2 months ago

qq14909 commented 2 months ago

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_jitmodel:107 - Loading model from: C:\Users\Administrator.cache\torch\hub\checkpoints\big-lama.pt ⠋ Batch processing... ---------------------------------------- 0% 0/6 0:00:00[ WARN:0@1.168] 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 commented 1 month ago

是的

waylake commented 1 month ago

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.