From f7aac683afc86945d1708c95d010d0e8dbeb43ff Mon Sep 17 00:00:00 2001 From: nb950 Date: Wed, 2 Jul 2025 11:57:02 -0400 Subject: [PATCH] remove BGR2RGB change results is more accurate age for age_googlenet.onnx --- .../age_and_gender_detection/model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/age_and_gender_detection/age_and_gender_detection/model.py b/src/age_and_gender_detection/age_and_gender_detection/model.py index 7ee0f76b..3bdfe48f 100644 --- a/src/age_and_gender_detection/age_and_gender_detection/model.py +++ b/src/age_and_gender_detection/age_and_gender_detection/model.py @@ -104,7 +104,7 @@ def faceDetector(self, orig_image, threshold=0.7): return boxes, labels, probs def genderClassifier(self, orig_image): - image = cv2.cvtColor(orig_image, cv2.COLOR_BGR2RGB) + image = orig_image.copy() image = cv2.resize(image, (224, 224)) image_mean = np.array([104, 117, 123]) image = image - image_mean @@ -118,7 +118,7 @@ def genderClassifier(self, orig_image): return gender def ageClassifier(self, orig_image): - image = cv2.cvtColor(orig_image, cv2.COLOR_BGR2RGB) + image = orig_image.copy() image = cv2.resize(image, (224, 224)) image_mean = np.array([104, 117, 123]) image = image - image_mean