warmshao / FasterLivePortrait

Bring portraits to life in Real Time!onnx/tensorrt support!实时肖像驱动!
446 stars 38 forks source link

camera.bat cv2.error assertion failed (Windows integrated package/Win11) #27

Closed LuckyNES closed 1 month ago

LuckyNES commented 1 month ago

I am using Windows 11 and have a GeForce 4090 gpu. I followed the instructions perfectly and am able to use app.bat web app without issue. When I try to run camera.bat either of these two ways:

camera.bat camera.bat assets/examples/source/s9.jpg

It fails with an error. See the following command line output:

source image: loading model: warping_spade {'name': 'WarpingSpadeModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/warping_spade-fix.trt'} trt loading model: motion_extractor {'name': 'MotionExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/motion_extractor.trt'} trt loading model: landmark {'name': 'LandmarkModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/landmark.trt'} trt loading model: face_analysis {'name': 'FaceAnalysisModel', 'predict_type': 'trt', 'model_path': ['./checkpoints/liveportrait_onnx/retinaface_det_static.trt', './checkpoints/liveportrait_onnx/face_2dpose_106_static.trt']} loading model: app_feat_extractor {'name': 'AppearanceFeatureExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/appearance_feature_extractor.trt'} trt loading model: stitching {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching.trt'} trt loading model: stitching_eye_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_eye.trt'} trt loading model: stitching_lip_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_lip.trt'} trt 0.010543107986450195 Traceback (most recent call last): File "D:\Tools\FasterLivePortrait\run.py", line 67, in dri_crop = cv2.resize(dri_crop, (512, 512)) cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

warmshao commented 1 month ago

Do you have a webcam on your computer? And is the webcam functioning properly?

LuckyNES commented 1 month ago

Ok. Thank you that was it. I accidentally didn't have it plugged into the right computer. Is it possible to display an appropriate "please make sure a camera is plugged in" message?

warmshao commented 1 month ago

Ok. Thank you that was it. I accidentally didn't have it plugged into the right computer. Is it possible to display an appropriate "please make sure a camera is plugged in" message?

sure!update today!

superjunge commented 1 month ago

I have the same error... But i have my webcam connected and it is working in other programs. Am I missing a requirement ? I am using just the standalone zip file

warmshao commented 1 month ago

Ok. Thank you that was it. I accidentally didn't have it plugged into the right computer. Is it possible to display an appropriate "please make sure a camera is plugged in" message?

sure!update today!

done and add new feature:https://github.com/warmshao/FasterLivePortrait/releases/tag/v1.1

warmshao commented 1 month ago

I have the same error... But i have my webcam connected and it is working in other programs. Am I missing a requirement ? I am using just the standalone zip file

give me more information pls

leetraman822 commented 1 month ago

我也遇到了这个问题,我在两台电脑上测试了一下😭。 A电脑没有摄像头,B电脑有摄像头。 昨天首次在A电脑上下载好是可以成功运行camera.bat的,由于A电脑没有网络摄像头,所以我用了OBS的虚拟摄像机输入了视频媒体源,camera.bat成功检测捕获到了虚拟摄像头里的内容并稳定运行。 我在B电脑上运行camera.bat后,B就显示以下错误: source image: loading model: warping_spade {'name': 'WarpingSpadeModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/warping_spade-fix.trt'} trt loading model: motion_extractor {'name': 'MotionExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/motion_extractor.trt'} trt loading model: landmark {'name': 'LandmarkModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/landmark.trt'} trt loading model: face_analysis {'name': 'FaceAnalysisModel', 'predict_type': 'trt', 'model_path': ['./checkpoints/liveportrait_onnx/retinaface_det_static.trt', './checkpoints/liveportrait_onnx/face_2dpose_106_static.trt']} loading model: app_feat_extractor {'name': 'AppearanceFeatureExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/appearance_feature_extractor.trt'} trt loading model: stitching {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching.trt'} trt loading model: stitching_eye_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_eye.trt'} trt loading model: stitching_lip_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_lip.trt'} trt 0.012966632843017578 Traceback (most recent call last): File "F:\StableDiffusion\FasterLivePortrait-windows\run.py", line 67, in dri_crop = cv2.resize(dri_crop, (512, 512)) cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

