title: How to get separate face from image?
body: <p>I m working on emotion recognize. Current design could recognize one face. However, multiple faces in one image is only recognized in one  <strong>emotion</strong>.</p>
  
  <p>I tried with for loop to get separate face but the code is throwing error. Help me to get separate face for emotion recognize.</p>
  
  <pre><code>face_detection = cv2.CascadeClassifier('haarcascade_files/haarcascade_frontalface_default.xml')
  emotion_classifier = load_model('_mini_XCEPTION.102-0.66.hdf5', compile=False)
  EMOTIONS = ["angry" ,"disgust","scared", "happy", "sad", "surprised","neutral"]
  
  
  image = cv2.imread('test.jpg')
  
  gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
  
  
  faces = face_detection.detectMultiScale(gray,scaleFactor=1.1,minNeighbors=5,minSize=(30,30),flags=cv2.CASCADE_SCALE_IMAGE)
  </code></pre>
  
  <p><strong>if one face Working fine</strong></p>
  
  <pre><code>if len(faces) == 1:
  print(len(faces), "face Length 1")
  faces = sorted(faces, reverse=True,
                 key=lambda x: (x[2] - x[0]) * (x[3] - x[1]))[0]
  
  (fX, fY, fW, fH) = faces
  
  roi = gray[fY:fY + fH, fX:fX + fW]
  roi = cv2.resize(roi, (64, 64))
  roi = roi.astype("float") / 255.0
  roi = img_to_array(roi)
  roi = np.expand_dims(roi, axis=0)
  #print(type(roi), "roi", len(roi))
  
  preds = emotion_classifier.predict(roi)[0]
  emotion_probability = np.max(preds)
  label = EMOTIONS[preds.argmax()]
  print(label)
  </code></pre>
  
  <p><strong>I tried with loop</strong></p>
  
  <pre><code>for xx in (faces):
  
  xx = sorted(0, reverse=True,
                key=lambda x: (x[2] - x[0]) * (x[3] - x[1]))[0]
  (fX, fY, fW, fH) = xx 
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>key=lambda x: (x[2] - x[0]) * (x[3] - x[1]))[0]
  TypeError: 'int' object is not iterable
  </code></pre>