Comments (8)
extract_faces is already returning facial area as
face_objs = DeepFace.extract_faces(img)
for face_obj in face_objs:
x = ["facial_area"]["x"]
y = ["facial_area"]["y"]
w = ["facial_area"]["w"]
h = ["facial_area"]["h"]
then, face center point is
face_center = (int(y + h/2), int(x + w/2))
from deepface.
expand_area is also an optional argument and its default value is 0.
i do not think this is a necessary change.
from deepface.
It's right that face center point can be easily obtained in normal cases.
But not in the case I've described (real scenario includes face swapping, if more environmental info is required, expand_percentage need to be a large value). In this case, the calculated face center point using x,y,w,h obtained from extract_faces will not be the same as the real face center point before expanding.
Because in the simple expanding algorithm, if one side reaches image edge, the expanding area will stop increase at that side, but still increase in the opposite side. Thus the face center point will keep on drifting towards the opposite side.
from deepface.
The problem can be resolved by using trial and error method to set a valid expand_percentage value. But in batch processing scenario, it's not possible to adjust expand_percentage for each run.
from deepface.
I limited the facial area with boundaries if it exceeds in purpose. Because I can monitor that using this approach has an impact on facial recognition accuracy. I prefer not to terminate expanding if it exceeds the boundaries.
from deepface.
I see. But I've got a lot of result images from extract_faces with head + neck and chest, even more body part, othertimes maybe small head under lots of sky... Since I have to generate square image from the result images for next step processing, without real face center info, I don't know how to achieve that.
Currently I modified deepface source code to return extra real face center info before expanding, it works quite well.
from deepface.
For different image size, head size, head position, the largest expand_percentage value without changing the face center position is different, this makes single-expand_percentage-for-all method not working.
from deepface.
Customization the source code is fine in your case. But again I do not think that change is required in the source code of the repo.
from deepface.
Related Issues (20)
- [BUG]: issue created with template for test
- Request for support of model conversion like in .onnx or .engine file. HOT 2
- [BUG]: TypeError: unhashable type: 'list' HOT 2
- Fine Tuning Threshold in Face Recognition HOT 1
- New api endpoint HOT 4
- [BUG]: license is not shown in pip package
- Add TFace & Anti-Spoofing models π HOT 3
- Which Billion-Scale Database is the best for Face Recognition Query? HOT 1
- [BUG]: The verify function in gunicorn is unavailable
- [BUG]: <Wrong display of height and width values ββin DeepFace.represent function> HOT 2
- [BUG]: x of facial area left and right eye seems to be swapped since version 0.0.90 HOT 8
- [BUG]: Models ArcFace, Dlib, and others are not working. VGG-Face is the only model working for me HOT 3
- [BUG]: Age of children detected wrong HOT 1
- [BUG]: tensorflow deprecation warning with tf-keras HOT 1
- [FEATURE]: Nix flake deployment mechanism HOT 3
- [FEATURE]: Face Recognition in an image filled with other people HOT 2
- FAU Detection HOT 1
- [BUG]: Intermittent Packet Type Mismatch Error in Long-Term Face Detection with DeepFace and MediaPipe "Graph has errors: Packet type mismatch on a calculator receiving from stream "image": ; Empty packets are not allowed for type: OneOf<::mediapipe::Image, ::mediapipe::ImageFrame, mediapipe::GpuBuffer>" HOT 1
- [More info from find method]: Find method should optionally return full face detection results HOT 3
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 deepface.