def im_to_numpy(img): img = misc.to_numpy(img) img = np.transpose(img, (1, 2, 0)) # H*W*C return img
def resize_label(img, owidth, oheight): img = misc.to_numpy(img) img = cv2.resize( img, (owidth, oheight), 'nearest' ) img = misc.to_torch(img).float() return img