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.28k stars 5.71k forks source link

speed up #393

Closed moming133 closed 2 months ago

moming133 commented 2 months ago

GPU: 3060 12G:

python run.py --execution-provider cuda --execution-threads 60 --max-memory 60 the speed is 1.2

how to speed up?

[DLC.CORE] Extracting frames... ========+get_frame_processors_modules state: [<module 'modules.processors.frame.face_swapper' from 'D:\project\Deep-Live-Cam\modules\processors\frame\face_swapper.py'>, <module 'modules.processors.frame.face_enhancer' from 'D:\project\Deep-Live-Cam\modules\processors\frame\face_enhancer.py'>] ========+frame_processors: ['face_swapper', 'face_enhancer'] ========+set_frame_processors_modules_from_ui state: True [DLC.FACE-SWAPPER] Progressing... Processing: 0%| | 0/736 [00:00<?, ?frame/s, execution_providers=['CUDAExecutionProvider'], execution_threads=60, max_memory=60]Applied providers: ['CUDAExecutionProvider', 'CPUExecutionProvider'], with options: {'CUDAExecutionProvider': {'cudnn_conv_algo_search': 'EXHAUSTIVE', 'device_id': '0', 'cudnn_conv1d_pad_to_nc1d': '0', 'has_user_compute_stream': '0', 'gpu_external_alloc': '0', 'enable_cuda_graph': '0', 'gpu_mem_limit': '18446744073709551615', 'gpu_external_free': '0', 'gpu_external_empty_cache': '0', 'arena_extend_strategy': 'kNextPowerOfTwo', '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'}, 'CPUExecutionProvider': {}} inswapper-shape: [1, 3, 128, 128] Processing: 49%|█████████████████████▍ | 358/736 [07:16<05:14, 1.20frame/s, execution_providers=['CUDAExecutionProvider'], execution_threads=60, max_memory=60]

moming133 commented 2 months ago

and the face enhance is slower:
Processing: 1%|▎ | 5/736 [04:49<7:02:08, 34.65s/frame, execution_providers=['CUDAExecutionProvider'], execution_threads=12, max_memory=28]

moming133 commented 2 months ago

Processing: 86%|█████████████████████████████████████▊ | 633/736 [00:50<00:07, 13.39frame/s, execution_providers=['CUDAExecutionProvider'], execution_threads=12, max_memory=28]

hacksider commented 2 months ago

Please be more specific with the issue. If it is the speed, then it really varies per machine