GithubHelp home page GithubHelp logo

facefusion / facefusion-docker Goto Github PK

View Code? Open in Web Editor NEW
216.0 216.0 76.0 16 KB

Next generation face swapper and enhancer

Home Page: https://join.facefusion.io

License: Other

ai deep-fake deepfake docker face-swap faceswap lip-sync lipsync webcam

facefusion-docker's Introduction

FaceFusion

Next generation face swapper and enhancer.

Build Status License

Preview

Preview

Installation

Be aware, the installation needs technical skills and is not for beginners. Please do not open platform and installation related issues on GitHub. We have a very helpful Discord community that will guide you to complete the installation.

Get started with the installation guide.

Usage

Run the command:

python run.py [options]

options:
  -h, --help                                                                                                                                            show this help message and exit
  -s SOURCE_PATHS, --source SOURCE_PATHS                                                                                                                choose single or multiple source images or audios
  -t TARGET_PATH, --target TARGET_PATH                                                                                                                  choose single target image or video
  -o OUTPUT_PATH, --output OUTPUT_PATH                                                                                                                  specify the output file or directory
  -v, --version                                                                                                                                         show program's version number and exit

misc:
  --force-download                                                                                                                                      force automate downloads and exit
  --skip-download                                                                                                                                       omit automate downloads and remote lookups
  --headless                                                                                                                                            run the program without a user interface
  --log-level {error,warn,info,debug}                                                                                                                   adjust the message severity displayed in the terminal

execution:
  --execution-providers EXECUTION_PROVIDERS [EXECUTION_PROVIDERS ...]                                                                                   accelerate the model inference using different providers (choices: cpu, ...)
  --execution-thread-count [1-128]                                                                                                                      specify the amount of parallel threads while processing
  --execution-queue-count [1-32]                                                                                                                        specify the amount of frames each thread is processing

memory:
  --video-memory-strategy {strict,moderate,tolerant}                                                                                                    balance fast frame processing and low VRAM usage
  --system-memory-limit [0-128]                                                                                                                         limit the available RAM that can be used while processing

face analyser:
  --face-analyser-order {left-right,right-left,top-bottom,bottom-top,small-large,large-small,best-worst,worst-best}                                     specify the order in which the face analyser detects faces
  --face-analyser-age {child,teen,adult,senior}                                                                                                         filter the detected faces based on their age
  --face-analyser-gender {female,male}                                                                                                                  filter the detected faces based on their gender
  --face-detector-model {many,retinaface,scrfd,yoloface,yunet}                                                                                          choose the model responsible for detecting the face
  --face-detector-size FACE_DETECTOR_SIZE                                                                                                               specify the size of the frame provided to the face detector
  --face-detector-score [0.0-1.0]                                                                                                                       filter the detected faces base on the confidence score
  --face-landmarker-score [0.0-1.0]                                                                                                                     filter the detected landmarks base on the confidence score

face selector:
  --face-selector-mode {many,one,reference}                                                                                                             use reference based tracking or simple matching
  --reference-face-position REFERENCE_FACE_POSITION                                                                                                     specify the position used to create the reference face
  --reference-face-distance [0.0-1.5]                                                                                                                   specify the desired similarity between the reference face and target face
  --reference-frame-number REFERENCE_FRAME_NUMBER                                                                                                       specify the frame used to create the reference face

face mask:
  --face-mask-types FACE_MASK_TYPES [FACE_MASK_TYPES ...]                                                                                               mix and match different face mask types (choices: box, occlusion, region)
  --face-mask-blur [0.0-1.0]                                                                                                                            specify the degree of blur applied the box mask
  --face-mask-padding FACE_MASK_PADDING [FACE_MASK_PADDING ...]                                                                                         apply top, right, bottom and left padding to the box mask
  --face-mask-regions FACE_MASK_REGIONS [FACE_MASK_REGIONS ...]                                                                                         choose the facial features used for the region mask (choices: skin, left-eyebrow, right-eyebrow, left-eye, right-eye, glasses, nose, mouth, upper-lip, lower-lip)

