Comments (4)
The app should work fine for multiple faces in the video where the face are being swapped. If it does not, it may mean that one face is not detected. Can you take a look at the length of shapes2D in line 49 of zad2.py? If the result is 1 then one face was not detected. Perhaps it's not very well visible or far from frontal in the video?
from faceswap.
I think zad2.py does capture both faces. However, I would like to choose only 1 face to be swapped. May I ask how I can approach this task?
from faceswap.
If you want something simple, then you can choose the face you want using some conditions on the locations of the face keypoints. You can, for example, do something like this in zad2.py line 49:
face_centroids = np.mean(shapes2D, axis=2)
leftmost_face_idx = np.argmin(shapes2D[:, 0])
shapes2D = [shapes2D[leftmost_face_idx]]
This would only select the face that is furthest on the left. Keep in mind I did not test this code so there might be some small error in it.
from faceswap.
Thanks for your help. I believe faceswap.py in faceforensics repo does something similar for selecting a face if multiple were detected.
from faceswap.
Related Issues (20)
- face moving while blinking HOT 1
- Overlay Transparency HOT 1
- Question mean3DShape HOT 1
- The principle about the algorithms in 'FaceSwap' HOT 1
- Real Time? HOT 1
- RuntimeError: Unable to open ../shape_predictor_68_face_landmarks.dat HOT 1
- Face texture. HOT 5
- google colab HOT 1
- mouth HOT 5
- How to interupt the script? HOT 1
- How to make eye blinking HOT 6
- How can run zad2.py without camera HOT 1
- Face Vibrating HOT 2
- How to create my own candide.npz
- Faces not properly aligned in the final image
- Error with predictor HOT 1
- About gesture control and masks
- cv2.error: OpenCV(4.5.2-dev) :-1: error: (-5:Bad argument) in function 'pointPolygonTest' HOT 3
- face reading 3D...
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.