我使用虚拟摄像头也出现同样的错误。 两台电脑都安装了CUDA12.2和对应的CUDNN,并且安装了FFmpeg,且两台电脑配置都是RTX3060 12G, 16GB RAM。 而在今天早上我再次在A电脑上运行camera.bat时,它也出现了: cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' 的错误。 所以现在两台电脑都没办法运行camera.bat了😭,真的很奇怪。A昨天首次运行还好好的。

warmshao commented 1 month ago

我也遇到了这个问题,我在两台电脑上测试了一下😭。 A电脑没有摄像头,B电脑有摄像头。 昨天首次在A电脑上下载好是可以成功运行camera.bat的,由于A电脑没有网络摄像头,所以我用了OBS的虚拟摄像机输入了视频媒体源,camera.bat成功检测捕获到了虚拟摄像头里的内容并稳定运行。 我在B电脑上运行camera.bat后,B就显示以下错误: source image: loading model: warping_spade {'name': 'WarpingSpadeModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/warping_spade-fix.trt'} trt loading model: motion_extractor {'name': 'MotionExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/motion_extractor.trt'} trt loading model: landmark {'name': 'LandmarkModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/landmark.trt'} trt loading model: face_analysis {'name': 'FaceAnalysisModel', 'predict_type': 'trt', 'model_path': ['./checkpoints/liveportrait_onnx/retinaface_det_static.trt', './checkpoints/liveportrait_onnx/face_2dpose_106_static.trt']} loading model: app_feat_extractor {'name': 'AppearanceFeatureExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/appearance_feature_extractor.trt'} trt loading model: stitching {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching.trt'} trt loading model: stitching_eye_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_eye.trt'} trt loading model: stitching_lip_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_lip.trt'} trt 0.012966632843017578 Traceback (most recent call last): File "F:\StableDiffusion\FasterLivePortrait-windows\run.py", line 67, in dri_crop = cv2.resize(dri_crop, (512, 512)) cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize'

我使用虚拟摄像头也出现同样的错误。 两台电脑都安装了CUDA12.2和对应的CUDNN,并且安装了FFmpeg,且两台电脑配置都是RTX3060 12G, 16GB RAM。 而在今天早上我再次在A电脑上运行camera.bat时,它也出现了: cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' 的错误。 所以现在两台电脑都没办法运行camera.bat了😭,真的很奇怪。A昨天首次运行还好好的。

感觉的是没有成功读取摄像头,可以用最新的包试试:https://github.com/warmshao/FasterLivePortrait/releases/tag/v1.1,会打印更多的日志

leetraman822 commented 1 month ago

我也遇到了这个问题,我在两台电脑上测试了一下😭。 A电脑没有摄像头,B电脑有摄像头。 昨天首次在A电脑上下载好是可以成功运行camera.bat的,由于A电脑没有网络摄像头,所以我用了OBS的虚拟摄像机输入了视频媒体源,camera.bat成功检测捕获到了虚拟摄像头里的内容并稳定运行。 我在B电脑上运行camera.bat后,B就显示以下错误: source image: loading model: warping_spade {'name': 'WarpingSpadeModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/warping_spade-fix.trt'} trt loading model: motion_extractor {'name': 'MotionExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/motion_extractor.trt'} trt loading model: landmark {'name': 'LandmarkModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/landmark.trt'} trt loading model: face_analysis {'name': 'FaceAnalysisModel', 'predict_type': 'trt', 'model_path': ['./checkpoints/liveportrait_onnx/retinaface_det_static.trt', './checkpoints/liveportrait_onnx/face_2dpose_106_static.trt']} loading model: app_feat_extractor {'name': 'AppearanceFeatureExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/appearance_feature_extractor.trt'} trt loading model: stitching {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching.trt'} trt loading model: stitching_eye_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_eye.trt'} trt loading model: stitching_lip_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_lip.trt'} trt 0.012966632843017578 Traceback (most recent call last): File "F:\StableDiffusion\FasterLivePortrait-windows\run.py", line 67, in dri_crop = cv2.resize(dri_crop, (512, 512)) cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' 我使用虚拟摄像头也出现同样的错误。 两台电脑都安装了CUDA12.2和对应的CUDNN,并且安装了FFmpeg,且两台电脑配置都是RTX3060 12G, 16GB RAM。 而在今天早上我再次在A电脑上运行camera.bat时,它也出现了: cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' 的错误。 所以现在两台电脑都没办法运行camera.bat了😭,真的很奇怪。A昨天首次运行还好好的。

