def getGender(self, img):
    faces = opencv_utilities.getFaceFromImage(img)
    for (x, y, width, height) in faces:
        if ((x > 40) and (y > 40)):
            x = (x - 40)
            y = (y - 40)
            width += 40
            height += 40
        crop_img = img[y:(y + height), x:(x + width)]
        crop_img = cv2.resize(crop_img, (64, 64))
        crop_img = (crop_img / 255)
        crop_img = np.expand_dims(crop_img, axis=0)
        text = self.worker.predict(crop_img)
        if (text > 0.6):
            text = 'Man'
        elif (text < 0.6):
            text = 'Woman'
        cv2.rectangle(img, (x, y), ((x + width), (y + height)), (0, 255, 0), 1)
        font = cv2.FONT_HERSHEY_SIMPLEX
        cv2.putText(img, text, (x, y), font, 0.8, (255, 255, 255), 1, cv2.LINE_AA)
def getGender(self, img):
    faces = opencv_utilities.getFaceFromImage(img)
    for (x, y, width, height) in faces:
        if ((x > 40) and (y > 40)):
            x = (x - 40)
            y = (y - 40)
            width += 40
            height += 40
        crop_img = img[y:(y + height), x:(x + width)]
        crop_img = cv2.resize(crop_img, (64, 64))
        crop_img = (crop_img / 255)
        crop_img = np.expand_dims(crop_img, axis=0)
        text = self.worker.predict(crop_img)
        if (text > 0.6):
            text = 'Man'
        elif (text < 0.6):
            text = 'Woman'
        cv2.rectangle(img, (x, y), ((x + width), (y + height)), (0, 255, 0), 1)
        font = cv2.FONT_HERSHEY_SIMPLEX
        cv2.putText(img, text, (x, y), font, 0.8, (255, 255, 255), 1, cv2.LINE_AA)