单幅图像的深度学习,对NYU数据集进行划分

时间:2023-03-08 17:44:54

针对分割问题,官方已经划分好了:http://cs.nyu.edu/~silberman/projects/indoor_scene_seg_sup.html

import numpy as np
import scipy.io as sio

data = sio.loadmat('splits.mat')

train_idx = data['trainNdxs']
test_idx = data['testNdxs']

train_size = len(train_idx)
test_size = len(test_idx)

partitions = [0] * (train_size + test_size)

for i in range(test_size):
	idx = test_idx[i][0]
	partitions[idx - 1] = 1

print partitions