Comments (7)
I added a new parameter called save_swaps. If you check this option or set this value to True, it will save the swapped images for a video file as well as the video itself. Please see the updated colab notebook below.
https://colab.research.google.com/gist/quantarb/6327c2ef8f72ebeb0e41541f8476f4ce/sber-swap.ipynb
from ghost.
Here you go. I modified the colab notebook. This notebook does the following.
1. Iterate through each image zip file or video file in your dst folder. 2. Extract images from the zip file or video file into a temp folder. 3. Attempts to sber swap each image in the temp folder and saves the swapped image in the swapped folder. 4. If the original file was a zip, it will zipped all the images and save it as a zip file with the same name in the result folder. 5. If the original file was a video file it will make a video from all the swapped images and save it with the name in the result folder.
https://colab.research.google.com/gist/quantarb/5073703261652edde5464db0cacd9059/sber-swap.ipynb
Big thanks for the reply and for the link! At the moment I'm using my own version of Colab and using video processing either as written in the readme. Yes, I can export video to frames with FFmpeg or opencv and batch process the images and then assemble them into a video or GIF, but I mean it would be great to have the option like --save_frames
to save the final images during processing in a separate folder! Thanks
from ghost.
Here you go. I modified the colab notebook. This notebook does the following.
- Iterate through each image zip file or video file in your dst folder.
- Extract images from the zip file or video file into a temp folder.
- Attempts to sber swap each image in the temp folder and saves the swapped image in the swapped folder.
- If the original file was a zip, it will zipped all the images and save it as a zip file with the same name in the result folder.
- If the original file was a video file it will make a video from all the swapped images and save it with the name in the result folder.
https://colab.research.google.com/gist/quantarb/6327c2ef8f72ebeb0e41541f8476f4ce/sber-swap.ipynb
from ghost.
In video_processing.py there is a function read_video. In that function you could simply save the images to disk.
from ghost.
In video_processing.py there is a function read_video. In that function you could simply save the images to disk.
Hey! If I understand correctly, this function is responsible for counting frames from the video, but I meant to save full frames with the face already replaced. I tried to add in def get_final_video
something like cv2.imwrite("/content/sber-swap/tmp_frames", result_frames[i])
but unfortunately I'm not strong in Python to do it right.
from ghost.
I added a new parameter called save_swaps. If you check this option or set this value to True, it will save the swapped images for a video file as well as the video itself. Please see the updated colab notebook below.
https://colab.research.google.com/gist/quantarb/6327c2ef8f72ebeb0e41541f8476f4ce/sber-swap.ipynb
You did a splendid job, congrats! I tried the multiple functions and they work very well, I just have a question:
I noticed that the swapped face is the first one encountered on dest or the one we place on the target folder, is there a simple way to swap every face in the images/videos?
from ghost.
I added a new parameter called save_swaps. If you check this option or set this value to True, it will save the swapped images for a video file as well as the video itself. Please see the updated colab notebook below.
https://colab.research.google.com/gist/quantarb/6327c2ef8f72ebeb0e41541f8476f4ce/sber-swap.ipynbYou did a splendid job, congrats! I tried the multiple functions and they work very well, I just have a question: I noticed that the swapped face is the first one encountered on dest or the one we place on the target folder, is there a simple way to swap every face in the images/videos?
Not to my knowledge. You would need to pass in all face images in the target_face_paths to swap all the faces.
from ghost.
Related Issues (20)
- ModuleNotFoundError: No module named 'mxnet' HOT 2
- No module named 'insightface' HOT 1
- errors occure when the input video contains some no-face fragments
- google cloud is closed HOT 1
- Google Cloud is unavailable and banned! ! HOT 3
- Where
- Juanes
- TypeError: RetinaFace.detect() got an unexpected keyword argument 'threshold'
- Output is black blob on face of target image -- tips for debug?
- Suspicious/malicious file with binary incoded as base64 ofuscating as png image HOT 1
- Error when loading "Preparation" section HOT 1
- colab error OSError: libcudart.so.11.0: cannot open shared object file: No such file or directory HOT 1
- what is a model license? HOT 3
- Inconsistent requirements HOT 1
- Vgg2 dataset cannot be downloaded HOT 2
- How to Only Save the Best Model During Training
- Requirements.txt
- Need Help Resolving Critical Errors in Code
- Google blocks colab file
- Google colab is not working HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ghost.