in depth_upsampling/dataset.py [0:0]
def load_image(path, shape, is_depth, sky_direction):
img = cv2.imread(path, cv2.IMREAD_UNCHANGED)
if img.shape[:2] != shape:
img = cv2.resize(img, shape[::-1], interpolation=cv2.INTER_NEAREST if is_depth else cv2.INTER_LINEAR)
img = ARKitScenesDataset.rotate_image(img, sky_direction)
if is_depth:
img = expand_channel_dim(np.asarray(img / MILLIMETER_TO_METER, np.float32))
else:
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = image_hwc_to_chw(np.asarray(img, np.float32))
return img