Code Monkey home page Code Monkey logo

deep-live-cam's Introduction

demo-gif

Disclaimer

This software is meant to be a productive contribution to the rapidly growing AI-generated media industry. It will help artists with tasks such as animating a custom character or using the character as a model for clothing etc.

The developers of this software are aware of its possible unethical applications and are committed to take preventative measures against them. It has a built-in check which prevents the program from working on inappropriate media including but not limited to nudity, graphic content, sensitive material such as war footage etc. We will continue to develop this project in the positive direction while adhering to law and ethics. This project may be shut down or include watermarks on the output if requested by law.

Users of this software are expected to use this software responsibly while abiding by local laws. If the face of a real person is being used, users are required to get consent from the concerned person and clearly mention that it is a deepfake when posting content online. Developers of this software will not be responsible for actions of end-users.

How do I install it?

Basic: It is more likely to work on your computer but it will also be very slow. You can follow instructions for the basic install (This usually runs via CPU)

1.Setup your platform

2. Clone Repository

https://github.com/hacksider/Deep-Live-Cam.git

3. Download Models

  1. GFPGANv1.4
  2. inswapper_128_fp16.onnx

Then put those 2 files on the "models" folder

4. Install dependency

We highly recommend to work with a venv to avoid issues.

pip install -r requirements.txt

For MAC OS, You have to install or upgrade python-tk package:

brew install [email protected]
DONE!!! If you dont have any GPU, You should be able to run roop using python run.py command. Keep in mind that while running the program for first time, it will download some models which can take time depending on your network connection.

*Proceed if you want to use GPU Acceleration

CUDA Execution Provider (Nvidia)*

  1. Install CUDA Toolkit 11.8

  2. Install dependencies:

pip uninstall onnxruntime onnxruntime-gpu
pip install onnxruntime-gpu==1.16.3

  1. Usage in case the provider is available:
python run.py --execution-provider cuda

CoreML Execution Provider (Apple Silicon)

  1. Install dependencies:
pip uninstall onnxruntime onnxruntime-silicon
pip install onnxruntime-silicon==1.13.1

  1. Usage in case the provider is available:
python run.py --execution-provider coreml

CoreML Execution Provider (Apple Legacy)

  1. Install dependencies:
pip uninstall onnxruntime onnxruntime-coreml
pip install onnxruntime-coreml==1.13.1

  1. Usage in case the provider is available:
python run.py --execution-provider coreml

DirectML Execution Provider (Windows)

  1. Install dependencies:
pip uninstall onnxruntime onnxruntime-directml
pip install onnxruntime-directml==1.15.1

  1. Usage in case the provider is available:
python run.py --execution-provider directml

OpenVINO™ Execution Provider (Intel)

  1. Install dependencies:
pip uninstall onnxruntime onnxruntime-openvino
pip install onnxruntime-openvino==1.15.0

  1. Usage in case the provider is available:
python run.py --execution-provider openvino

How do I use it?

Note: When you run this program for the first time, it will download some models ~300MB in size.

Executing python run.py command will launch this window: gui-demo

Choose a face (image with desired face) and the target image/video (image/video in which you want to replace the face) and click on Start. Open file explorer and navigate to the directory you select your output to be in. You will find a directory named <video_title> where you can see the frames being swapped in realtime. Once the processing is done, it will create the output file. That's it.

For the webcam mode

Just follow the clicks on the screenshot

  1. Select a face
  2. Click live
  3. Wait for a few seconds (it takes a longer time, usually 10 to 30 seconds before the preview shows up)

demo-gif

Just use your favorite screencapture to stream like OBS

Note: In case you want to change your face, just select another picture, the preview mode will then restart (so just wait a bit).

Additional command line arguments are given below. To learn out what they do, check this guide.