感觉的是没有成功读取摄像头,可以用最新的包试试:https://github.com/warmshao/FasterLivePortrait/releases/tag/v1.1,会打印更多的日志

感谢解答~我在A电脑上尝试了最新的版本,使用的是安卓手机与PC进行WIFI无线串流的摄像头程序(Iriun Webcam),成功运行了。 通过无线连接,我没有通过OBS去开启虚拟摄像头。 不过我使用最新版本同样测试了OBS的虚拟摄像头,它依然显示cv resize错误,关闭OBS虚拟摄像头就可以正常运行,所以可能暂时无法使用虚拟摄像头了。 就像您说的,这种错误可能是没有成功读取正确摄像头的原因。 请问可以添加一个从多个摄像头驱动中选择目标摄像头的功能吗?因为在摄像头输入时,有可能需要对输入画面进行调整操作(输入画面的翻转旋转、拉伸裁剪等),在OBS这种可以充当虚拟摄像头的软件来说,它恰巧包含了这样的操作。 目前这个项目是非常惊人的,实时运行的效果非常优秀,感谢大佬的辛苦付出。😊

warmshao commented 1 month ago

我也遇到了这个问题,我在两台电脑上测试了一下😭。 A电脑没有摄像头,B电脑有摄像头。 昨天首次在A电脑上下载好是可以成功运行camera.bat的,由于A电脑没有网络摄像头,所以我用了OBS的虚拟摄像机输入了视频媒体源,camera.bat成功检测捕获到了虚拟摄像头里的内容并稳定运行。 我在B电脑上运行camera.bat后,B就显示以下错误: source image: loading model: warping_spade {'name': 'WarpingSpadeModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/warping_spade-fix.trt'} trt loading model: motion_extractor {'name': 'MotionExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/motion_extractor.trt'} trt loading model: landmark {'name': 'LandmarkModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/landmark.trt'} trt loading model: face_analysis {'name': 'FaceAnalysisModel', 'predict_type': 'trt', 'model_path': ['./checkpoints/liveportrait_onnx/retinaface_det_static.trt', './checkpoints/liveportrait_onnx/face_2dpose_106_static.trt']} loading model: app_feat_extractor {'name': 'AppearanceFeatureExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/appearance_feature_extractor.trt'} trt loading model: stitching {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching.trt'} trt loading model: stitching_eye_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_eye.trt'} trt loading model: stitching_lip_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_lip.trt'} trt 0.012966632843017578 Traceback (most recent call last): File "F:\StableDiffusion\FasterLivePortrait-windows\run.py", line 67, in dri_crop = cv2.resize(dri_crop, (512, 512)) cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' 我使用虚拟摄像头也出现同样的错误。 两台电脑都安装了CUDA12.2和对应的CUDNN,并且安装了FFmpeg,且两台电脑配置都是RTX3060 12G, 16GB RAM。 而在今天早上我再次在A电脑上运行camera.bat时,它也出现了: cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' 的错误。 所以现在两台电脑都没办法运行camera.bat了😭,真的很奇怪。A昨天首次运行还好好的。

感觉的是没有成功读取摄像头,可以用最新的包试试:https://github.com/warmshao/FasterLivePortrait/releases/tag/v1.1,会打印更多的日志

