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

Function random_scale

utils/dataloader/dataloader.py:25–33  ·  view source on GitHub ↗
(rgb, gt, modal_x, scales)

Source from the content-addressed store, hash-verified

23
24
25def random_scale(rgb, gt, modal_x, scales):
26 scale = random.choice(scales)
27 sh = int(rgb.shape[0] * scale)
28 sw = int(rgb.shape[1] * scale)
29 rgb = cv2.resize(rgb, (sw, sh), interpolation=cv2.INTER_LINEAR)
30 gt = cv2.resize(gt, (sw, sh), interpolation=cv2.INTER_NEAREST)
31 modal_x = cv2.resize(modal_x, (sw, sh), interpolation=cv2.INTER_LINEAR)
32
33 return rgb, gt, modal_x, scale
34
35
36class TrainPre(object):

Callers 1

__call__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected