Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'facelib.utils' #8

Open
usamaa-saleem opened this issue Aug 19, 2023 · 8 comments
Open

ModuleNotFoundError: No module named 'facelib.utils' #8

usamaa-saleem opened this issue Aug 19, 2023 · 8 comments

Comments

@usamaa-saleem
Copy link

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'

@haofanwang
Copy link
Owner

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.

@wly-ai-bj
Copy link

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???

@usamaa-saleem
Copy link
Author

Yes, #8 (comment) this helped.

@wly-ai-bj
Copy link

wly-ai-bj commented Feb 19, 2024

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??

@usamaa-saleem
Copy link
Author

Try installing opencv-python==4.6.0.66

@wly-ai-bj
Copy link

Try installing opencv-python==4.6.0.66

The same error.
Too strange!!!

@ashleykleynhans
Copy link
Contributor

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

@wly-ai-bj
Copy link

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!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants