MCPcopy Create free account
hub / github.com/NVlabs/SPADE / __scale_width

Function __scale_width

data/base_dataset.py:98–104  ·  view source on GitHub ↗
(img, target_width, method=Image.BICUBIC)

Source from the content-addressed store, hash-verified

96
97
98def __scale_width(img, target_width, method=Image.BICUBIC):
99 ow, oh = img.size
100 if (ow == target_width):
101 return img
102 w = target_width
103 h = int(target_width * oh / ow)
104 return img.resize((w, h), method)
105
106
107def __scale_shortside(img, target_width, method=Image.BICUBIC):

Callers 1

get_transformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected