      def tighten_bounding_box(faces, landmarks):
          """ Tighten the bounding box for Face Alignment.
  
              Face Alignment was built to expect a DLIB bounding
              box and sometimes can't calculate landmarks on edge
              cases. Tightening up the bounding box along the
              longest edge improves it's chances and helps remove
              'jitter' """
          retval = list()
          if len(faces) == 0:
              return retval
          face_landmarks = np.hsplit(landmarks, len(faces))
          for idx, face in enumerate(faces):
 
</s> remove     def tighten_bounding_box(faces, landmarks):
        """ Tighten the bounding box for Face Alignment.
 </s> add     def recalculate_bounding_box(faces, landmarks):
        """ Recalculate the bounding box for Face Alignment. </s> remove         if len(faces) == 0:
 </s> add         no_faces = len(faces)
        if no_faces == 0: </s> remove         face_landmarks = np.hsplit(landmarks, len(faces))
        for idx, face in enumerate(faces):
 </s> add         face_landmarks = np.hsplit(landmarks, no_faces)
        for idx in range(no_faces): </s> remove             boundary = (np.amin(pts[0]), np.amin(pts[1]),
                        np.amax(pts[0]), np.amax(pts[1]))
 </s> add             boundary = [np.amin(pts[0]), np.amin(pts[1]),
                        np.amax(pts[0]), np.amax(pts[1])] </s> remove             len_x, len_y = face[2] - face[0], face[3] - face[1]
            raw = 1 if len_x > len_y else 0 if len_x < len_y else -1
            bounding = list()

            for i in range(4):
                if i % 2 == raw:
                    bounding.append(int(face[i]))
                else:
                    # Reduce bounding box by 75% around landmarks
                    remove = (boundary[i] - face[i]) / 4
                    bounding.append(int(boundary[i] - remove))
 </s> add             pad_x = (boundary[2] - boundary[0]) * 0.5
            pad_y = (boundary[3] - boundary[1]) * 0.5
            box and calculates center and scale based on that.
            Resize the bounding box around features to present
            a better box to Face Alignment. Helps its chances
            on edge cases and helps remove 'jitter' """
      def tighten_bounding_box(faces, landmarks):
          """ Tighten the bounding box for Face Alignment.
  
              Face Alignment was built to expect a DLIB bounding
            box and calculates center and scale based on that.
            Resize the bounding box around features to present
            a better box to Face Alignment. Helps its chances
            on edge cases and helps remove 'jitter' """
            box and calculates center and scale based on that.
            Resize the bounding box around features to present
            a better box to Face Alignment. Helps its chances
            on edge cases and helps remove 'jitter' """
            box and calculates center and scale based on that.
            Resize the bounding box around features to present
            a better box to Face Alignment. Helps its chances
            on edge cases and helps remove 'jitter' """
            box and calculates center and scale based on that.
            Resize the bounding box around features to present
            a better box to Face Alignment. Helps its chances
            on edge cases and helps remove 'jitter' """
          retval = list()
          if len(faces) == 0:
              return retval
          face_landmarks = np.hsplit(landmarks, len(faces))
          for idx, face in enumerate(faces):
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Alignments tool: Extract non-upsized. MTCNN Detector changes (#508)

* Manual alignments: Add progress bars to check task

* Alignments Tool: Extract faces that haven't been upscaled

* MTCNN Update. Center on landmarks 
lib/face_alignment/detectors.py