frame extraction:
  --trim-frame-start TRIM_FRAME_START                                                                                                                   specify the the start frame of the target video
  --trim-frame-end TRIM_FRAME_END                                                                                                                       specify the the end frame of the target video
  --temp-frame-format {bmp,jpg,png}                                                                                                                     specify the temporary resources format
  --keep-temp                                                                                                                                           keep the temporary resources after processing

output creation:
  --output-image-quality [0-100]                                                                                                                        specify the image quality which translates to the compression factor
  --output-image-resolution OUTPUT_IMAGE_RESOLUTION                                                                                                     specify the image output resolution based on the target image
  --output-video-encoder {libx264,libx265,libvpx-vp9,h264_nvenc,hevc_nvenc,h264_amf,hevc_amf}                                                           specify the encoder use for the video compression
  --output-video-preset {ultrafast,superfast,veryfast,faster,fast,medium,slow,slower,veryslow}                                                          balance fast video processing and video file size
  --output-video-quality [0-100]                                                                                                                        specify the video quality which translates to the compression factor
  --output-video-resolution OUTPUT_VIDEO_RESOLUTION                                                                                                     specify the video output resolution based on the target video
  --output-video-fps OUTPUT_VIDEO_FPS                                                                                                                   specify the video output fps based on the target video
  --skip-audio                                                                                                                                          omit the audio from the target video

frame processors:
  --frame-processors FRAME_PROCESSORS [FRAME_PROCESSORS ...]                                                                                            load a single or multiple frame processors. (choices: face_debugger, face_enhancer, face_swapper, frame_colorizer, frame_enhancer, lip_syncer, ...)
  --face-debugger-items FACE_DEBUGGER_ITEMS [FACE_DEBUGGER_ITEMS ...]                                                                                   load a single or multiple frame processors (choices: bounding-box, face-landmark-5, face-landmark-5/68, face-landmark-68, face-landmark-68/5, face-mask, face-detector-score, face-landmarker-score, age, gender)
  --face-enhancer-model {codeformer,gfpgan_1.2,gfpgan_1.3,gfpgan_1.4,gpen_bfr_256,gpen_bfr_512,gpen_bfr_1024,gpen_bfr_2048,restoreformer_plus_plus}     choose the model responsible for enhancing the face
  --face-enhancer-blend [0-100]                                                                                                                         blend the enhanced into the previous face
  --face-swapper-model {blendswap_256,inswapper_128,inswapper_128_fp16,simswap_256,simswap_512_unofficial,uniface_256}                                  choose the model responsible for swapping the face
  --frame-colorizer-model {ddcolor,ddcolor_artistic,deoldify,deoldify_artistic,deoldify_stable}                                                         choose the model responsible for colorizing the frame
  --frame-colorizer-blend [0-100]                                                                                                                       blend the colorized into the previous frame
  --frame-colorizer-size {192x192,256x256,384x384,512x512}                                                                                              specify the size of the frame provided to the frame colorizer
  --frame-enhancer-model {lsdir_x4,nomos8k_sc_x4,real_esrgan_x2,real_esrgan_x2_fp16,real_esrgan_x4,real_esrgan_x4_fp16,real_hatgan_x4,span_kendata_x4}  choose the model responsible for enhancing the frame
  --frame-enhancer-blend [0-100]                                                                                                                        blend the enhanced into the previous frame
  --lip-syncer-model {wav2lip_gan}                                                                                                                      choose the model responsible for syncing the lips

uis:
  --ui-layouts UI_LAYOUTS [UI_LAYOUTS ...]                                                                                                              launch a single or multiple UI layouts (choices: benchmark, default, webcam, ...)

Documentation

Read the documentation for a deep dive.

facefusion-docker's People

Contributors

henryruhs 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

facefusion-docker's Issues

docker versions

I ran into the issue bellow when running
docker-compose -f docker-compose.cuda.yml up :
(@henryruhs there is also typo in your Readme docker-compuse.cuda.yml and docker-compuse.cpu.yml up)

 => ERROR [stage-1 3/7] RUN apt-get update                                                                                                                                                                             15.7s
------
 > [stage-1 3/7] RUN apt-get update -y:
