hacksider / Deep-Live-Cam

real time face swap and one-click video deepfake with only a single image
GNU Affero General Public License v3.0
39.83k stars 5.83k forks source link

Application runs but does not work in any mode - picture and live...What does that error means? #56

Closed aneftz closed 1 month ago

aneftz commented 3 months ago

(venv) (base) PS C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam> python run.py --execution-provider cuda [ WARN:0@23.189] global loadsave.cpp:248 cv::findDecoder imread_('C:/Users/aivan/OneDrive/╨а╨╛╨▒╨╛╤З╨╕╨╣ ╤Б╤В╤Ц╨╗/USAFA_Hosts_ElonMusk(Image_1_of17)(cropped).jpg'): can't open/read file: check file path/integrity Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with options: {'CUDAExecutionProvider': {'device_id': '0', 'has_user_compute_stream': '0', 'cudnn_conv1d_pad_to_nc1d': '0', 'user_compute_stream': '0', 'gpu_external_alloc': '0', 'gpu_mem_limit': '18446744073709551615', 'enable_cuda_graph': '0', 'gpu_external_free': '0', 'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', 'cudnn_conv_algo_search': 'EXHAUSTIVE', 'do_copy_in_default_stream': '1', 'cudnn_conv_use_max_workspace': '1', 'tunable_op_enable': '0', 'tunable_op_tuning_enable': '0', 'tunable_op_max_tuning_duration_ms': '0', 'enable_skip_layer_norm_strict_mode': '0', 'prefer_nhwc': '0', 'use_ep_level_unified_stream': '0', 'use_tf32': '1'}, 'CPUExecutionProvider': {}} find model: C:\Users\aivan/.insightface\models\buffalo_l\1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0 Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with options: {'CUDAExecutionProvider': {'device_id': '0', 'has_user_compute_stream': '0', 'cudnn_conv1d_pad_to_nc1d': '0', 'user_compute_stream': '0', 'gpu_external_alloc': '0', 'gpu_mem_limit': '18446744073709551615', 'enable_cuda_graph': '0', 'gpu_external_free': '0', 'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', 'cudnn_conv_algo_search': 'EXHAUSTIVE', 'do_copy_in_default_stream': '1', 'cudnn_conv_use_max_workspace': '1', 'tunable_op_enable': '0', 'tunable_op_tuning_enable': '0', 'tunable_op_max_tuning_duration_ms': '0', 'enable_skip_layer_norm_strict_mode': '0', 'prefer_nhwc': '0', 'use_ep_level_unified_stream': '0', 'use_tf32': '1'}, 'CPUExecutionProvider': {}} find model: C:\Users\aivan/.insightface\models\buffalo_l\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0 Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with options: {'CUDAExecutionProvider': {'device_id': '0', 'has_user_compute_stream': '0', 'cudnn_conv1d_pad_to_nc1d': '0', 'user_compute_stream': '0', 'gpu_external_alloc': '0', 'gpu_mem_limit': '18446744073709551615', 'enable_cuda_graph': '0', 'gpu_external_free': '0', 'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', 'cudnn_conv_algo_search': 'EXHAUSTIVE', 'do_copy_in_default_stream': '1', 'cudnn_conv_use_max_workspace': '1', 'tunable_op_enable': '0', 'tunable_op_tuning_enable': '0', 'tunable_op_max_tuning_duration_ms': '0', 'enable_skip_layer_norm_strict_mode': '0', 'prefer_nhwc': '0', 'use_ep_level_unified_stream': '0', 'use_tf32': '1'}, 'CPUExecutionProvider': {}} find model: C:\Users\aivan/.insightface\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0 Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with options: {'CUDAExecutionProvider': {'device_id': '0', 'has_user_compute_stream': '0', 'cudnn_conv1d_pad_to_nc1d': '0', 'user_compute_stream': '0', 'gpu_external_alloc': '0', 'gpu_mem_limit': '18446744073709551615', 'enable_cuda_graph': '0', 'gpu_external_free': '0', 'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', 'cudnn_conv_algo_search': 'EXHAUSTIVE', 'do_copy_in_default_stream': '1', 'cudnn_conv_use_max_workspace': '1', 'tunable_op_enable': '0', 'tunable_op_tuning_enable': '0', 'tunable_op_max_tuning_duration_ms': '0', 'enable_skip_layer_norm_strict_mode': '0', 'prefer_nhwc': '0', 'use_ep_level_unified_stream': '0', 'use_tf32': '1'}, 'CPUExecutionProvider': {}} find model: C:\Users\aivan/.insightface\models\buffalo_l\genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0 Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with options: {'CUDAExecutionProvider': {'device_id': '0', 'has_user_compute_stream': '0', 'cudnn_conv1d_pad_to_nc1d': '0', 'user_compute_stream': '0', 'gpu_external_alloc': '0', 'gpu_mem_limit': '18446744073709551615', 'enable_cuda_graph': '0', 'gpu_external_free': '0', 'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', 'cudnn_conv_algo_search': 'EXHAUSTIVE', 'do_copy_in_default_stream': '1', 'cudnn_conv_use_max_workspace': '1', 'tunable_op_enable': '0', 'tunable_op_tuning_enable': '0', 'tunable_op_max_tuning_duration_ms': '0', 'enable_skip_layer_norm_strict_mode': '0', 'prefer_nhwc': '0', 'use_ep_level_unified_stream': '0', 'use_tf32': '1'}, 'CPUExecutionProvider': {}} find model: C:\Users\aivan/.insightface\models\buffalo_l\w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5 set det-size: (640, 640) Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\aivan\AppData\Local\Programs\Python\Python310\lib\tkinter__init.py", line 1921, in call__ return self.func(args) File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\venv\lib\site-packages\customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked self._command() File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\modules\ui.py", line 95, in start_button = ctk.CTkButton(root, text='Start', cursor='hand2', command=lambda: select_output_path(start)) File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\modules\ui.py", line 192, in select_output_path start() File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\modules\core.py", line 171, in start if not frame_processor.pre_start(): File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\modules\processors\frame\face_swapper.py", line 28, in pre_start elif not get_one_face(cv2.imread(modules.globals.source_path)): File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\modules\face_analyser.py", line 20, in get_one_face face = get_face_analyser().get(frame) File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\venv\lib\site-packages\insightface\app\face_analysis.py", line 59, in get bboxes, kpss = self.det_model.detect(img, File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\venv\lib\site-packages\insightface\model_zoo\retinaface.py", line 211, in detect imratio = float(img.shape[0]) / img.shape[1] AttributeError: 'NoneType' object has no attribute 'shape' [ WARN:0@45.689] global loadsave.cpp:248 cv::findDecoder imread('C:/Users/aivan/OneDrive/╨а╨╛╨▒╨╛╤З╨╕╨╣ ╤Б╤В╤Ц╨╗/USAFA_Hosts_ElonMusk(Image_1_of17)(cropped).jpg'): can't open/read file: check file path/integrity Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\aivan\AppData\Local\Programs\Python\Python310\lib\tkinter__init.py", line 1921, in call__ return self.func(args) File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\venv\lib\site-packages\customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked self._command() File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\modules\ui.py", line 95, in start_button = ctk.CTkButton(root, text='Start', cursor='hand2', command=lambda: select_output_path(start)) File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\modules\ui.py", line 192, in select_output_path start() File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\modules\core.py", line 171, in start if not frame_processor.pre_start(): File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\modules\processors\frame\face_swapper.py", line 28, in pre_start elif not get_one_face(cv2.imread(modules.globals.source_path)): File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\modules\face_analyser.py", line 20, in get_one_face face = get_face_analyser().get(frame) File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\venv\lib\site-packages\insightface\app\face_analysis.py", line 59, in get bboxes, kpss = self.det_model.detect(img, File "C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam\venv\lib\site-packages\insightface\model_zoo\retinaface.py", line 211, in detect im_ratio = float(img.shape[0]) / img.shape[1] AttributeError: 'NoneType' object has no attribute 'shape'

image

aneftz commented 3 months ago

You can see little window in left corner - its supposed to be webcam window but it does not work. Can somebody help to fix it, please??

Updatedme commented 3 months ago

You need to change that picture . Use a picture that can be framed from head to the shoulder level at least . .that picture isn't fitting well as required . It's too croped in . I hope you understand

aneftz commented 3 months ago

You need to change that picture . Use a picture that can be framed from head to the shoulder level at least . .that picture isn't fitting well as required . It's too croped in . I hope you understand

image

I dont think its reason why its not working...Look at this try, what do you think? Important notice - This error shows up not only when Im turning on my webcam, also if I use just face swapper with pictures. THe same error on the picture you can see

chengwen0926 commented 3 months ago

When I changed the image name from Chinese to English, the error was solved.

mpeter50 commented 2 months ago

This is probably related to OpenCV's general inability to handle paths with complex characters. Move your files to a directory that does not have cyrillic or other special characters in the full path of it, including the filename itself.