import sys import os import torch os.chdir('../') sys.path.append(os.getcwd()) from utils import img from utils import misc data_dir = 'data/__7_challenge/classroom_r360x80_t0.3' in_set = f'{data_dir}/train_depth' out_set = f'{data_dir}/train_depth_low' img_names = os.listdir(in_set) os.chdir(in_set) depthmaps = img.load(img_names) depthmaps = torch.floor((depthmaps * 16)) / 16 misc.create_dir(out_set) os.chdir(out_set) img.save(depthmaps, img_names)