-
Notifications
You must be signed in to change notification settings - Fork 901
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
Running without GPU #180
Comments
I tried it. It looks for the Nvidia drivers when you run it. It may work if you manually installed in Nvidia drivers into the proper folders. I wasn't getting any GPU usage anyway so I tried it on another computer that doesn't have a GPU. It's just an i7. If you get it to run without a GPU let us know. You can also just use the Google colab. |
According to #61 by patching the files with the script at https://pastebin.com/y1FxV8jA you can make it run only on the CPU (no GPU needed at all). Also at the following repository https://github.com/johndpope/SimSWAP-docker you can find a dockerfile for building a Simswap docker image which if I remember correctly is already patched with the method above. The image is not using the latest version of Simswap but the penultimate one, but that's not a problem as the improvements in the latest version model does not seem to produce better results (see #171). Update: a new repository has been published by the same user at https://github.com/johndpope/SimSWAP-docker-1 which uses the latest version of Simswap. If you want you could still run this latest version with the old, better-looking model by using the "--crop_size 224" parameter. |
Hello, I put here the installation command lines that worked for me (MacOS Apple Chip M1). Also for CPU usage only with the Powershell script available here: https://pastebin.com/y1FxV8jA, thanks a lot for that #61, @illtellyoulater for links and #294. Here is my configuration: Assuming you have installed brew. Hope this help. brew install wget
brew install ffmpeg
sudo softwareupdate --install-rosetta
brew install --cask powershell
conda create -n simswap python=3.9
conda activate simswap
conda install pytorch torchvision -c pytorch-nightly
conda install -c conda-forge protobuf numpy
pip install onnx
pip install insightface==0.2.1 onnxruntime moviepy
pip install --ignore-installed imageio
git clone https://github.com/neuralchen/SimSwap
cd SimSwap && git pull
wget -P ./arcface_model https://github.com/neuralchen/SimSwap/releases/download/1.0/arcface_checkpoint.tar
wget https://github.com/neuralchen/SimSwap/releases/download/1.0/checkpoints.zip
unzip ./checkpoints.zip -d ./checkpoints
wget -P ./parsing_model/checkpoint https://github.com/neuralchen/SimSwap/releases/download/1.0/79999_iter.pth
wget --no-check-certificate "https://sh23tw.dm.files.1drv.com/y4mmGiIkNVigkSwOKDcV3nwMJulRGhbtHdkheehR5TArc52UjudUYNXAEvKCii2O5LAmzGCGK6IfleocxuDeoKxDZkNzDRSt4ZUlEt8GlSOpCXAFEkBwaZimtWGDRbpIGpb_pz9Nq5jATBQpezBS6G_UtspWTkgrXHHxhviV2nWy8APPx134zOZrUIbkSF6xnsqzs3uZ_SEX_m9Rey0ykpx9w" -O antelope.zip
unzip ./antelope.zip -d ./insightface_func/models/
pwsh patch.ps1 # FOR CPU ONLY assuming you have downloaded the file at https://pastebin.com/y1FxV8jA
python test_video_swapsingle.py --crop_size 224 --use_mask --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path demo_file/Iron_man.jpg --video_path demo_file/multi_people_1080p.mp4 --output_path output/multi_test_swapsingle.mp4 --temp_path temp_results
------------ Options -------------
Arc_path: arcface_model/arcface_checkpoint.tar
aspect_ratio: 1.0
batchSize: 8
checkpoints_dir: ./checkpoints
cluster_path: features_clustered_010.npy
crop_size: 224
data_type: 32
dataroot: ./datasets/cityscapes/
display_winsize: 512
engine: None
export_onnx: None
feat_num: 3
fineSize: 512
fp16: False
gpu_ids: [0]
how_many: 50
id_thres: 0.03
image_size: 224
input_nc: 3
instance_feat: False
isTrain: False
label_feat: False
label_nc: 0
latent_size: 512
loadSize: 1024
load_features: False
local_rank: 0
max_dataset_size: inf
model: pix2pixHD
multisepcific_dir: ./demo_file/multispecific
nThreads: 2
n_blocks_global: 6
n_blocks_local: 3
n_clusters: 10
n_downsample_E: 4
n_downsample_global: 3
n_local_enhancers: 1
name: people
nef: 16
netG: global
ngf: 64
niter_fix_global: 0
no_flip: False
no_instance: False
no_simswaplogo: False
norm: batch
norm_G: spectralspadesyncbatch3x3
ntest: inf
onnx: None
output_nc: 3
output_path: output/multi_test_swapsingle.mp4
phase: test
pic_a_path: demo_file/Iron_man.jpg
pic_b_path: ./crop_224/zrf.jpg
pic_specific_path: ./crop_224/zrf.jpg
resize_or_crop: scale_width
results_dir: ./results/
semantic_nc: 3
serial_batches: False
temp_path: temp_results
tf_log: False
use_dropout: False
use_encoded_image: False
use_mask: True
verbose: False
video_path: demo_file/multi_people_1080p.mp4
which_epoch: latest
-------------- End ----------------
input mean and std: 127.5 127.5
find model: ./insightface_func/models/antelope/glintr100.onnx recognition
find model: ./insightface_func/models/antelope/scrfd_10g_bnkps.onnx detection
set det-size: (640, 640)
(142, 366, 4)
1%|▎ | 5/594 [00:04<09:31, 1.03it/s]
1%|▎ |
Hi there, Thanks very much for the detailed installation guide, I just followed your instructions step by step, but on a newer OS version, actually: MacOS 13.0 (MacBook Pro M1) and I keep getting this error:
I checked that MPS is enabled with jupyter notebook etc, so I've no idea what this error is about. Did you ever encounter this issue?. Thanks in advance |
Hi @escamez, this may be related to Pytorch's version. I can't say exactly where this error comes from. Without going through pytorch-nightly unfortunately, try to replace: conda install pytorch torchvision -c pytorch-nightly
conda install -c conda-forge protobuf numpy
pip install onnx
pip install insightface==0.2.1 onnxruntime moviepy
pip install --ignore-installed imageio by conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 -c pytorch
pip install onnx insightface==0.2.1 onnxruntime moviepy imageio imageio-ffmpeg during the installation process. Please let me know if it's work! I will find out more about your error raised. |
Related: |
Hi...first congratulation si really efficient and smart...I would like to know if there is any parameter that will allow me to use it only on CPU (no nvidia)...or a trick/emulator
Thanks a lot
The text was updated successfully, but these errors were encountered: