haofanwang / inswapper

One-click Face Swapper and Restoration powered by insightface 🔥

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ModuleNotFoundError: No module named 'facelib.utils'

usamaa-saleem opened this issue · comments

I did import the codeformer as well and did everything as require, but still getting this error.

Traceback (most recent call last): File "swapper.py", line 228, in <module> from restoration import * File "/home/ubuntu/inswapper/restoration.py", line 12, in <module> from facelib.utils.face_restoration_helper import FaceRestoreHelper ModuleNotFoundError: No module named 'facelib.utils'

The facelib is inside CodeFormer. So first you need to git clone as instruction below and install libraries required by Codeformer.

git lfs install
git clone https://huggingface.co/spaces/sczhou/CodeFormer

and add the dir into your path, then you can import it.

import sys
sys.path.append('./CodeFormer/CodeFormer')

@usamaa-saleem Hope this helps.

I did import the codeformer as well and did everything as require, but still getting this error.

Traceback (most recent call last): File "swapper.py", line 228, in <module> from restoration import * File "/home/ubuntu/inswapper/restoration.py", line 12, in <module> from facelib.utils.face_restoration_helper import FaceRestoreHelper ModuleNotFoundError: No module named 'facelib.utils'

I met the same error, do you solve it???

Yes, #8 (comment) this helped.

I command as follows:
first, clone CodeFormer in the directory out of inswapper;

git lfs install
git clone https://huggingface.co/spaces/sczhou/CodeFormer

Then, in the file of restoration.py ,add the code as follow:

import sys
sys.path.append('../CodeFormer/CodeFormer')

But , I still meth the error: "No module named 'facelib.utils'"

So, do you make any other operations??

Try installing opencv-python==4.6.0.66

Try installing opencv-python==4.6.0.66

The same error.
Too strange!!!

Yes, #8 (comment) this helped.

I command as follows: first, clone CodeFormer in the directory out of inswapper;

git lfs install
git clone https://huggingface.co/spaces/sczhou/CodeFormer

Which operating system is this? Was the git lfs install command actually successful? Usually it requires the git-lfs package to be installed in your Operating System.

On Ubuntu Linux:

sudo apt update
sudo apt -y install git-lfs

On Mac:

brew install git-lfs

Yes, #8 (comment) this helped.

I command as follows: first, clone CodeFormer in the directory out of inswapper;

git lfs install
git clone https://huggingface.co/spaces/sczhou/CodeFormer

Which operating system is this? Was the git lfs install command actually successful? Usually it requires the git-lfs package to be installed in your Operating System.

On Ubuntu Linux:

sudo apt update
sudo apt -y install git-lfs

On Mac:

brew install git-lfs

Thank you!!