      def filter_small_faces(self, detected_faces):
          """ Filter out any faces smaller than the min size threshold """
          retval = list()
          for face in detected_faces:
              face_size = ((face.right() - face.left()) ** 2 +
                           (face.bottom() - face.top()) ** 2) ** 0.5
              if face_size < self.min_size:
                  logger.debug("Removing detected face: (face_size: %s, min_size: %s",
                               face_size, self.min_size)
                  continue
              retval.append(face)
 
</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     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 </s> remove         retval = d_rectangle(left, top, right, bottom)
 </s> add         retval = BoundingBox(left, top, right, bottom) </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         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]
            face_size = (face.width ** 2 + face.height ** 2) ** 0.5
      def filter_small_faces(self, detected_faces):
          """ Filter out any faces smaller than the min size threshold """
          retval = list()
          for face in detected_faces:
            face_size = (face.width ** 2 + face.height ** 2) ** 0.5
            face_size = (face.width ** 2 + face.height ** 2) ** 0.5
              if face_size < self.min_size:
                  logger.debug("Removing detected face: (face_size: %s, min_size: %s",
                               face_size, self.min_size)
                  continue
              retval.append(face)
keep keep keep keep replace replace keep keep keep keep keep
 Remove dlib.rectangles. Replace with BoundingBox class 
plugins/extract/detect/_base.py