options:
  -h, --help                                               show this help message and exit
  -s SOURCE_PATH, --source SOURCE_PATH                     select an source image
  -t TARGET_PATH, --target TARGET_PATH                     select an target image or video
  -o OUTPUT_PATH, --output OUTPUT_PATH                     select output file or directory
  --frame-processor FRAME_PROCESSOR [FRAME_PROCESSOR ...]  frame processors (choices: face_swapper, face_enhancer, ...)
  --keep-fps                                               keep original fps
  --keep-audio                                             keep original audio
  --keep-frames                                            keep temporary frames
  --many-faces                                             process every face
  --video-encoder {libx264,libx265,libvpx-vp9}             adjust output video encoder
  --video-quality [0-51]                                   adjust output video quality
  --max-memory MAX_MEMORY                                  maximum amount of RAM in GB
  --execution-provider {cpu} [{cpu} ...]                   available execution provider (choices: cpu, ...)
  --execution-threads EXECUTION_THREADS                    number of execution threads
  -v, --version                                            show program's version number and exit

Looking for a CLI mode? Using the -s/--source argument will make the run program in cli mode.

Want the Next Update Now?

If you want the latest and greatest build, or want to see some new great features, go to our experimental branch and experience what the contributors have given.

Credits

deep-live-cam's People

Contributors

bit-wrangler avatar c4fun avatar dependabot[bot] avatar gianpaj avatar gongchandang49 avatar hacksider avatar jasonkneen avatar joepdejong avatar rahulbansal16 avatar rhymond avatar saharsha-n avatar samoylenkodmitry avatar samuraibarbi avatar snewell92 avatar thepathakarpit avatar vietjovi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deep-live-cam's Issues

color tranfer

can you please make the color of the picture transfer to the face during LIVE?

Application Not Appearing

Hello, I've completed all the steps and requirements when it came to installing the python file.
However, when typing the command "python run.py --execution-provider=cuda" or even "python run.py", nothing appears. There's just a newline that's displayed to the console and that's all. Please help!

image

Petition: Opacity slider

Your aplication is Awesome. Could you include a Slider with the opacity from 0 to 100 in the face, like in Deepfacelive?. And if is posible to mantain the original colors from the original photo instead to adapt the colors in the target. In photos with makeup don´t take the makeup from the original photo.
Sorry for my english, i´m not native.

Can´t find "models" folder

Step 3. "Then put those 2 files on the "models" folder"

Downloaded the 2 files, but could not find the "models" folder

Is it in the repo?

Protobuf parsing failed - model fails

The inswapper_128_fp16.onnx model is invalid. This can be checked with

import onnx
onnx_model = onnx.load("inswapper_128_fp16.onnx")
onnx.checker.check_model(onnx_model)

I solved this by adjusting faceswapper.py and just using the standard inswapper_128.onnx model here

Trouble with installing in MacOS

Hello @hacksider

I'm installing this App on my Macbook and have issues with installing GPU libraries (onnxruntime). Tried installing dependencies for CoreML Execution Provider (Apple Legacy) and got this error message:

ERROR: Could not find a version that satisfies the requirement onnxruntime-coreml==1.13.1 (from versions: none)
ERROR: No matching distribution found for onnxruntime-coreml==1.13.1

Platform:
CPU: 6-Core Intel Core i7
Firmware Date: 2020
2 GPUs:
1. AMD Radeon Pro 5300M (PCIe)
2. Intel UHD Graphics 630 (built-in)

Please let me know the solution for running the App via GPU.

Thanks

Face enhacement Lower FPS

I´m using your repository with GPU. I have Nvidia geforce RTX 3070 with cuda installed.
The software is working great but when i use face enhacement, is awesome, lowers the FPS and is isposible to use. Any tips to avoid lowering FPS when using face enhacement?
Thanks in advance

CUDAExecutionProvider doesn't seem to be used, CPUExecutionProvider instead

I am trying to use it with a GPU with cuda 12.2 in ubuntu 24.04. After starting it with python run.py --execution-provider cuda, it starts but it says

Processing:   0%|                                                                                   | 0/1789 [00:00<?, ?frame/s, execution_providers=['CUDAExecutionProvider'], execution_threads=8, max_memory=16]Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}

I am not clear whether the GPU is being used at all, and it is very slow. Is this expected?

Freezing issues

Hello mine is running but freezing on RTX3060 16gb dedicated, please how can I fix it and also how can I make display very clear and efficient.

thanks

Dont starting

Hello, I installed the program as written in the instructions, but ultimately the program starts, it says "WARNING:tensorflow:From C:\Users\Max\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\src\ losses.py:2976: The name tf.losses.sparse_softmax_cross_entropy is deprecated. Please use tf.compat.v1.losses.sparse_softmax_cross_entropy instead.", then two empty lines and stops working after a few seconds. What should I do? I have Windows 10 and I installed python 3.10.6, pip, git, ffmpeg, visual studio 2022 runtimes and downloaded the models, created a models folder and added them there.

image

Slow performance on M2 Air

I'm running with GPU acceleration (coreml)
Each frame generation takes 2-5s
Running live mode is practically impossible

Any tips on improving performance?

Failed to build insightface

ERROR: Failed building wheel for insightface
Failed to build insightface
ERROR: Could not build wheels for insightface which use PEP 517 and cannot be installed directly

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 a reason why its not working..Look at this one, what do you think?

          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

Originally posted by @Updatedme in #56 (comment)

Face Enhancer

For the face_enhancer.py GAN model to work change the \ to / on the model import

deep live cam opens up but the preview never shows anything and it give the below error

Uploading Screenshot 2024-07-18 105337.png…
(base) C:\Users\under\Deep-Live-Cam>python run.py
ERROR:albumentations.check_version:Error fetching version info
Traceback (most recent call last):
File "C:\Users\under\anaconda3\Lib\urllib\request.py", line 1344, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "C:\Users\under\anaconda3\Lib\http\client.py", line 1336, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\under\anaconda3\Lib\http\client.py", line 1382, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\under\anaconda3\Lib\http\client.py", line 1331, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\under\anaconda3\Lib\http\client.py", line 1091, in _send_output
self.send(msg)
File "C:\Users\under\anaconda3\Lib\http\client.py", line 1035, in send
self.connect()
File "C:\Users\under\anaconda3\Lib\http\client.py", line 1477, in connect
self.sock = self._context.wrap_socket(self.sock,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\under\anaconda3\Lib\ssl.py", line 455, in wrap_socket
return self.sslsocket_class._create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\under\anaconda3\Lib\ssl.py", line 1042, in _create
self.do_handshake()
File "C:\Users\under\anaconda3\Lib\ssl.py", line 1320, in do_handshake
self._sslobj.do_handshake()
TimeoutError: _ssl.c:983: The handshake operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\under\anaconda3\Lib\site-packages\albumentations\check_version.py", line 29, in fetch_version_info
with opener.open(url, timeout=2) as response:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\under\anaconda3\Lib\urllib\request.py", line 515, in open
response = self._open(req, data)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\under\anaconda3\Lib\urllib\request.py", line 532, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\under\anaconda3\Lib\urllib\request.py", line 492, in call_chain
result = func(*args)
^^^^^^^^^^^
File "C:\Users\under\anaconda3\Lib\urllib\request.py", line 1392, in https_open
return self.do_open(http.client.HTTPSConnection, req,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\under\anaconda3\Lib\urllib\request.py", line 1347, in do_open
raise URLError(err)
urllib.error.URLError:
Frame processor face_enhancer not found
Frame processor face_enhancer not found
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: C:\Users\under/.insightface\models\buffalo_l\1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: C:\Users\under/.insightface\models\buffalo_l\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: C:\Users\under/.insightface\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: C:\Users\under/.insightface\models\buffalo_l\genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
find model: C:\Users\under/.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\under\anaconda3\Lib\tkinter_init
.py", line 1968, in call
return self.func(*args)
^^^^^^^^^^^^^^^^
File "C:\Users\under\anaconda3\Lib\site-packages\customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked
self._command()
File "C:\Users\under\Deep-Live-Cam\modules\ui.py", line 104, in
live_button = ctk.CTkButton(root, text='Live', cursor='hand2', command=lambda: webcam_preview())
^^^^^^^^^^^^^^^^
File "C:\Users\under\Deep-Live-Cam\modules\ui.py", line 286, in webcam_preview
temp_frame = frame_processor.process_frame(source_image, temp_frame)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\under\Deep-Live-Cam\modules\processors\frame\face_swapper.py", line 60, in process_frame
temp_frame = swap_face(source_face, target_face, temp_frame)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\under\Deep-Live-Cam\modules\processors\frame\face_swapper.py", line 48, in swap_face
return get_face_swapper().get(temp_frame, target_face, source_face, paste_back=True)
^^^^^^^^^^^^^^^^^^
File "C:\Users\under\Deep-Live-Cam\modules\processors\frame\face_swapper.py", line 43, in get_face_swapper
FACE_SWAPPER = insightface.model_zoo.get_model(model_path, providers=modules.globals.execution_providers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\under\anaconda3\Lib\site-packages\insightface\model_zoo\model_zoo.py", line 96, in get_model
model = router.get_model(providers=providers, provider_options=provider_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\under\anaconda3\Lib\site-packages\insightface\model_zoo\model_zoo.py", line 40, in get_model
session = PickableInferenceSession(self.onnx_file, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\under\anaconda3\Lib\site-packages\insightface\model_zoo\model_zoo.py", line 25, in init
super().init(model_path, **kwargs)
File "C:\Users\under\anaconda3\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 419, in init
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "C:\Users\under\anaconda3\Lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 472, in _create_inference_session
sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from C:\Users\under\Deep-Live-Cam\models\inswapper_128_fp16.onnx failed:Protobuf parsing failed.

AttributeError: 'NoneType' object has no attribute 'shape'

File "C:\Users\user1\Downloads\Deep-Live-Cam-main\Deep-Live-Cam-main\modules\face_analyser.py", line 20, in get_one_face
face = get_face_analyser().get(frame)
File "C:\Users\user1\anaconda3\lib\site-packages\insightface\app\face_analysis.py", line 59, in get
bboxes, kpss = self.det_model.detect(img,
File "C:\Users\user1\anaconda3\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'

Camera is on (camera light is on)

A small little window opens up, after starting live

i need help from the Author

(base) C:\Users\under\Deep-Live-Cam>Python run.py
Traceback (most recent call last):
File "C:\Users\under\Deep-Live-Cam\run.py", line 3, in
from modules import core
File "C:\Users\under\Deep-Live-Cam\modules\core.py", line 15, in
import onnxruntime
File "C:\Users\under\anaconda3\Lib\site-packages\onnxruntime_init_.py", line 57, in
raise import_capi_exception
File "C:\Users\under\anaconda3\Lib\site-packages\onnxruntime_init_.py", line 23, in
from onnxruntime.capi._pybind_state import ExecutionMode # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\under\anaconda3\Lib\site-packages\onnxruntime\capi_pybind_state.py", line 32, in
from .onnxruntime_pybind11_state import *
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing onnxruntime_pybind11_state: A dynamic link library (DLL) initialization routine failed.

low load on video memory

Hello, thanks for the excellent program, I wanted to clarify why the load on my 3080 is so small, and it is only 1% load on video memory 4GB out of 10GB, how to increase the load, I have about 40 fps

About docker?

I believe we should package this app into Docker so that it can run on different operating systems. We have installed it on several different machines and encountered many errors during both the build and run phases of the app.
What do you think about that?

Preview show nothing

Hi,
First thanks for you project.
I select a face then click live a popup show preview but there is nothing on it as you can see below. My webcam is working as i have tested it. Could you help me to resolve it ?

Capture

Empty window on MacBook m3 max

Using python 3.10

Installed requirements, ffmpeg, onnxruntime-silicon 1.13.1

Run command and output:

python run.py --execution-provider coreml
DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. Please don't rely on it. Set TK_SILENCE_DEPRECATION=1 to suppress this warning.
image

openvino not working

(base) (venv) C:\Users\DELL\Deep-Live-Cam>python run.py --execution-provider openvino
usage: run.py [-h] [-s SOURCE_PATH] [-t TARGET_PATH] [-o OUTPUT_PATH]
[--frame-processor {face_swapper,face_enhancer} [{face_swapper,face_enhancer} ...]] [--keep-fps] [--keep-audio] [--keep-frames]
[--many-faces] [--video-encoder {libx264,libx265,libvpx-vp9}] [--video-quality [0-51]] [--max-memory MAX_MEMORY]
[--execution-provider {azure,cpu} [{azure,cpu} ...]] [--execution-threads EXECUTION_THREADS] [-v]
run.py: error: argument --execution-provider: invalid choice: 'openvino' (choose from 'azure', 'cpu')

Can't get virtual cameras as input

I'm trying to use a virtual camera (OBS, Nvidia Broadcast...) as an input to Deep-Live-Cam. Not even getting an error that I could share here, it just freezes. I've tried to change the camera index on the code with no luck, on one of them I got som RGB weird noise and I'm looking into possibly transcoding the image to try again. But it would be awesome to have a camera selector in the GUI.

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

(venv) (base) PS C:\Users\aivan\OneDrive\Робочий стіл\Deep-Live-Cam> python run.py --execution-provider cuda
[ WARN:[email protected]] global loadsave.cpp:248 cv::findDecoder imread_('C:/Users/aivan/OneDrive/╨а╨╛╨▒╨╛╤З╨╕╨╣ ╤Б╤В╤Ц╨╗/USAFA_Hosts_Elon_Musk_(Image_1_of_17)(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
im_ratio = float(img.shape[0]) / img.shape[1]
AttributeError: 'NoneType' object has no attribute 'shape'
[ WARN:[email protected]] global loadsave.cpp:248 cv::findDecoder imread
('C:/Users/aivan/OneDrive/╨а╨╛╨▒╨╛╤З╨╕╨╣ ╤Б╤В╤Ц╨╗/USAFA_Hosts_Elon_Musk
(Image_1_of_17)
(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

Having These error when i run python run.py

(tutorial_env) (base) C:\Users\under\Deep-Live-Cam>python run.py
Traceback (most recent call last):
File "C:\Users\under\Deep-Live-Cam\run.py", line 15, in
import onnxruntime
File "C:\Users\under\Deep-Live-Cam\tutorial_env\Lib\site-packages\onnxruntime_init_.py", line 57, in
raise import_capi_exception
File "C:\Users\under\Deep-Live-Cam\tutorial_env\Lib\site-packages\onnxruntime_init_.py", line 23, in
from onnxruntime.capi._pybind_state import ExecutionMode # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\under\Deep-Live-Cam\tutorial_env\Lib\site-packages\onnxruntime\capi_pybind_state.py", line 32, in
from .onnxruntime_pybind11_state import * # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing onnxruntime_pybind11_state: A dynamic link library (DLL) initialization routine failed.

Black square on the head

First of all, thank you for the project. I have completed the installation, but for your information, I am not using CUDA. I am unable to perform video swaps, but the most important issue is that when I perform an image swap, a black square appears instead of the new face. As you can see in the attached files.
Capture d’écran 2024-07-11 235914

Doesn't work on macOS on M1 Pro

I'm using MacBook Pro M1 Pro on macOS Sonoma 14.3.1 (23D60). Installed as stated in manual.

launched with a command
python run.py --execution-provider coreml

Chose an image
image

When I'm trying to run LIVE, I get that error and black preview window:
python run.py --execution-provider coreml Applied providers: ['CoreMLExecutionProvider', 'CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}, 'CoreMLExecutionProvider': {}} find model: /Users/rouol/.insightface/models/buffalo_l/1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0 Applied providers: ['CoreMLExecutionProvider', 'CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}, 'CoreMLExecutionProvider': {}} find model: /Users/rouol/.insightface/models/buffalo_l/2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0 Applied providers: ['CoreMLExecutionProvider', 'CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}, 'CoreMLExecutionProvider': {}} find model: /Users/rouol/.insightface/models/buffalo_l/det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0 Applied providers: ['CoreMLExecutionProvider', 'CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}, 'CoreMLExecutionProvider': {}} find model: /Users/rouol/.insightface/models/buffalo_l/genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0 Applied providers: ['CoreMLExecutionProvider', 'CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}, 'CoreMLExecutionProvider': {}} find model: /Users/rouol/.insightface/models/buffalo_l/w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5 set det-size: (640, 640) Applied providers: ['CoreMLExecutionProvider', 'CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}, 'CoreMLExecutionProvider': {}} inswapper-shape: [1, 3, 128, 128] Exception in Tkinter callback Traceback (most recent call last): File "/opt/homebrew/Caskroom/miniconda/base/envs/py310tf/lib/python3.10/tkinter/__init__.py", line 1921, in __call__ return self.func(*args) File "/Users/rouol/Code/WORK/Deep-Live-Cam/venv/lib/python3.10/site-packages/customtkinter/windows/widgets/ctk_button.py", line 553, in _clicked self._command() File "/Users/rouol/Code/WORK/Deep-Live-Cam/modules/ui.py", line 104, in <lambda> live_button = ctk.CTkButton(root, text='Live', cursor='hand2', command=lambda: webcam_preview()) File "/Users/rouol/Code/WORK/Deep-Live-Cam/modules/ui.py", line 286, in webcam_preview temp_frame = frame_processor.process_frame(source_image, temp_frame) File "/Users/rouol/Code/WORK/Deep-Live-Cam/modules/processors/frame/face_swapper.py", line 60, in process_frame temp_frame = swap_face(source_face, target_face, temp_frame) File "/Users/rouol/Code/WORK/Deep-Live-Cam/modules/processors/frame/face_swapper.py", line 48, in swap_face return get_face_swapper().get(temp_frame, target_face, source_face, paste_back=True) File "/Users/rouol/Code/WORK/Deep-Live-Cam/venv/lib/python3.10/site-packages/insightface/model_zoo/inswapper.py", line 50, in get latent = source_face.normed_embedding.reshape((1,-1)) AttributeError: 'NoneType' object has no attribute 'normed_embedding'

image

error pls help me

(deeplivecam) C:\WINDOWS\system32>python run.py --execution-provider cuda
python: can't open file 'C:\WINDOWS\system32\run.py': [Errno 2] No such file or directory

Run faster

Can you put it in a google collab, so it can run faster

Nothing happens when starting

I'm using a Mac M1 and when I run "python run.py", nothing happens. I have installed the requirements and tried re-installing it but nothing seems to work.
I'm using python 3.10.14 and I've checked previous issues and I still cant seem to fix this.

Update: I found the error "No module named 'gfpgan.archs.stylegan2_cleanonnx_arch'".

NoneType' object has no attribute 'configure'

File "C:\Users\user1\Downloads\Deep-Live-Cam-main\Deep-Live-Cam-main\modules\ui.py", line 137, in update_status
status_label.configure(text=text)
AttributeError: 'NoneType' object has no attribute 'configure'

get this error message when starting the programm

OpenVINO™ Execution Provider (Intel) doesn't utilizes GPU

first of all we need to install additionaly

pip.exe install openvino==2023.0


then run app i see "Applied providers: ['OpenVINOExecutionProvider', 'CPUExecutionProvider'], with options: {'OpenVINOExecutionProvider': {}, 'CPUExecutionProvider': {}}"

Processing: 100%|█| 245/245 [03:36<00:00, 1.13frame/s, execution_providers=['OpenVINOExecutionProvider'], execution_th

and CPU is 90% load, GPU 1% is load.

I have Intel Arc GPU

Nothing happens

The application doesn't run after running the start command. Can any anybody help ? I've done everything right but after the python run.py ----execution-provider cuda nothing happens the app doesn't get started

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.