Created
August 23, 2018 21:35
-
-
Save Hack-My-Life/42db7a7d8ef84bef24d718f725fb31d5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment