          From: https://stackoverflow.com/questions/22041699 """
  
      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)
 
</s> remove     return (cv2.warpAffine(image,
 </s> add     return (cv2.warpAffine(image,  # pylint: disable=no-member </s> remove     rotation_matrix = cv2.invertAffineTransform(rotation_matrix)
 </s> add     rotation_matrix = cv2.invertAffineTransform(  # pylint: disable=no-member
        rotation_matrix) </s> remove 
 </s> add             print(unitMask.shape)
            print(new_image.shape)
            print(base_image.shape)
 </s> remove         
        mask_b, mask_g, mask_r = cv2.split(image_mask)
        face_b, face_g, face_r = cv2.split(new_face)

        alpha_mask = numpy.ones(mask_b.shape, dtype=mask_b.dtype) * 50
        alpha_face = numpy.ones(face_b.shape, dtype=face_b.dtype) * 50

        image_mask = cv2.merge((mask_b, mask_g, mask_r, alpha_mask))
        new_face = cv2.merge((face_b, face_g, face_r, alpha_face))
 </s> add         image_mask = add_alpha_channel(image_mask, 100)
        new_face = add_alpha_channel(new_face, 100)

    rotation_matrix = cv2.getRotationMatrix2D(  # pylint: disable=no-member
        image_center, -1.*angle, 1.)
          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)
keep keep keep keep replace keep keep keep keep keep
 add draw transparent to adjust. Disable seamless clone with -dt flag 
lib/utils.py