#6 0.703 Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
#6 1.446 Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]
#6 1.725 Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
#6 1.931 Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8906 kB]
#6 14.55 Get:5 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [4732 B]
#6 15.22 Get:6 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [57.7 kB]
#6 15.34 Fetched 9220 kB in 15s (616 kB/s)
#6 15.34 Reading package lists...
#6 15.67 E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
#6 15.67 E: Sub-process returned an error code
------

Updating to Docker >= 20.10.9 fixed it

Reference:
https://stackoverflow.com/questions/71941032/why-i-cannot-run-apt-update-inside-a-fresh-ubuntu22-04

There are seem all model are not found.

facefusion-docker-facefusion-cpu-1 | File "/facefusion/facefusion/face_analyser.py", line 116, in detect_with_retinaface
facefusion-docker-facefusion-cpu-1 | face_detector = get_face_analyser().get('face_detector')
facefusion-docker-facefusion-cpu-1 | File "/facefusion/facefusion/face_analyser.py", line 59, in get_face_analyser
facefusion-docker-facefusion-cpu-1 | face_detector = onnxruntime.InferenceSession(MODELS.get('face_detector_retinaface').get('path'), providers = facefusion.globals.execution_providers)
facefusion-docker-facefusion-cpu-1 | File "/usr/local/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in init
facefusion-docker-facefusion-cpu-1 | self._create_inference_session(providers, provider_options, disabled_optimizers)
facefusion-docker-facefusion-cpu-1 | File "/usr/local/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 452, in _create_inference_session
facefusion-docker-facefusion-cpu-1 | sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
facefusion-docker-facefusion-cpu-1 | onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from /facefusion/.assets/models/retinaface_10g.onnx failed:Load model /facefusion/.assets/models/retinaface_10g.onnx failed. File doesn't exist

response from daemon: could not select device driver "rocm" with capabilities: [[gpu video]]

:/facefusion-docker$ **docker compose -f docker-compose.rocm.yml up -d** WARN[0000] Found orphan containers ([facefusion-docker-facefusion-cuda-1 facefusion-docker-facefusion-cpu-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. [+] Running 0/1 ⠹ Container facefusion-docker-facefusion-rocm-1 Starting 0.2s Error response from daemon: could not select device driver "rocm" with capabilities: [[gpu video]]
Fri Apr 19 17:19:18 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.67 Driver Version: 550.67 CUDA Version: 12.4 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 2060 ... Off | 00000000:42:00.0 Off | N/A |
| 41% 36C P8 4W / 175W | 591MiB / 8192MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 379810 C python 588MiB |
+-----------------------------------------------------------------------------------------+

libprotobuf warnings - Reading dangerously large protocol message

I couldn't see an existing issue logged for this and you may already be aware of it, but in case you're not recent versions of FF (I think from 2.0) throw a lot of warnings in the console output from libprotobuf:

docker logs -f facefusion -n10
CUDA Version 11.8.0

Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.

[libprotobuf WARNING google/protobuf/io/coded_stream.cc:604] Reading dangerously large protocol message.  If the message turns out to be larger than 2147483647 bytes, parsing will be halted for security reasons.  To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:81] The total number of bytes read was 553206116
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:604] Reading dangerously large protocol message.  If the message turns out to be larger than 2147483647 bytes, parsing will be halted for security reasons.  To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:81] The total number of bytes read was 553206116
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:604] Reading dangerously large protocol message.  If the message turns out to be larger than 2147483647 bytes, parsing will be halted for security reasons.  To increase the limit (or to disable these warnings), see CodedInputStream::SetTotalBytesLimit() in google/protobuf/io/coded_stream.h.
[libprotobuf WARNING google/protobuf/io/coded_stream.cc:81] The total number of bytes read was 553206705
  • facefusion 2.1.0
  • official facefusion docker build
  • nvidia-docker (latest stable)
  • fedora 39

Face enhancer stopped working

I had this error from cli,
facefusion-docker-facefusion-cuda-1 | [FACEFUSION.FRAME_PROCESSOR.FACE_ENHANCER] Download of the model is not done!

System: Windows 10
Docker Desktop 4.25.2 (129061).

can't cd to /usr/local/lib/python3.10/dist-packages/torch/lib

win10, error:

 => ERROR [12/12] RUN cd /usr/local/lib/python3.10/dist-packages/torch/lib && ln -s l  0.3s 
------
 > [12/12] RUN cd /usr/local/lib/python3.10/dist-packages/torch/lib && ln -s libnvrtc-672ee683.so.11.2 libnvrtc.so:
#0 0.313 /bin/sh: 1: cd: can't cd to /usr/local/lib/python3.10/dist-packages/torch/lib      
------
failed to solve: executor failed running [/bin/sh -c cd /usr/local/lib/python3.10/dist-packages/torch/lib && ln -s libnvrtc-672ee683.so.11.2 libnvrtc.so]: exit code: 2

GPU usage rate is 0

+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.161.07             Driver Version: 535.161.07   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA A10                     On  | 00000000:00:07.0 Off |                    0 |
|  0%   50C    P0              61W / 150W |    970MiB / 23028MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A     33342      C   python                                      962MiB |
+---------------------------------------------------------------------------------------+

Could not load library libcudnn_cnn_infer.so.8

CUDA Dockerfile is broken.

Downloading: 100%|██████████| 529M/529M [16:47<00:00, 330kB/s]
2023-10-12T14:55:40.727010349Z download_path: /root/.insightface/models/buffalo_l
2023-10-12T14:55:40.727026296Z Downloading /root/.insightface/models/buffalo_l.zip from https://github.com/deepinsight/insightface/releases/download/v0.7/buffalo_l.zip...
100%|██████████| 281857/2818572023-10-12T14:56:05.413723033Z  [00:24<00:00, 11417.48KB/s]
2023-10-12T15:26:03.891534028Z Could not load library libcudnn_cnn_infer.so.8. Error: libnvrtc.so: cannot open shared object file: No such file or directory

This might solve it - add it to the end of Dockerfile.cuda:

RUN pip install torch --extra-index-url https://download.pytorch.org/whl/nightly/cu118

ModuleNotFoundError: No module named 'onnxruntime'

There's an error, ModuleNotFoundError: No module named 'onnxruntime' , when 'docker-compose -f docker-compose.cpu.yml up' is executed.

