Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/batch predict age and gender #1396

Merged
merged 66 commits into from
Feb 16, 2025
Merged
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
c42df04
[update] add batch predicting for Age model
NatLee Dec 5, 2024
a4b1b5d
[update] add batch predicting for Gender model
NatLee Dec 5, 2024
b55cb31
[fix] name of model attributes `inputs`
NatLee Dec 6, 2024
29c818d
[fix] line too long
NatLee Dec 6, 2024
27e8fc9
[update] enhance predict methods to support single and batch inputs f…
NatLee Dec 17, 2024
38c0652
[update] enhance predict methods in Emotion and Race models to suppor…
NatLee Dec 17, 2024
b9418eb
[fix] `input` to `inputs`
NatLee Dec 17, 2024
d992428
[update] embed into deepface module
NatLee Dec 17, 2024
e96ede3
[update] add multiple faces testing
NatLee Dec 17, 2024
e1417a0
Update master branch. Merge branch 'master' into feat/batch-predict-a…
h-alice Dec 31, 2024
f8be282
Update master branch. Merge branch 'master' into feat/merge-predicts-…
h-alice Dec 31, 2024
9f3875e
Update master branch. Merge branch 'master' into feat/make-Race-and-E…
h-alice Dec 31, 2024
9c079e9
Merge branch 'feat/batch-predict-age-and-gender' into feat/merge-pred…
h-alice Dec 31, 2024
bba4322
Merge branch 'feat/merge-predicts-functions' into feat/make-Race-and-…
h-alice Dec 31, 2024
4cf43be
Merge pull request #4 from NatLee/feat/add-multi-face-test
NatLee Dec 31, 2024
05dbc80
Merge pull request #2 from NatLee/feat/make-Race-and-Emotion-batch
NatLee Dec 31, 2024
c312684
Merge pull request #1 from NatLee/feat/merge-predicts-functions
NatLee Dec 31, 2024
ffbba7f
Change base class's predict signature.
h-alice Dec 31, 2024
edcef02
[update] remove dummy functions
NatLee Dec 31, 2024
472f146
Avoid recreating `resp_objects`.
h-alice Jan 3, 2025
b69dcfc
Engineering stuff, remove redundant code.
h-alice Jan 3, 2025
0f65a87
Add assertion to verify length of analyzed objects.
h-alice Jan 3, 2025
bb820a7
[update] one-line checking
NatLee Jan 3, 2025
e182285
Fix: Image batch dimension not expanded.
h-alice Jan 3, 2025
69267cd
Merge pull request #5 from NatLee/patch/test-250103
h-alice Jan 3, 2025
5747d96
Predictor.
h-alice Jan 6, 2025
5a18814
Add comment.
h-alice Jan 6, 2025
72b94d1
Add new predictor.
h-alice Jan 6, 2025
c647488
Merge remote-tracking branch 'origin/feat/batch-predict-age-and-gende…
NatLee Jan 6, 2025
e668cd4
Merge remote-tracking branch 'origin/master' into patch/adjustment-01…
NatLee Jan 6, 2025
85e2d8d
[update] modify comment for multi models
NatLee Jan 6, 2025
ba0d0c5
[update] make process to one-line
NatLee Jan 6, 2025
29141b3
[update] add hint for the shape of input img
NatLee Jan 6, 2025
36fb512
[fix] handle between grayscale and RGB image for models
NatLee Jan 6, 2025
431544a
[update] add process for single and multiple image
NatLee Jan 6, 2025
0417732
[fix] model input size -> (n, w, h, c)
NatLee Jan 6, 2025
c44af00
[fix] check for input number of faces
NatLee Jan 6, 2025
ad577b4
[update] refactor response object creation in analyze function
NatLee Jan 6, 2025
52a38ba
[fix] use prediction shape to avoid confuse situation of predictions
NatLee Jan 6, 2025
ba8c651
[fix] 1 img input for the `Emotion` model
NatLee Jan 6, 2025
4284252
Remove obsolete comment.
h-alice Jan 7, 2025
eb7b841
Documentation
h-alice Jan 13, 2025
688fbe6
[fix] lint
NatLee Jan 13, 2025
a442f7a
Merge remote-tracking branch 'origin/master' into patch/adjustment-01…
NatLee Jan 13, 2025
8883b21
Merge pull request #6 from NatLee/patch/adjustment-0103-1
h-alice Jan 13, 2025
fa4044a
patch: Greyscale image prediction condition.
h-alice Jan 13, 2025
910d6e1
patch: fix dimension.
h-alice Jan 13, 2025
72b6db1
patch: fix dimension
h-alice Jan 13, 2025
a23893a
patch: emotion dimension.
h-alice Jan 13, 2025
da4a0c5
patch: Lint
h-alice Jan 14, 2025
c72b474
[update] lint
NatLee Jan 14, 2025
7e719df
Patch: Make Age model capable to handle single or batched input.
h-alice Jan 16, 2025
6a7bbdb
REVERT demography.py
h-alice Jan 16, 2025
6a8d1d9
patch: Lint
h-alice Jan 16, 2025
0d7e151
[update] rm `print`
NatLee Jan 16, 2025
0971fcd
Merge commit '0d7e15147f527edc0ef09dadbd73f38d87972d1f' into feat/bat…
NatLee Jan 16, 2025
db4b749
[update] add emotions batch test
NatLee Jan 20, 2025
95bb92c
Remove redundant squeeze.
h-alice Jan 21, 2025
61b6931
[update] modify test of `emotion` and add client of `age`, `gender` a…
NatLee Jan 21, 2025
6df7b7d
Add support for batched input.
h-alice Jan 22, 2025
b584d29
Refine some tests.
h-alice Jan 22, 2025
ee3093d
Merge branch 'feat/batch-predict-age-and-gender' of https://github.co…
h-alice Jan 22, 2025
4d77931
Merge remote-tracking branch 'origin/master' into feat/batch-predict-…
NatLee Jan 25, 2025
0ab3ac2
[fix] avoid problem of precision in float
NatLee Jan 25, 2025
29b29c4
Merge remote-tracking branch 'origin/master' into feat/batch-predict-…
NatLee Feb 14, 2025
01f872d
[update] mv control logic to `demography`
NatLee Feb 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[update] one-line checking
  • Loading branch information
NatLee committed Jan 3, 2025
commit bb820a7ef4ba5c146089f6086035474d3b1097ed
6 changes: 2 additions & 4 deletions deepface/modules/demography.py
Original file line number Diff line number Diff line change
@@ -131,10 +131,8 @@ def analyze(
)

# Anti-spoofing check
if anti_spoofing:
for img_obj in img_objs:
if img_obj.get("is_real", True) is False:
raise ValueError("Spoof detected in the given image.")
if anti_spoofing and any(img_obj.get("is_real", True) is False for img_obj in img_objs):
raise ValueError("Spoof detected in the given image.")

# Prepare the input for the model
valid_faces = []