MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / random_scale

Function random_scale

utils/transforms.py:105–112  ·  view source on GitHub ↗
(img, gt, scales)

Source from the content-addressed store, hash-verified

103
104
105def random_scale(img, gt, scales):
106 scale = random.choice(scales)
107 sh = int(img.shape[0] * scale)
108 sw = int(img.shape[1] * scale)
109 img = cv2.resize(img, (sw, sh), interpolation=cv2.INTER_LINEAR)
110 gt = cv2.resize(gt, (sw, sh), interpolation=cv2.INTER_NEAREST)
111
112 return img, gt, scale
113
114
115def random_scale_rgbx(img, gt, modal_x, scales):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected