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

Google Colab #41

Open
osushilover opened this issue May 2, 2022 · 8 comments
Open

Google Colab #41

osushilover opened this issue May 2, 2022 · 8 comments

Comments

@osushilover
Copy link

I'm excited to watch the demo videos, especially the part of faceswap.
Please release the code for Google colab so that we can try this repo easily.
I am looking forward to your next update.

@deshwalmahesh
Copy link

@osushilover you can try this little demo in the meanwhile. too slow though.

@osushilover
Copy link
Author

@deshwalmahesh
You have the technical skills to build a Colab notebook from Python!
I admire you.

I tried the code you provided and it was indeed slow even with Tesla V100 under high memory on Colab Pro+.

However, I was able to process the test images and I know this code will definitely be useful for others, so thank you very much for your help.

If you would allow me, I would like to ask you to change the permissions of this notebook so that anyone can modify it.
I am not a programmer and do not understand what it means except for that first cell.
Therefore, I am embarrassed and frustrated that I still cannot try FaceSwap with the images I have prepared.

@Styml
Copy link

Styml commented May 4, 2022

If you would allow me, I would like to ask you to change the permissions of this notebook so that anyone can modify it.

You can simply copy notebook and change it yourself, if I understood you correctly.
If you want to faceswap your images, just change the urls in the second cell to links to your images and change fourth cell to !python main.py --im_path1 0.png --im_path2 1.png --sign realistic --smooth 5 or something like that

@deshwalmahesh
Copy link

@deshwalmahesh You have the technical skills to build a Colab notebook from Python! I admire you.

I tried the code you provided and it was indeed slow even with Tesla V100 under high memory on Colab Pro+.

However, I was able to process the test images and I know this code will definitely be useful for others, so thank you very much for your help.

If you would allow me, I would like to ask you to change the permissions of this notebook so that anyone can modify it. I am not a programmer and do not understand what it means except for that first cell. Therefore, I am embarrassed and frustrated that I still cannot try FaceSwap with the images I have prepared.

Thank you for such kind words. If you want to modify that notebook, you can either press Ctrl + S and save it in a drive or you could Download the ipynb and upload it again in Colab. I hope that works for you.

@kuldeep70391
Copy link

Downloading StyleGAN2 checkpoint: pretrained_models/ffhq.pt
Access denied with the following error:

Cannot retrieve the public link of the file. You may need to change
the permission to 'Anyone with the link', or have had many accesses. 

You may still be able to access the file from the browser:

 https://drive.google.com/uc?id=1AT6bNR2ppK8f2ETL_evT27f3R_oyWNHS 

Loading StyleGAN2 from checkpoint: pretrained_models/ffhq.pt
Traceback (most recent call last):
File "main.py", line 117, in
main(args)
File "main.py", line 18, in main
ii2s = Embedding(args)
File "/content/Barbershop/Barbershop/models/Embedding.py", line 23, in init
self.net = Net(self.opts)
File "/content/Barbershop/Barbershop/models/Net.py", line 15, in init
self.load_weights()
File "/content/Barbershop/Barbershop/models/Net.py", line 25, in load_weights
checkpoint = torch.load(self.opts.ckpt)
File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 771, in load
with _open_file_like(f, 'rb') as opened_file:
File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 270, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 251, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: 'pretrained_models/ffhq.pt'

@AdityaVishwakarmaIN
Copy link

true too slow in nature

@fingerella2000
Copy link

@deshwalmahesh Thank you for the sharing. It works like a charm without setting up the conda environment rather than just pip install ninja

Curious how does it work? Could you share a bit more about the magic?
Thanks.

@eralds
Copy link

eralds commented Jul 13, 2023

@deshwalmahesh Thank you for the sharing. It works like a charm without setting up the conda environment rather than just pip install ninja

Curious how does it work? Could you share a bit more about the magic? Thanks.

I also want to know why. My guess would be that the collab environment already has all the packages installed.

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

7 participants