KwaiVGI / LivePortrait

Bring portraits to life!
https://liveportrait.github.io
Other
11.43k stars 1.17k forks source link

Regarding images that cannot be processed #138

Closed vivalavida1977 closed 1 month ago

vivalavida1977 commented 1 month ago

There are images that cannot be used to create animations due to the following error. Is there any way to address this?

File "E:\LivePortrait\src\utils\io.py", line 18, in load_image_rgb return cv2.cvtColor(img, cv2.COLOR_BGR2RGB) cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:196: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

zzzweakman commented 1 month ago

Thank you for your attention. Could you please check the path of the source image? Does the image really exist? @vivalavida1977

vivalavida1977 commented 1 month ago

Images do exist. It happens quite frequently.

jia95812 commented 1 month ago

我也遇到了这个问题,把图片的文件名称中的中文改掉,就没有了这个错误。

vivalavida1977 commented 1 month ago

我也遇到了这个问题,把图片的文件名称中的中文改掉,就没有了这个错误。

谢谢。排除文件名中的日文字符后,处理成功了。

vivalavida1977 commented 1 month ago

Thank you for your attention. Could you please check the path of the source image? Does the image really exist? @vivalavida1977

It seems that including Japanese characters in the file names causes an error.

yljzcf commented 1 month ago

请问我已经改成数字文件名了,为什么还是会出现这个错误?

yljzcf commented 1 month ago

请问我已经改成数字文件名了,为什么还是会出现这个错误?

使用的是0725的win一键包,除了一键包是需要再安装别的什么环境吗?

zzzweakman commented 1 month ago

请问我已经改成数字文件名了,为什么还是会出现这个错误?

使用的是0725的win一键包,除了一键包是需要再安装别的什么环境吗?

你需要保证从根目录到当前目录都只包括英文 : )

You should keep the names of all directories from the root to the current directory in English only : )

zzzweakman commented 1 month ago

Thank you for your attention. Could you please check the path of the source image? Does the image really exist? @vivalavida1977

It seems that including Japanese characters in the file names causes an error.

Thank you for providing a solution and helping us identify and resolve such issues! @vivalavida1977 @jia95812

yljzcf commented 1 month ago

请问我已经改成数字文件名了,为什么还是会出现这个错误?

使用的是0725的win一键包,除了一键包是需要再安装别的什么环境吗?

你需要保证从根目录到当前目录都只包括英文 : )

You should keep the names of all directories from the root to the current directory in English only : )

我是解压在根目录的,使用示例图片和示例视频时也会产生这样的错误(哭 cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:196: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

zzzweakman commented 1 month ago

我是解压在根目录的,使用示例图片和示例视频时也会产生这样的错误(哭 cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:196: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

通常来说这个错误是由于opencv-python读到了空图像导致的,有可能是路径问题造成的,也有可能是图片不存在或无法访问造成的,您能确认一下吗?如果这两者都没有问题,尝试更换一个新的opencv-python版本?

muoli00 commented 3 weeks ago

我也遇到了同样的问题,然后我发现在运行LivePortrait报错的显示行里,有一行显示文件夹位置的字符里出现乱码,我找到了乱码文件夹,并用英文重新命名了一下(建议把原来的文件名保存一下,万一出现问题还能改回去),然后就运行成功了 {这是我出现乱码的文件夹位置,(C:\Users\)仅供参考}

muoli00 commented 3 weeks ago

不知道为什么,之后又出现了报错,并且这次无论怎样修改文件夹的名称都无济于事,运行显示栏里依然显示着乱码的文件名,所显示的图片文件路径也是虚假的。于是我试着把这个报错的虚假路径变成真实的路径,并把图片文件放进去,然后就运行成功了(有相同困扰的朋友可以试一试)但是每次读取新的图片文件都会重新报错,所以每次都要根据报错的路径在新建一个文件夹,这点有些麻烦,不过至少解决了无法使用的问题