Instructions for Ubuntu 22.04 #419

Open
opened 2023-06-04 04:32:46 +02:00 by gteachey · 3 comments
gteachey commented 2023-06-04 04:32:46 +02:00 (Migrated from github.com)

I have no idea whether I'm running something unique, but these instructions do not work for me. At all.

After a treacherous day of hunting, here's the commands that worked to get this running for me in case it helps someone else:

Thank you https://github.com/gillesvandevoorde and https://github.com/mike9251 for the assists.
conda create -n simswap python=3.8
conda activate simswap
export CMAKE_ARGS="-DONNX_USE_PROTOBUF_SHARED_LIBS=ON"
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
conda install cudatoolkit -c pytorch
pip install --ignore-installed imageio
pip install insightface==0.2.1 onnxruntime moviepy
pip install onnxruntime-gpu

EDIT: Of course I miss a command!
pip install "numpy<1.24"

find your installation of 'model_zoo.py'.
I was running miniconda so it was under my ~/miniconda directory.
vim ~/miniconda3/envs/simswap2/lib/python3.8/site-packages/insightface/model_zoo/model_zoo.py

Update the line
def get_model(self):
session = onnxruntime.InferenceSession(self.onnx_file, None)
to
def get_model(self):
session = onnxruntime.InferenceSession(self.onnx_file, providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])

And I'm off to the races and doing swaps :).

Links referenced:
https://github.com/neuralchen/SimSwap/issues/395#issuecomment-1509889573
https://github.com/mike9251/simswap-inference-pytorch

I have no idea whether I'm running something unique, but these instructions do not work for me. At all. After a treacherous day of hunting, here's the commands that worked to get this running for me in case it helps someone else: Thank you https://github.com/gillesvandevoorde and https://github.com/mike9251 for the assists. **conda create -n simswap python=3.8 conda activate simswap export CMAKE_ARGS="-DONNX_USE_PROTOBUF_SHARED_LIBS=ON" conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia conda install cudatoolkit -c pytorch pip install --ignore-installed imageio pip install insightface==0.2.1 onnxruntime moviepy pip install onnxruntime-gpu** EDIT: Of course I miss a command! **pip install "numpy<1.24"** find your installation of 'model_zoo.py'. I was running miniconda so it was under my ~/miniconda directory. vim ~/miniconda3/envs/simswap2/lib/python3.8/site-packages/insightface/model_zoo/model_zoo.py Update the line def get_model(self): session = onnxruntime.InferenceSession(self.onnx_file, **None**) to def get_model(self): session = onnxruntime.InferenceSession(self.onnx_file, **providers=['CUDAExecutionProvider', 'CPUExecutionProvider'])** And I'm off to the races and doing swaps :). Links referenced: https://github.com/neuralchen/SimSwap/issues/395#issuecomment-1509889573 https://github.com/mike9251/simswap-inference-pytorch
geekbleek commented 2023-06-27 22:10:21 +02:00 (Migrated from github.com)

This worked for me - thank you!

This worked for me - thank you!
GoodFanxinran commented 2023-07-24 12:50:19 +02:00 (Migrated from github.com)

Hi, I follow your steps and install the environments successfully, Thank you so much!!
But I have another question when I do the 'python test_one_image.py --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path crop_224/6.jpg --pic_b_path crop_224/ds.jpg --output_path output/ ', I got the error: 'Pretrained network G has fewer layers; The following are not initialized: ['down0', 'first_layer', 'last_layer', 'up0']'. Have you ever met this? I will be very appreciated if you can give me some advice!!

Hi, I follow your steps and install the environments successfully, Thank you so much!! But I have another question when I do the 'python test_one_image.py --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path crop_224/6.jpg --pic_b_path crop_224/ds.jpg --output_path output/ ', I got the error: 'Pretrained network G has fewer layers; The following are not initialized: ['down0', 'first_layer', 'last_layer', 'up0']'. Have you ever met this? I will be very appreciated if you can give me some advice!!
sr1dh4r commented 2024-01-06 09:57:31 +01:00 (Migrated from github.com)

This resolved the issues for me but I seem to be getting sub-optimal results. The demo video from test_video_swapsingle.py is very jittery and the output image is not properly swapped.
Are you getting good results ? Could this be because we are not using the py 3.6 environment originally mentioned ?

This resolved the issues for me but I seem to be getting sub-optimal results. The demo video from test_video_swapsingle.py is very jittery and the output image is not properly swapped. Are you getting good results ? Could this be because we are not using the py 3.6 environment originally mentioned ?
Sign in to join this conversation.