      @property
      def reference_interpolators(self):
          """ Return the interpolators for an output face """
          return get_matrix_scaling(self.reference_matrix)
  
  
  class BoundingBox():
      """ Bounding box class """
      def __init__(self, left, top, right, bottom):
          logger.trace("Initializing %s: (left: %s, top: %s, right: %s, bottom: %s)",
                       self.__class__.__name__, left, top, right, bottom)
          self._box = (left, top, right, bottom)
          logger.trace("Initialized %s", self.__class__.__name__)
  
      @property
      def left(self):
          """ Return left point as int """
          return int(round(self._box[0]))
  
      @property
      def top(self):
          """ Return top point as int """
          return int(round(self._box[1]))
  
      @property
      def right(self):
          """ Return right point as int """
          return int(round(self._box[2]))
  
      @property
      def bottom(self):
          """ Return bottom point as int """
          return int(round(self._box[3]))
  
      @property
      def width(self):
          """ Return width of bounding box """
          return self.right - self.left
  
      @property
      def height(self):
          """ Return height of bounding box """
          return self.bottom - self.top
 
</s> remove     def to_bounding_box(self):
        """ Return Bounding Box as BoundingBox """
        left = self.x
        top = self.y
        right = self.x + self.w
        bottom = self.y + self.h
        retval = BoundingBox(left, top, right, bottom)
 </s> add     def to_bounding_box_dict(self):
        """ Return Bounding Box as a bounding box dixt """
        retval = dict(left=self.x, top=self.y, right=self.x + self.w, bottom=self.y + self.h) </s> remove         """ Return the given bounding box in a BoundingBox """
 </s> add         """ Return the given bounding box in a bounding box dict """ </s> remove     def set_predetected(width, height):
        """ Set a BoundingBox for predetected faces """
 </s> add     def to_bounding_box_dict(left, top, right, bottom):
        """ Return a dict for the bounding box """
        return dict(left=int(round(left)),
                    right=int(round(right)),
                    top=int(round(top)),
                    bottom=int(round(bottom)))

    def set_predetected(self, width, height):
        """ Set a bounding box dict for predetected faces """ </s> remove     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> add     def from_bounding_box_dict(self, bounding_box_dict, image=None):
        """ Set Bounding Box from a bounding box dict """
        logger.trace("Creating from bounding box dict: %s", bounding_box_dict)
        if not isinstance(bounding_box_dict, dict):
            raise ValueError("Supplied Bounding Box is not a dictionary.")
        self.x = bounding_box_dict["left"]
        self.w = bounding_box_dict["right"] - bounding_box_dict["left"]
        self.y = bounding_box_dict["top"]
        self.h = bounding_box_dict["bottom"] - bounding_box_dict["top"]
      @property
      def reference_interpolators(self):
          """ Return the interpolators for an output face """
          return get_matrix_scaling(self.reference_matrix)







































keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace
 Bugfix: Extract - Remove BoundingBox object and replace with dict 
lib/faces_detect.py