  
      def get_center_scale(self, detected_face):
          """ Get the center and set scale of bounding box """
          logger.trace("Calculating center and scale")
          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
  
          logger.trace("Calculated center and scale: %s, %s", center, scale)
          return center, scale
  
      def crop(self, image, center, scale):  # pylint:disable=too-many-locals
 
</s> remove         box = (detected_face.left(), detected_face.top(),
               detected_face.right(), detected_face.bottom())
        diff_height_width = (box[3] - box[1]) - (box[2] - box[0])
 </s> add         box = (detected_face.left, detected_face.top, detected_face.right, detected_face.bottom)
        diff_height_width = detected_face.height - detected_face.width </s> remove         logger.trace("Created from dlib_rectangle: (x: %s, w: %s, y: %s. h: %s)",
 </s> add         logger.trace("Created from BoundingBox: (x: %s, w: %s, y: %s. h: %s)", </s> remove             face_size = ((face.right() - face.left()) ** 2 +
                         (face.bottom() - face.top()) ** 2) ** 0.5
 </s> add             face_size = (face.width ** 2 + face.height ** 2) ** 0.5 </s> remove         Pass in a DetectedFace object, Alignments dict or DLib rectangle"""
 </s> add         Pass in a DetectedFace object, Alignments dict or BoundingBox""" </s> remove     def from_dlib_rect(self, d_rect, image=None):
        """ Set Bounding Box from a Dlib Rectangle """
        logger.trace("Creating from dlib_rectangle: %s", d_rect)
        if not isinstance(d_rect, d_rectangle):
            raise ValueError("Supplied Bounding Box is not a dlib.rectangle.")
        self.x = d_rect.left()
        self.w = d_rect.right() - d_rect.left()
        self.y = d_rect.top()
        self.h = d_rect.bottom() - d_rect.top()
 </s> add     def from_bounding_box(self, bounding_box, image=None):
        """ Set Bounding Box from a BoundingBox """
        logger.trace("Creating from BoundingBox: %s", bounding_box)
        if not isinstance(bounding_box, BoundingBox):
            raise ValueError("Supplied Bounding Box is not a BoundingBox.")
        self.x = bounding_box.left
        self.w = bounding_box.width
        self.y = bounding_box.top
        self.h = bounding_box.height
        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
  
      def get_center_scale(self, detected_face):
          """ Get the center and set scale of bounding box """
          logger.trace("Calculating center and scale")
        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
        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
        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
        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
        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
        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
        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
        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
        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
        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
        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
        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
  
          logger.trace("Calculated center and scale: %s, %s", center, scale)
          return center, scale
  
      def crop(self, image, center, scale):  # pylint:disable=too-many-locals
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Remove dlib.rectangles. Replace with BoundingBox class 
plugins/extract/align/fan.py