      @staticmethod
      def extracted_to_alignment(extract_data):
          """ Convert Extracted Tuple to Alignments data """
          alignment = dict()
          d_rect, landmarks = extract_data
          alignment["x"] = d_rect.left()
          alignment["w"] = d_rect.right() - d_rect.left()
          alignment["y"] = d_rect.top()
          alignment["h"] = d_rect.bottom() - d_rect.top()
          alignment["landmarksXY"] = landmarks
          return alignment
 
</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         face = face.to_dlib_rect()
 </s> add         face = face.to_bounding_box() </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         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.error("Error initializing FAN. Trying Dlib")
 </s> add             logger.error("Error initializing FAN. Trying CV2-DNN")
        bbox, landmarks = extract_data
        alignment["x"] = bbox.left
        alignment["w"] = bbox.width
        alignment["y"] = bbox.top
        alignment["h"] = bbox.height
      @staticmethod
      def extracted_to_alignment(extract_data):
          """ Convert Extracted Tuple to Alignments data """
          alignment = dict()
        bbox, landmarks = extract_data
        alignment["x"] = bbox.left
        alignment["w"] = bbox.width
        alignment["y"] = bbox.top
        alignment["h"] = bbox.height
        bbox, landmarks = extract_data
        alignment["x"] = bbox.left
        alignment["w"] = bbox.width
        alignment["y"] = bbox.top
        alignment["h"] = bbox.height
        bbox, landmarks = extract_data
        alignment["x"] = bbox.left
        alignment["w"] = bbox.width
        alignment["y"] = bbox.top
        alignment["h"] = bbox.height
        bbox, landmarks = extract_data
        alignment["x"] = bbox.left
        alignment["w"] = bbox.width
        alignment["y"] = bbox.top
        alignment["h"] = bbox.height
        bbox, landmarks = extract_data
        alignment["x"] = bbox.left
        alignment["w"] = bbox.width
        alignment["y"] = bbox.top
        alignment["h"] = bbox.height
          alignment["landmarksXY"] = landmarks
          return alignment
keep keep keep keep replace replace replace replace replace keep keep
 Remove dlib.rectangles. Replace with BoundingBox class 
tools/lib_alignments/jobs_manual.py