感谢解答~我在A电脑上尝试了最新的版本,使用的是安卓手机与PC进行WIFI无线串流的摄像头程序(Iriun Webcam),成功运行了。 通过无线连接,我没有通过OBS去开启虚拟摄像头。 不过我使用最新版本同样测试了OBS的虚拟摄像头,它依然显示cv resize错误,关闭OBS虚拟摄像头就可以正常运行,所以可能暂时无法使用虚拟摄像头了。 就像您说的,这种错误可能是没有成功读取正确摄像头的原因。 请问可以添加一个从多个摄像头驱动中选择目标摄像头的功能吗?因为在摄像头输入时,有可能需要对输入画面进行调整操作(输入画面的翻转旋转、拉伸裁剪等),在OBS这种可以充当虚拟摄像头的软件来说,它恰巧包含了这样的操作。 目前这个项目是非常惊人的,实时运行的效果非常优秀,感谢大佬的辛苦付出。😊

这个看上去像针对业务的需求,需要你们自己实现,不打算集成到本项目中,而且我现在排期不过来了🤯🤯

leetraman822 commented 1 month ago

我也遇到了这个问题,我在两台电脑上测试了一下😭。 A电脑没有摄像头,B电脑有摄像头。 昨天首次在A电脑上下载好是可以成功运行camera.bat的,由于A电脑没有网络摄像头,所以我用了OBS的虚拟摄像机输入了视频媒体源,camera.bat成功检测捕获到了虚拟摄像头里的内容并稳定运行。 我在B电脑上运行camera.bat后,B就显示以下错误: source image: loading model: warping_spade {'name': 'WarpingSpadeModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/warping_spade-fix.trt'} trt loading model: motion_extractor {'name': 'MotionExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/motion_extractor.trt'} trt loading model: landmark {'name': 'LandmarkModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/landmark.trt'} trt loading model: face_analysis {'name': 'FaceAnalysisModel', 'predict_type': 'trt', 'model_path': ['./checkpoints/liveportrait_onnx/retinaface_det_static.trt', './checkpoints/liveportrait_onnx/face_2dpose_106_static.trt']} loading model: app_feat_extractor {'name': 'AppearanceFeatureExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/appearance_feature_extractor.trt'} trt loading model: stitching {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching.trt'} trt loading model: stitching_eye_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_eye.trt'} trt loading model: stitching_lip_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_lip.trt'} trt 0.012966632843017578 Traceback (most recent call last): File "F:\StableDiffusion\FasterLivePortrait-windows\run.py", line 67, in dri_crop = cv2.resize(dri_crop, (512, 512)) cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' 我使用虚拟摄像头也出现同样的错误。 两台电脑都安装了CUDA12.2和对应的CUDNN,并且安装了FFmpeg,且两台电脑配置都是RTX3060 12G, 16GB RAM。 而在今天早上我再次在A电脑上运行camera.bat时,它也出现了: cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' 的错误。 所以现在两台电脑都没办法运行camera.bat了😭,真的很奇怪。A昨天首次运行还好好的。

感觉的是没有成功读取摄像头,可以用最新的包试试:https://github.com/warmshao/FasterLivePortrait/releases/tag/v1.1,会打印更多的日志

感谢解答~我在A电脑上尝试了最新的版本,使用的是安卓手机与PC进行WIFI无线串流的摄像头程序(Iriun Webcam),成功运行了。 通过无线连接,我没有通过OBS去开启虚拟摄像头。 不过我使用最新版本同样测试了OBS的虚拟摄像头,它依然显示cv resize错误,关闭OBS虚拟摄像头就可以正常运行,所以可能暂时无法使用虚拟摄像头了。 就像您说的,这种错误可能是没有成功读取正确摄像头的原因。 请问可以添加一个从多个摄像头驱动中选择目标摄像头的功能吗?因为在摄像头输入时,有可能需要对输入画面进行调整操作(输入画面的翻转旋转、拉伸裁剪等),在OBS这种可以充当虚拟摄像头的软件来说,它恰巧包含了这样的操作。 目前这个项目是非常惊人的,实时运行的效果非常优秀,感谢大佬的辛苦付出。😊

这个看上去像针对业务的需求,需要你们自己实现,不打算集成到本项目中,而且我现在排期不过来了🤯🤯

嗨,😀我刚才琢磨出了解决OBS虚拟摄像机cv resize错误的方法,只要右键“此电脑”--“管理”--禁用Iruin Webcam驱动就可以了。camera.bat就会优先使用OBS的虚拟摄像机进行输入了。

warmshao commented 1 month ago

