          raise ValueError("Unsupported face type")
  
      rotation_matrix = cv2.invertAffineTransform(  # pylint: disable=no-member
          rotation_matrix)
      rotated = list()
      for item in (bounding_box, landmarks):
          if not item:
              continue
 
</s> remove def rotate_image_by_angle(image, angle,
                          rotated_width=None, rotated_height=None):
    """ Rotate an image by a given angle.
        From: https://stackoverflow.com/questions/22041699 """

    height, width = image.shape[:2]
    image_center = (width/2, height/2)
    rotation_matrix = cv2.getRotationMatrix2D(  # pylint: disable=no-member
        image_center, -1.*angle, 1.)
    if rotated_width is None or rotated_height is None:
        abs_cos = abs(rotation_matrix[0, 0])
        abs_sin = abs(rotation_matrix[0, 1])
        if rotated_width is None:
            rotated_width = int(height*abs_sin + width*abs_cos)
        if rotated_height is None:
            rotated_height = int(height*abs_cos + width*abs_sin)
    rotation_matrix[0, 2] += rotated_width/2 - image_center[0]
    rotation_matrix[1, 2] += rotated_height/2 - image_center[1]
    return (cv2.warpAffine(image,  # pylint: disable=no-member
                           rotation_matrix,
                           (rotated_width, rotated_height)),
            rotation_matrix)


 </s> add  </s> remove         for face in detected_faces:
            if not self.filter.check(face):
                if self.verbose:
                    print("Skipping not recognized face!")
 </s> add         for idx, detected_face in enumerate(output_item["detected_faces"]):
            if not self.filter.check(detected_face["face"]):
                logger.verbose("Skipping not recognized face! Frame: %s Face %s",
                               detected_face["file_location"].parts[-1], idx) </s> remove             # pylint: disable=no-member
            cv2.imwrite(out_filename, resized_face)
 </s> add             logger.trace("Saving face: '%s'", out_filename)
            try:
                cv2.imwrite(out_filename, resized_face)  # pylint: disable=no-member
            except Exception as err:  # pylint: disable=broad-except
                logger.error("Failed to save image '%s'. Original Error: %s", out_filename, err)
                continue
        logger.debug("Save Faces: Complete") </s> remove             item = self.queues["in"].get()
 </s> add             item = self.get_item() </s> remove             bounding_box = [dlib.rectangle(int(face[0]), int(face[1]),
                                           int(face[2]), int(face[3]))]
            retval = {"image": image,
                      "detected_faces": bounding_box}
            self.finalize(retval)
 </s> add             bounding_box = [dlib.rectangle(  # pylint: disable=c-extension-no-member
                int(face[0]), int(face[1]), int(face[2]), int(face[3]))]
            item["detected_faces"] = bounding_box
            self.finalize(item)
    logger.trace("Original landmarks: %s", landmarks)

          raise ValueError("Unsupported face type")
  
    logger.trace("Original landmarks: %s", landmarks)

      rotation_matrix = cv2.invertAffineTransform(  # pylint: disable=no-member
          rotation_matrix)
      rotated = list()
      for item in (bounding_box, landmarks):
          if not item:
              continue
keep add keep keep keep keep keep keep
 Logging (#541)

* Convert prints to logger. Further logging improvements. Tidy  up

* Fix system verbosity. Allow SystemExit

* Fix reload extract bug

* Child Traceback handling

* Safer shutdown procedure

* Add shutdown event to queue manager

* landmarks_as_xy > property. GUI notes + linting. Aligner bugfix

* fix FaceFilter. Enable nFilter when no Filter is supplied

* Fix blurry face filter

* Continue on IO error. Better error handling

* Explicitly print stack trace tocrash log

* Windows Multiprocessing bugfix

* Add git info and conda version to crash log

* Windows/Anaconda mp bugfix

* Logging fixes for training 
lib/utils.py