C:\Users\admin\Documents...\facefusion-docker>docker-compose -f docker-compose.cpu.yml up
[+] Building 4.5s (12/12) FINISHED docker:default
=> [facefusion-cpu internal] load build definition from Dockerfile.cpu 0.0s
=> => transferring dockerfile: 398B 0.0s
=> [facefusion-cpu internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [facefusion-cpu internal] load metadata for docker.io/library/python:3.10 4.4s
=> [facefusion-cpu auth] library/python:pull token for registry-1.docker.io 0.0s
=> [facefusion-cpu 1/7] FROM docker.io/library/python:3.10@sha256:eac7369136625549bc3f7461fe072b1030f538ea20d629 0.0s
=> CACHED [facefusion-cpu 2/7] WORKDIR /facefusion 0.0s
=> CACHED [facefusion-cpu 3/7] RUN apt-get update 0.0s
=> CACHED [facefusion-cpu 4/7] RUN apt-get install curl -y 0.0s
=> CACHED [facefusion-cpu 5/7] RUN apt-get install ffmpeg -y 0.0s
=> CACHED [facefusion-cpu 6/7] RUN git clone https://github.com/facefusion/facefusion.git --branch 1.3.1 --singl 0.0s
=> CACHED [facefusion-cpu 7/7] RUN python install.py --torch cpu --onnxruntime default 0.0s
=> [facefusion-cpu] exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:09fc17e82a45f9683f18b76e76b5515a7869082a128a4661b7052b5e62ce8ce3 0.0s
=> => naming to docker.io/library/facefusion-docker-facefusion-cpu 0.0s
[+] Running 2/2
✔ Network facefusion-docker_default Created 0.0s
✔ Container facefusion-docker-facefusion-cpu-1 Created 4.1s
Attaching to facefusion-docker-facefusion-cpu-1
facefusion-docker-facefusion-cpu-1 | Traceback (most recent call last):
facefusion-docker-facefusion-cpu-1 | File "/facefusion/run.py", line 3, in
facefusion-docker-facefusion-cpu-1 | from facefusion import core
facefusion-docker-facefusion-cpu-1 | File "/facefusion/facefusion/core.py", line 11, in
facefusion-docker-facefusion-cpu-1 | import onnxruntime
facefusion-docker-facefusion-cpu-1 | ModuleNotFoundError: No module named 'onnxruntime'
facefusion-docker-facefusion-cpu-1 exited with code 1

docker cpu up error with ModuleNotFoundError: No module named 'cv2'

[+] Running 1/0ion-docker>docker-compose -f docker-compose.cpu.yml up
✔ Container facefusion-docker-facefusion-cpu-1 Created 0.0s
Attaching to facefusion-docker-facefusion-cpu-1
facefusion-docker-facefusion-cpu-1 | Traceback (most recent call last):
facefusion-docker-facefusion-cpu-1 | File "/facefusion/run.py", line 3, in
facefusion-docker-facefusion-cpu-1 | from facefusion import core
facefusion-docker-facefusion-cpu-1 | File "/facefusion/facefusion/core.py", line 16, in
facefusion-docker-facefusion-cpu-1 | from facefusion.face_analyser import get_one_face, get_average_face
facefusion-docker-facefusion-cpu-1 | File "/facefusion/facefusion/face_analyser.py", line 3, in
facefusion-docker-facefusion-cpu-1 | import cv2
facefusion-docker-facefusion-cpu-1 | ModuleNotFoundError: No module named 'cv2'
facefusion-docker-facefusion-cpu-1 exited with code 1

Missing pip install in dockerfile.cpu

Hello,

In the Dockerfile.cpu, you are missing the "RUN apt-get install python3-pip -y" command.

RUN apt-get update
RUN apt-get install curl -y
RUN apt-get install ffmpeg -y
RUN apt-get install python3-pip -y

libnvrtc.so: cannot open shared object file:

facefusion-docker-facefusion-cuda-1  | Could not load library libcudnn_cnn_infer.so.8. Error: libnvrtc.so: cannot open shared object file: No such file or directory
facefusion-docker-facefusion-cuda-1 exited with code 139

Docker + CUDA

I almost exclusively use CUDA with docker. On my dev workstation when using this repo CUDA isn't utilized even though it is detected as the execution provider:

Processing: 100%|██████████| 197/197 [01:04<00:00, 3.05frame/s, memory_usage=06.71GB, execution_providers=['CUDAExecutionProvider'], execution_thread_count=8, execution_queue_count=1]

When checking GPU status with nvidia-smi I never see the model loaded to memory or executing there. nvenc doesn't appear to work either.

I hacked up my own variant with a Dockerfile FROM nvcr.io/nvidia/tensorflow:23.08-tf2-py3 and I'm able to see the model load in VRAM but it still doesn't execute there. In my variant I'm also able to use nvenc and verify via nvidia-smi that is in actually being utilized.

Hardware is Nvidia RTX 4090.

Any thoughts? How can I help?

ModuleNotFoundError: No module named 'cv2'

When I run docker-compose -f docker-compose.cpu.yml up from a newly cloned repo, I get the following error

[+] Running 1/0
 ✔ Container facefusion-docker-facefusion-cpu-1  Created                                                                                                               0.0s 
Attaching to facefusion-docker-facefusion-cpu-1
facefusion-docker-facefusion-cpu-1  | Traceback (most recent call last):
facefusion-docker-facefusion-cpu-1  |   File "/facefusion/run.py", line 3, in <module>
facefusion-docker-facefusion-cpu-1  |     from facefusion import core
facefusion-docker-facefusion-cpu-1  |   File "/facefusion/facefusion/core.py", line 16, in <module>
facefusion-docker-facefusion-cpu-1  |     from facefusion.face_analyser import get_one_face, get_average_face
facefusion-docker-facefusion-cpu-1  |   File "/facefusion/facefusion/face_analyser.py", line 3, in <module>
facefusion-docker-facefusion-cpu-1  |     import cv2
facefusion-docker-facefusion-cpu-1  | ModuleNotFoundError: No module named 'cv2'
facefusion-docker-facefusion-cpu-1 exited with code 1

What do I do wrong?

Get ModuleNotFoundError: No module named 'onnxruntime'

Hi guys,

I try the README instruction but failed to up the container
Run: docker-compose -f docker-compose.cpu.yml up , get below errors:

2023-12-10 16:53:01 facefusion-docker-facefusion-cpu-1 | Traceback (most recent call last):
2023-12-10 16:53:01 facefusion-docker-facefusion-cpu-1 | File "/facefusion/run.py", line 3, in
2023-12-10 16:53:01 facefusion-docker-facefusion-cpu-1 | from facefusion import core
2023-12-10 16:53:01 facefusion-docker-facefusion-cpu-1 | File "/facefusion/facefusion/core.py", line 10, in
2023-12-10 16:53:01 facefusion-docker-facefusion-cpu-1 | import onnxruntime
2023-12-10 16:53:01 facefusion-docker-facefusion-cpu-1 | ModuleNotFoundError: No module named 'onnxruntime'

Docker version: 4.20.1 (110738)

OS: MacOS 14.1.2 (23B92)
CPU chip: Intel i9

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY

Step 5/9 : RUN apt-get update
---> Running in 365a7a2b7863

Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Err:1 http://deb.debian.org/debian bookworm InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY F8D2585B8783D481
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB]
Err:2 http://deb.debian.org/debian bookworm-updates InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Err:3 http://deb.debian.org/debian-security bookworm-security InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8
Reading package lists...
W: GPG error: http://deb.debian.org/debian bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY F8D2585B8783D481
E: The repository 'http://deb.debian.org/debian bookworm InRelease' is not signed.
W: GPG error: http://deb.debian.org/debian bookworm-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
E: The repository 'http://deb.debian.org/debian bookworm-updates InRelease' is not signed.
W: GPG error: http://deb.debian.org/debian-security bookworm-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8
E: The repository 'http://deb.debian.org/debian-security bookworm-security InRelease' is not signed.
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/.deb /var/cache/apt/archives/partial/.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code
ERROR: Service 'facefusion-cpu' failed to build: The command '/bin/sh -c apt-get update' returned a non-zero code: 100

