Skip to content

Commit 835e31e

Browse files
authored
Merge pull request #48 from UMass-Rescue/fix_gender_accuracy
remove BGR2RGB change results is more accurate age for age_googlenet.onnx
2 parents ad2363f + f7aac68 commit 835e31e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • src/age_and_gender_detection/age_and_gender_detection

src/age_and_gender_detection/age_and_gender_detection/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def faceDetector(self, orig_image, threshold=0.7):
104104
return boxes, labels, probs
105105

106106
def genderClassifier(self, orig_image):
107-
image = cv2.cvtColor(orig_image, cv2.COLOR_BGR2RGB)
107+
image = orig_image.copy()
108108
image = cv2.resize(image, (224, 224))
109109
image_mean = np.array([104, 117, 123])
110110
image = image - image_mean
@@ -118,7 +118,7 @@ def genderClassifier(self, orig_image):
118118
return gender
119119

120120
def ageClassifier(self, orig_image):
121-
image = cv2.cvtColor(orig_image, cv2.COLOR_BGR2RGB)
121+
image = orig_image.copy()
122122
image = cv2.resize(image, (224, 224))
123123
image_mean = np.array([104, 117, 123])
124124
image = image - image_mean

0 commit comments

Comments
 (0)