Comments (9)
Does OpenCV make it possible to interpolate face positions between frames? I've had several instances where I've tried to convert a series of frames, but it fails to detect faces in a few frames in between; causing a glitching effect where the target face turns on and off. (link semi-nsfw)
from faceswap.
Indeed this a common issue. Face detection is often blocked by compression artifacts. It is the case in still pics and is even more present in videos.
I don't think there is a built in interpolation, but you can try doing it manually. While parsing frames, just keep a track of 1 or 2 previous frames and if current frame has nothing detected, do a 'mean' with previous data.
Other possibility is to keep the result of the last detection, and keep frames without faces until you detect another face. If the new face is close to the last, apply the new detection (or the old, or an interpolation) to the buffered frames. (Don't forget to give a max size to your buffer and flush it if no new face has been detected for x frames)
I'll try to tackle that later on...
from faceswap.
For now, I have an issue with input video reading. It seems python-opencv has no video decoder so I had to compile the full version...
from faceswap.
As I see on your video, there are also little glitches due to the face generator that may generate different faces for 2 consecutive frames. I don't see a clear solution here for now.
from faceswap.
I'm giving up for now, opencv-python seems not to have video support, and the full opencv lib is a pain to build....
I'll try to handle sequences of photos instead (video will just be a sequence of frames so it will adapt easily to videos)
from faceswap.
Remark: ‘python-opencv‘ seems not to have video support built-in as default. Is ‘moviepy‘ a better alternative?
from faceswap.
In the end, all these libraries boil down to is basic interaction with ffmpeg. I'm pretty sure python-OpenCV has this, but only if configured to use it. I would opt for the library with the most straightforward/pythonic interface. I would guess that is most likely moviepy, but I will look further into this after I've recovered from the new years hangover.
from faceswap.
How about taking existing code from somewhere that extracts all frames from a video, running the face swap over those and then taking the output and combine it to a video?
from faceswap.
@IcyTv Thats just writing a 4 line bash script to run the existing tools....
from faceswap.
Related Issues (20)
- cannot install miniconda HOT 2
- The video is very blurry HOT 1
- Log "session iterations" and "total iterations"
- Faceswap doesn't use RX 7900 XT HOT 1
- TypeError: 'type' object is not subscriptable HOT 7
- i have installed numpy but still it shows numpy not installed HOT 1
- Profiling failure on CUDNN engine 1#TC: RESOURCE_EXHAUSTED: Out of memory while trying to allocate 95420720 bytes HOT 1
- GPU not working HOT 3
- Training collapse HOT 1
- BLURRED VIDEO AFTER TRAINED HOT 1
- Potential Issue in CI Workflow Affecting Code Coverage Accuracy HOT 1
- Error when open GUI after install HOT 1
- Bounding boxes coordinates HOT 1
- DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead HOT 1
- DeprecationWarning: pkg_resources is deprecated as an API. HOT 1
- There are model on project? HOT 2
- あ
- GUI crash when running on Apple Silicon macbook HOT 5
- Is my PC good for face swapping? HOT 1
- [Question] How isolated is the installer 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 faceswap.