Skip to content

Instantly share code, notes, and snippets.

@Hack-My-Life
Last active August 23, 2018 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hack-My-Life/aabeac3737dd5b61f7ad1576f7e6c664 to your computer and use it in GitHub Desktop.
Save Hack-My-Life/aabeac3737dd5b61f7ad1576f7e6c664 to your computer and use it in GitHub Desktop.
scale_factor = 0.73
def alter_size(mask, percent):
"""Adjust the percent paramater to find the largest
input image size that will work with your dataset
"""
h,w = mask.shape[:2]
return cv2.resize(mask, (int(w * percent), int(h * percent)))
input_img = alter_size(input_img, scale_factor)
style_img = alter_size(style_img, scale_factor)
mask = alter_size(mask, scale_factor)
loose_mask = alter_size(loose_mask, scale_factor)
mask_smth = alter_size(mask_smth, scale_factor)
@Hack-My-Life
Copy link
Author

initial commit

@Hack-My-Life
Copy link
Author

update return statement and doc string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment