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
34.59k stars 4.88k forks source link

Frame processor face_enhancer not found #191

Open ramzai23rus opened 1 month ago

ramzai23rus commented 1 month ago

D:\LiveCam2024>pip install onnxruntime-gpu==1.18.1 Collecting onnxruntime-gpu==1.18.1 Using cached onnxruntime_gpu-1.18.1-cp312-cp312-win_amd64.whl.metadata (4.5 kB) Requirement already satisfied: coloredlogs in c:\users\turbo\appdata\local\programs\python\python312\lib\site-packages (from onnxruntime-gpu==1.18.1) (15.0.1) Requirement already satisfied: flatbuffers in c:\users\turbo\appdata\local\programs\python\python312\lib\site-packages (from onnxruntime-gpu==1.18.1) (24.3.25) Requirement already satisfied: numpy<2.0,>=1.21.6 in c:\users\turbo\appdata\local\programs\python\python312\lib\site-packages (from onnxruntime-gpu==1.18.1) (1.26.4) Requirement already satisfied: packaging in c:\users\turbo\appdata\local\programs\python\python312\lib\site-packages (from onnxruntime-gpu==1.18.1) (24.1) Requirement already satisfied: protobuf in c:\users\turbo\appdata\local\programs\python\python312\lib\site-packages (from onnxruntime-gpu==1.18.1) (4.25.4) Requirement already satisfied: sympy in c:\users\turbo\appdata\local\programs\python\python312\lib\site-packages (from onnxruntime-gpu==1.18.1) (1.12) Requirement already satisfied: humanfriendly>=9.1 in c:\users\turbo\appdata\local\programs\python\python312\lib\site-packages (from coloredlogs->onnxruntime-gpu==1.18.1) (10.0) Requirement already satisfied: mpmath>=0.19 in c:\users\turbo\appdata\local\programs\python\python312\lib\site-packages (from sympy->onnxruntime-gpu==1.18.1) (1.3.0) Requirement already satisfied: pyreadline3 in c:\users\turbo\appdata\local\programs\python\python312\lib\site-packages (from humanfriendly>=9.1->coloredlogs->onnxruntime-gpu==1.18.1) (3.4.1) Using cached onnxruntime_gpu-1.18.1-cp312-cp312-win_amd64.whl (157.7 MB) Installing collected packages: onnxruntime-gpu Successfully installed onnxruntime-gpu-1.18.1

D:\LiveCam2024>python run.py --execution-provider cuda Traceback (most recent call last): File "D:\LiveCam2024\run.py", line 3, in from modules import core File "D:\LiveCam2024\modules\core.py", line 20, in import modules.ui as ui File "D:\LiveCam2024\modules\ui.py", line 6, in from PIL import Image, ImageOps ModuleNotFoundError: No module named 'PIL'

win11

ramzai23rus commented 1 month ago

Solved one problem, now another one has appeared

D:\LiveCam2024>python run.py --execution-provider cuda Frame processor face_enhancer not found

Closer1907 commented 1 month ago

same problem with me, if its solved, can u write mate?

Frame processor face_enhancer not found

Shirley0302 commented 2 weeks ago

try pip install gfpgan

dodgyrabbit commented 1 week ago

Here's what I found:

There was a silent error when the face_enhancer module tries to import gfpgan. You can reproduce (or verify this is the issue) by running:

python3

and then at the >>> prompt, type

import gfpgan

You may get the following error:

... some call stack...
ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'

If you have this error - you basically have a newer version of torch and that module has been deprecated, leading to the error. While there are better ways to fix it, you can monkey patch it as follows:

Locate the file degradations.py. This could be in your virtual environment hidden folder (such as .venv/lib/python3.1x/site-packages/basicsr/data/degradations.py or wherever your python packages are installed).

Open degradations.py in a text editor and change

from torchvision.transforms.functional_tensor import rgb_to_grayscale

to

from torchvision.transforms.functional import rgb_to_grayscale

Save the file and restart the app (or confirm it's working using the same steps above, importing gfpgan).

Again - better would be to fix your install, but this would likely be a quick workaround to get people going.