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