Comments (7)
Good spot. If we add the normalization name into the pickle file, then this will be sorted easily.
similarly, expand_percentage, align arguments have an impact on representations but these are also discarded, too. these should be added into the file name.
from deepface.
`expand_percentage" does not have an impact on representations as those are constrained by fixed size input by each model. I don't think is relevant.
More relevant instead the "align" argument.
from deepface.
that is another bug. we should consider expand_percentage while we are finding bulk embeddings here - https://github.com/serengil/deepface/blob/master/deepface/modules/recognition.py#L173
from deepface.
that is another bug. we should consider expand_percentage while we are finding bulk embeddings here - https://github.com/serengil/deepface/blob/master/deepface/modules/recognition.py#L173
I don't think. Expansion of a facial area doesn't have any impact on representation.
But as you wish ... I only signalled a condition. Won't spend more time on this.
from deepface.
Expand percentage has definitely an impact on embeddings.
from deepface import DeepFace
img_path = "target.jpg"
DeepFace.represent(img_path=img_path, model_name="Facenet")[0]["embedding"][0:10]
DeepFace.represent(img_path=img_path, model_name="Facenet", expand_percentage=10)[0]["embedding"][0:10]
You can see the representation of same image with different expand_percentage values.
[0.47962263226509094,
1.0006622076034546,
1.0271168947219849,
-0.6997617483139038,
0.5685179233551025,
-0.8650573492050171,
1.301469087600708,
0.4709436297416687,
0.6177820563316345,
1.1736094951629639]
[0.07209590077400208,
1.220704197883606,
1.0250455141067505,
-1.0584845542907715,
0.7029904723167419,
-0.8850963711738586,
0.9492990970611572,
0.7604453563690186,
0.7631895542144775,
0.7458571791648865]
from deepface.
I'll try to eplain: for me the usage and the meaning of expand_percentage
is totally off and it should not even apply.
There are multiple reasons:
- Each detector has its own ways to define a face bounding box: some more squared some more rectangular. But they have one thing in common: the boundaries of the bounding box are exactly what are meant to be the boundaries of a detected face
expand_dims
increases the boundaries of such facial area potentially including portions of the image which have nothing to do with the face- embeddings are always computed on a fixed size (each model has its own) input shape which means two things: 1) the wider (the more expanded facial area) the more CPU costs to resize the image and 2) the more "noise" around the face the more the embeddings get apart
Expand percentage has definitely an impact on embeddings.
Of course ... if you expand the facial area the resized input for the model receives a "smaller face" hence different embeddings
Long story short : imo expand_percentage
introduces a distortion argument which tampers with detections and embeddings.
I only think it could be useful for visualization purposes : hence I completely removed it in my fork and won't reason again on it.
from deepface.
Closed with PR - #1185
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
- [FEATURE]: extract_faces return face center point info or stop further enlargement if face center point can't be kept at image center HOT 8
- [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 2
- [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.