From e07f62c19d0f9f0d0763d83a43a7a0cffaff208f Mon Sep 17 00:00:00 2001
From: Markus Willman <mpewil@utu.fi>
Date: Sat, 3 Mar 2018 17:24:10 +0200
Subject: [PATCH] fix flag name for opencv 3

---
 client/sbs_client.py                        | 2 +-
 contrib/src/web/emotion_gender_processor.py | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/client/sbs_client.py b/client/sbs_client.py
index 6b477ab..9d32b64 100755
--- a/client/sbs_client.py
+++ b/client/sbs_client.py
@@ -86,7 +86,7 @@ def detectFaces(model, image):
         scaleFactor=1.1,
         minNeighbors=5,
         minSize=(30, 30),
-        flags=cv2.cv.CV_HAAR_SCALE_IMAGE
+        flags=cv2.CASCADE_SCALE_IMAGE
     )
 
 def main(argv):
diff --git a/contrib/src/web/emotion_gender_processor.py b/contrib/src/web/emotion_gender_processor.py
index 20f291a..76ffb0a 100644
--- a/contrib/src/web/emotion_gender_processor.py
+++ b/contrib/src/web/emotion_gender_processor.py
@@ -7,7 +7,6 @@ from keras.models import load_model
 import numpy as np
 
 from utils.datasets import get_labels
-from utils.inference import detect_faces
 from utils.inference import draw_text
 from utils.inference import draw_bounding_box
 from utils.inference import apply_offsets
@@ -51,7 +50,7 @@ class EGProcessor:
             scaleFactor=1.1,
             minNeighbors=5,
             minSize=(30, 30),
-            flags=cv2.cv.CV_HAAR_SCALE_IMAGE
+            flags=cv2.CASCADE_SCALE_IMAGE
         )
 
     def processImage(self, image, result_fname = None, type = 'png', detect_emotion = True):
-- 
GitLab