docker-compose cuda error.

=> ERROR [12/12] RUN cd /usr/local/lib/python3.10/dist-packages/torch/lib && ln -s libnvrtc-672ee683.so.11.2 libnvrtc.so 0.1s

[12/12] RUN cd /usr/local/lib/python3.10/dist-packages/torch/lib && ln -s libnvrtc-672ee683.so.11.2 libnvrtc.so:
0.116 /bin/sh: 1: cd: can't cd to /usr/local/lib/python3.10/dist-packages/torch/lib


Dockerfile.cuda:19

17 | RUN python install.py --torch cuda-11.8 --onnxruntime cuda-11.8 --skip-venv
18 |
19 | >>> RUN cd /usr/local/lib/python3.10/dist-packages/torch/lib && ln -s libnvrtc-672ee683.so.11.2 libnvrtc.so
20 |

ERROR: failed to solve: process "/bin/sh -c cd /usr/local/lib/python3.10/dist-packages/torch/lib && ln -s libnvrtc-672ee683.so.11.2 libnvrtc.so" did not complete successfully: exit code: 2
ERROR: Service 'facefusion-cuda' failed to build : Build failed
root@iZbp1g6u4mfoqizw32yg4wZ:~/facefusion-docker# docker-compose -f docker-compose.cuda.yml up

Build Error

[+] Running 2/2
 ⠿ Network facefusion-docker_default              Created                                                                           0.1s
 ⠿ Container facefusion-docker-facefusion-cuda-1  Created                                                                           0.0s
Attaching to facefusion-docker-facefusion-cuda-1
Error response from daemon: could not select device driver "nvidia" with capabilities: [[gpu video]]

This is an error I encountered when building using docker-compose -f docker-compose.cuda.yml up

root@iZbp1ipx4pk8Z:/home/ecs-user/facefusion-docker# nvidia-smi
Fri Mar 29 16:46:51 2024       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.161.07             Driver Version: 535.161.07   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA A10                     On  | 00000000:00:07.0 Off |                    0 |
|  0%   27C    P8               9W / 150W |      0MiB / 23028MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+
root@iZbp1ipx8Z:/home/ecs-user/facefusion-docker# 

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.