MCPcopy Create free account
hub / github.com/chenhaoxing/HDNet / __scale_width

Function __scale_width

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

Source from the content-addressed store, hash-verified

116
117
118def __scale_width(img, target_width, method=Image.BICUBIC):
119 ow, oh = img.size
120 if (ow == target_width):
121 return img
122 w = target_width
123 h = int(target_width * oh / ow)
124 return img.resize((w, h), method)
125
126
127def __crop(img, pos, size):

Callers 1

get_transformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected