From c09fc43d455715e4e6ac1835952a0cf926f12966 Mon Sep 17 00:00:00 2001 From: Vincent STRAGIER Date: Mon, 5 Jun 2023 12:27:18 +0200 Subject: [PATCH 1/3] Add some comments about the changes. --- deepface/DeepFace.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deepface/DeepFace.py b/deepface/DeepFace.py index a68bd01..a820741 100644 --- a/deepface/DeepFace.py +++ b/deepface/DeepFace.py @@ -297,10 +297,12 @@ def analyze( actions = (actions,) actions = list(actions) - + + # Check if actions have been passed correctly if not actions: raise ValueError("`actions` must be a list of strings.") + # For each action, check if it is valid for action in actions: if action not in ("emotion", "age", "gender", "race"): raise ValueError( From 4ff75ecfc23c7b8aa7c45c0ad324d6529f6b955a Mon Sep 17 00:00:00 2001 From: Vincent STRAGIER Date: Mon, 5 Jun 2023 14:06:10 +0200 Subject: [PATCH 2/3] Remove unwanted changes and fix linting. --- .vscode/settings.json | 4 +--- deepface/DeepFace.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e223550..f5d9a83 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,5 @@ "python.formatting.provider": "black", "python.formatting.blackArgs": ["--line-length=100"], "editor.fontWeight": "normal", - "python.analysis.extraPaths": ["./deepface"], - "stylelint.autoFixOnSave": false, - "standard.autoFixOnSave": false + "python.analysis.extraPaths": ["./deepface"] } diff --git a/deepface/DeepFace.py b/deepface/DeepFace.py index a820741..c430030 100644 --- a/deepface/DeepFace.py +++ b/deepface/DeepFace.py @@ -297,7 +297,7 @@ def analyze( actions = (actions,) actions = list(actions) - + # Check if actions have been passed correctly if not actions: raise ValueError("`actions` must be a list of strings.") From e845c00c24f7c0db6a24899670aa2f3a26797135 Mon Sep 17 00:00:00 2001 From: Vincent STRAGIER Date: Mon, 5 Jun 2023 14:30:19 +0200 Subject: [PATCH 3/3] Partial grammatical uniformisation of `analys**`. --- deepface/DeepFace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deepface/DeepFace.py b/deepface/DeepFace.py index c430030..6671df7 100644 --- a/deepface/DeepFace.py +++ b/deepface/DeepFace.py @@ -234,7 +234,7 @@ def analyze( silent=False, ): """ - This function analyze facial attributes including age, gender, emotion and race. + This function analyses facial attributes including age, gender, emotion and race. In the background, analysis function builds convolutional neural network models to classify age, gender, emotion and race of the input image. @@ -733,7 +733,7 @@ def stream( source: Set this to 0 for access web cam. Otherwise, pass exact video path. - time_threshold (int): how many second analyzed image will be displayed + time_threshold (int): how many second analysed image will be displayed frame_threshold (int): how many frames required to focus on face