  def rotate_landmarks(face, rotation_matrix):
      # pylint: disable=c-extension-no-member
      """ Rotate the landmarks and bounding box for faces
          found in rotated images.
          Pass in a DetectedFace object, Alignments dict or DLib rectangle"""
      logger.trace("Rotating landmarks: (rotation_matrix: %s, type(face): %s",
                   rotation_matrix, type(face))
      if isinstance(face, DetectedFace):
          bounding_box = [[face.x, face.y],
                          [face.x + face.w, face.y],
 
</s> remove     def rotate_rect(d_rect, rotation_matrix):
        """ Rotate a dlib rect based on the rotation_matrix"""
        logger.trace("Rotating d_rectangle")
        d_rect = rotate_landmarks(d_rect, rotation_matrix)
        return d_rect
 </s> add     def rotate_rect(bounding_box, rotation_matrix):
        """ Rotate a BoundingBox based on the rotation_matrix"""
        logger.trace("Rotating BoundingBox")
        bounding_box = rotate_landmarks(bounding_box, rotation_matrix)
        return bounding_box </s> remove     elif isinstance(face,
                    dlib.rectangle):  # pylint: disable=c-extension-no-member
        bounding_box = [[face.left(), face.top()],
                        [face.right(), face.top()],
                        [face.right(), face.bottom()],
                        [face.left(), face.bottom()]]
 </s> add     elif isinstance(face, BoundingBox):
        bounding_box = [[face.left, face.top],
                        [face.right, face.top],
                        [face.right, face.bottom],
                        [face.left, face.bottom]] </s> remove         faces = [dlib.rectangle(  # pylint: disable=c-extension-no-member
            int(face[0]), int(face[1]), int(face[2]), int(face[3]))
                 for face in faces]
 </s> add         faces = [BoundingBox(face[0], face[1], face[2], face[3]) for face in faces] </s> remove         center = np.array([(detected_face.left()
                            + detected_face.right()) / 2.0,
                           (detected_face.top()
                            + detected_face.bottom()) / 2.0])

        center[1] -= (detected_face.bottom()
                      - detected_face.top()) * 0.12

        scale = (detected_face.right()
                 - detected_face.left()
                 + detected_face.bottom()
                 - detected_face.top()) / self.reference_scale
 </s> add         center = np.array([(detected_face.left + detected_face.right) / 2.0,
                           (detected_face.top + detected_face.bottom) / 2.0])

        center[1] -= detected_face.height * 0.12

        scale = (detected_face.width + detected_face.height) / self.reference_scale </s> remove         """ Return the given bounding box in a dlib rectangle """
 </s> add         """ Return the given bounding box in a BoundingBox """
        Pass in a DetectedFace object, Alignments dict or BoundingBox"""
  def rotate_landmarks(face, rotation_matrix):
      # pylint: disable=c-extension-no-member
      """ Rotate the landmarks and bounding box for faces
          found in rotated images.
        Pass in a DetectedFace object, Alignments dict or BoundingBox"""
      logger.trace("Rotating landmarks: (rotation_matrix: %s, type(face): %s",
                   rotation_matrix, type(face))
      if isinstance(face, DetectedFace):
          bounding_box = [[face.x, face.y],
                          [face.x + face.w, face.y],
keep keep keep keep replace keep keep keep keep keep
 Remove dlib.rectangles. Replace with BoundingBox class 
lib/utils.py