      images_found = 0
      num_faces_detected = 0
      faces_detected = dict()
      verify_output = False
  
      def __init__(self, subparser, command, description='default'):
          self.create_parser(subparser, command, description)
          self.parse_arguments(description, subparser, command)
 
</s> remove def rotate_image(image, angle):
    ''' Rotates an image by 90, 180 or 270 degrees. Positive for clockwise, negative for 
        counterclockwise '''
    if angle < 0: angle = sum((360, angle))
    if angle == 90:
        image = cv2.flip(cv2.transpose(image),flipCode=1)
    elif angle == 180:
        image = cv2.flip(image,flipCode=-1)
    elif angle == 270:
        image = cv2.flip(cv2.transpose(image),flipCode=0)
    else:
        print('Unsupported image rotation angle: {}. Image unmodified'.format(angle))
    return image
 </s> add # From: https://stackoverflow.com/questions/22041699/rotate-an-image-without-cropping-in-opencv-in-c
def rotate_image(image, angle, rotated_width=None, rotated_height=None):
    height, width = image.shape[:2]
    image_center = (width/2, height/2)
    rotation_matrix = cv2.getRotationMatrix2D(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, rotation_matrix, (rotated_width, rotated_height)) </s> remove                         image = rotate_image(image, face.r * -1)
 </s> add                         image = rotate_image(image, face.r * -1, rotated_width=width, rotated_height=height) </s> remove         if self.arguments.rotate_images.lower() == 'on' and len(process_faces) == 0:
 </s> add         if self.rotation_angles is not None and len(process_faces) == 0:
    rotation_angles = None
      images_found = 0
      num_faces_detected = 0
      faces_detected = dict()
      verify_output = False
    rotation_angles = None
  
      def __init__(self, subparser, command, description='default'):
          self.create_parser(subparser, command, description)
          self.parse_arguments(description, subparser, command)
keep keep keep add keep keep keep keep
 Adds support for arbitrary image rotations (#309)

* Add support for user-specified rotation angle in extract

* Added rotation-angle-list option to enumerate a list of angles to rotate through

* Adjust rotation matrix translation coords to avoid cropping

* Merged rotation-angle and rotation-angle-list options into rotate_images option

* Backwards compatibility

* Updated check whether to run image rotator

* Switched rotation convention to use positive angle = clockwise rotation, for backwards compatibility 
lib/cli.py