我也遇到了这个问题,我在两台电脑上测试了一下😭。 A电脑没有摄像头,B电脑有摄像头。 昨天首次在A电脑上下载好是可以成功运行camera.bat的,由于A电脑没有网络摄像头,所以我用了OBS的虚拟摄像机输入了视频媒体源,camera.bat成功检测捕获到了虚拟摄像头里的内容并稳定运行。 我在B电脑上运行camera.bat后,B就显示以下错误: source image: loading model: warping_spade {'name': 'WarpingSpadeModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/warping_spade-fix.trt'} trt loading model: motion_extractor {'name': 'MotionExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/motion_extractor.trt'} trt loading model: landmark {'name': 'LandmarkModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/landmark.trt'} trt loading model: face_analysis {'name': 'FaceAnalysisModel', 'predict_type': 'trt', 'model_path': ['./checkpoints/liveportrait_onnx/retinaface_det_static.trt', './checkpoints/liveportrait_onnx/face_2dpose_106_static.trt']} loading model: app_feat_extractor {'name': 'AppearanceFeatureExtractorModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/appearance_feature_extractor.trt'} trt loading model: stitching {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching.trt'} trt loading model: stitching_eye_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_eye.trt'} trt loading model: stitching_lip_retarget {'name': 'StitchingModel', 'predict_type': 'trt', 'model_path': './checkpoints/liveportrait_onnx/stitching_lip.trt'} trt 0.012966632843017578 Traceback (most recent call last): File "F:\StableDiffusion\FasterLivePortrait-windows\run.py", line 67, in dri_crop = cv2.resize(dri_crop, (512, 512)) cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' 我使用虚拟摄像头也出现同样的错误。 两台电脑都安装了CUDA12.2和对应的CUDNN,并且安装了FFmpeg,且两台电脑配置都是RTX3060 12G, 16GB RAM。 而在今天早上我再次在A电脑上运行camera.bat时,它也出现了: cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\resize.cpp:4152: error: (-215:Assertion failed) !ssize.empty() in function 'cv::resize' 的错误。 所以现在两台电脑都没办法运行camera.bat了😭,真的很奇怪。A昨天首次运行还好好的。

感觉的是没有成功读取摄像头,可以用最新的包试试:https://github.com/warmshao/FasterLivePortrait/releases/tag/v1.1,会打印更多的日志

感谢解答~我在A电脑上尝试了最新的版本,使用的是安卓手机与PC进行WIFI无线串流的摄像头程序(Iriun Webcam),成功运行了。 通过无线连接,我没有通过OBS去开启虚拟摄像头。 不过我使用最新版本同样测试了OBS的虚拟摄像头,它依然显示cv resize错误,关闭OBS虚拟摄像头就可以正常运行,所以可能暂时无法使用虚拟摄像头了。 就像您说的,这种错误可能是没有成功读取正确摄像头的原因。 请问可以添加一个从多个摄像头驱动中选择目标摄像头的功能吗?因为在摄像头输入时,有可能需要对输入画面进行调整操作(输入画面的翻转旋转、拉伸裁剪等),在OBS这种可以充当虚拟摄像头的软件来说,它恰巧包含了这样的操作。 目前这个项目是非常惊人的,实时运行的效果非常优秀,感谢大佬的辛苦付出。😊

这个看上去像针对业务的需求,需要你们自己实现,不打算集成到本项目中,而且我现在排期不过来了🤯🤯

嗨,😀我刚才琢磨出了解决OBS虚拟摄像机cv resize错误的方法,只要右键“此电脑”--“管理”--禁用Iruin Webcam驱动就可以了。camera.bat就会优先使用OBS的虚拟摄像机进行输入了。

很棒~😊谢谢分享~

superjunge commented 1 month ago

I have the same error... But i have my webcam connected and it is working in other programs. Am I missing a requirement ? I am using just the standalone zip file

give me more information pls

i used the new version and reinstalled CUDA, cudnn and now it works, thanks !

warmshao commented 1 month ago

I have the same error... But i have my webcam connected and it is working in other programs. Am I missing a requirement ? I am using just the standalone zip file

give me more information pls

i used the new version and reinstalled CUDA, cudnn and now it works, thanks !

good for you!