SadTalker icon indicating copy to clipboard operation
SadTalker copied to clipboard

ValueError: input_path must be a valid path to video/image file

Open nemoiee opened this issue 1 year ago • 5 comments

I have a new problem when I run the programs in docker.

    --driven_audio /host_dir/deyu.wav \
    --source_image /host_dir/image.jpg \
    --expression_scale 1.0 \
    --still \
    --result_dir /host_dir
./checkpoints/epoch_20.pth
./checkpoints/auido2pose_00140-model.pth
./checkpoints/auido2exp_00300-model.pth
./checkpoints/facevid2vid_00189-model.pth.tar
./checkpoints/mapping_00229-model.pth.tar
Traceback (most recent call last):
  File "inference.py", line 131, in <module>
    main(args)
  File "inference.py", line 64, in main
    first_coeff_path, crop_pic_path =  preprocess_model.generate(pic_path, first_frame_dir)
  File "/app/SadTalker/src/utils/preprocess.py", line 65, in generate
    raise ValueError('input_path must be a valid path to video/image file')
ValueError: input_path must be a valid path to video/image file

I wanna know how I can solve it. Thanks.

nemoiee avatar Oct 09 '23 09:10 nemoiee

I have same problem with you

WanFeng123313 avatar Nov 16 '23 06:11 WanFeng123313

please dont run it in command line, run in file driectly

CyanMystery avatar Nov 21 '23 06:11 CyanMystery

same issue

yuvraj108c avatar Dec 01 '23 12:12 yuvraj108c

Hi Guys, Here issue is with the extension of the image like .png, .jpg, check everywhere it extension is consistent.

especially in this line

img = 'examples/source_image/{}.`**jpeg**`'.format(default_head_name.value) 

vikash9899 avatar May 15 '24 05:05 vikash9899

Hi guys, I found the solution

Hi Guys, Here issue is with the extension of the image like .png, .jpg, check everywhere it extension is consistent.

especially in this line

img = 'examples/source_image/{}.`**jpeg**`'.format(default_head_name.value) 
import ipywidgets as widgets
import glob
import matplotlib.pyplot as plt
# print("Choose the image name to animate: (saved in folder 'examples/')") 
img_list = glob.glob1('examples/source_image', '*.jpeg') 
print(img_list)
img_list.sort()
img_list = [item.split('.')[0] for item in img_list]
default_head_name = widgets.Dropdown(options=img_list, value='ramveer')
def on_change(change):
    if change['type'] == 'change' and change['name'] == 'value':
        plt.imshow(plt.imread('examples/source_image/{}.jpeg'.format(default_head_name.value)))
        plt.axis('off')
        plt.show()
default_head_name.observe(on_change) 
display(default_head_name) 
plt.imshow(plt.imread('examples/source_image/{}.jpeg'.format(default_head_name.value)))
plt.axis('off')
plt.show() 

vikasrajpoot0100 avatar May 15 '24 05:05 vikasrajpoot0100