From 2add62d1452657efd9bcf74aab4307aff0682194 Mon Sep 17 00:00:00 2001 From: Yongbin Sun Date: Sun, 4 Feb 2018 13:36:20 -0500 Subject: [PATCH] Initial commit for semantic segmentation --- sem_seg/collect_indoor3d_data.py | 23 ++ sem_seg/download_data.sh | 6 + sem_seg/indoor3d_util.py | 591 ++++++++++++++++++++++++++++++ sem_seg/meta/all_data_label.txt | 272 ++++++++++++++ sem_seg/meta/anno_paths.txt | 272 ++++++++++++++ sem_seg/meta/area1_data_label.txt | 44 +++ sem_seg/meta/area2_data_label.txt | 40 ++ sem_seg/meta/area3_data_label.txt | 23 ++ sem_seg/meta/area4_data_label.txt | 49 +++ sem_seg/meta/area5_data_label.txt | 68 ++++ sem_seg/meta/area6_data_label.txt | 48 +++ sem_seg/meta/class_names.txt | 13 + 12 files changed, 1449 insertions(+) create mode 100644 sem_seg/collect_indoor3d_data.py create mode 100644 sem_seg/download_data.sh create mode 100644 sem_seg/indoor3d_util.py create mode 100644 sem_seg/meta/all_data_label.txt create mode 100644 sem_seg/meta/anno_paths.txt create mode 100644 sem_seg/meta/area1_data_label.txt create mode 100644 sem_seg/meta/area2_data_label.txt create mode 100644 sem_seg/meta/area3_data_label.txt create mode 100644 sem_seg/meta/area4_data_label.txt create mode 100644 sem_seg/meta/area5_data_label.txt create mode 100644 sem_seg/meta/area6_data_label.txt create mode 100644 sem_seg/meta/class_names.txt diff --git a/sem_seg/collect_indoor3d_data.py b/sem_seg/collect_indoor3d_data.py new file mode 100644 index 0000000..a1bdadc --- /dev/null +++ b/sem_seg/collect_indoor3d_data.py @@ -0,0 +1,23 @@ +import os +import sys +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) +ROOT_DIR = os.path.dirname(BASE_DIR) +sys.path.append(BASE_DIR) +import indoor3d_util + +anno_paths = [line.rstrip() for line in open(os.path.join(BASE_DIR, 'meta/anno_paths.txt'))] +anno_paths = [os.path.join(indoor3d_util.DATA_PATH, p) for p in anno_paths] + +output_folder = os.path.join(ROOT_DIR, 'data/stanford_indoor3d') +if not os.path.exists(output_folder): + os.mkdir(output_folder) + +# Note: there is an extra character in the v1.2 data in Area_5/hallway_6. It's fixed manually. +for anno_path in anno_paths: + print(anno_path) + try: + elements = anno_path.split('/') + out_filename = elements[-3]+'_'+elements[-2]+'.npy' + indoor3d_util.collect_point_label(anno_path, os.path.join(output_folder, out_filename), 'numpy') + except: + print(anno_path, 'ERROR!!') diff --git a/sem_seg/download_data.sh b/sem_seg/download_data.sh new file mode 100644 index 0000000..f38fdf9 --- /dev/null +++ b/sem_seg/download_data.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# Download HDF5 for indoor 3d semantic segmentation (around 1.6GB) +wget https://shapenet.cs.stanford.edu/media/indoor3d_sem_seg_hdf5_data.zip +unzip indoor3d_sem_seg_hdf5_data.zip +rm indoor3d_sem_seg_hdf5_data.zip \ No newline at end of file diff --git a/sem_seg/indoor3d_util.py b/sem_seg/indoor3d_util.py new file mode 100644 index 0000000..78b7336 --- /dev/null +++ b/sem_seg/indoor3d_util.py @@ -0,0 +1,591 @@ +import numpy as np +import glob +import os +import sys +BASE_DIR = os.path.dirname(os.path.abspath(__file__)) +ROOT_DIR = os.path.dirname(BASE_DIR) +sys.path.append(BASE_DIR) + +# ----------------------------------------------------------------------------- +# CONSTANTS +# ----------------------------------------------------------------------------- + +DATA_PATH = os.path.join(ROOT_DIR, 'data', 'Stanford3dDataset_v1.2_Aligned_Version') +g_classes = [x.rstrip() for x in open(os.path.join(BASE_DIR, 'meta/class_names.txt'))] +g_class2label = {cls: i for i,cls in enumerate(g_classes)} +g_class2color = {'ceiling': [0,255,0], + 'floor': [0,0,255], + 'wall': [0,255,255], + 'beam': [255,255,0], + 'column': [255,0,255], + 'window': [100,100,255], + 'door': [200,200,100], + 'table': [170,120,200], + 'chair': [255,0,0], + 'sofa': [200,100,100], + 'bookcase': [10,200,100], + 'board': [200,200,200], + 'clutter': [50,50,50]} +g_easy_view_labels = [7,8,9,10,11,1] +g_label2color = {g_classes.index(cls): g_class2color[cls] for cls in g_classes} + + +# ----------------------------------------------------------------------------- +# CONVERT ORIGINAL DATA TO OUR DATA_LABEL FILES +# ----------------------------------------------------------------------------- + +def collect_point_label(anno_path, out_filename, file_format='txt'): + """ Convert original dataset files to data_label file (each line is XYZRGBL). + We aggregated all the points from each instance in the room. + + Args: + anno_path: path to annotations. e.g. Area_1/office_2/Annotations/ + out_filename: path to save collected points and labels (each line is XYZRGBL) + file_format: txt or numpy, determines what file format to save. + Returns: + None + Note: + the points are shifted before save, the most negative point is now at origin. + """ + points_list = [] + + for f in glob.glob(os.path.join(anno_path, '*.txt')): + cls = os.path.basename(f).split('_')[0] + if cls not in g_classes: # note: in some room there is 'staris' class.. + cls = 'clutter' + points = np.loadtxt(f) + labels = np.ones((points.shape[0],1)) * g_class2label[cls] + points_list.append(np.concatenate([points, labels], 1)) # Nx7 + + + data_label = np.concatenate(points_list, 0) + xyz_min = np.amin(data_label, axis=0)[0:3] + data_label[:, 0:3] -= xyz_min + + if file_format=='txt': + fout = open(out_filename, 'w') + for i in range(data_label.shape[0]): + fout.write('%f %f %f %d %d %d %d\n' % \ + (data_label[i,0], data_label[i,1], data_label[i,2], + data_label[i,3], data_label[i,4], data_label[i,5], + data_label[i,6])) + fout.close() + elif file_format=='numpy': + np.save(out_filename, data_label) + else: + print('ERROR!! Unknown file format: %s, please use txt or numpy.' % \ + (file_format)) + exit() + +def point_label_to_obj(input_filename, out_filename, label_color=True, easy_view=False, no_wall=False): + """ For visualization of a room from data_label file, + input_filename: each line is X Y Z R G B L + out_filename: OBJ filename, + visualize input file by coloring point with label color + easy_view: only visualize furnitures and floor + """ + data_label = np.loadtxt(input_filename) + data = data_label[:, 0:6] + label = data_label[:, -1].astype(int) + fout = open(out_filename, 'w') + for i in range(data.shape[0]): + color = g_label2color[label[i]] + if easy_view and (label[i] not in g_easy_view_labels): + continue + if no_wall and ((label[i] == 2) or (label[i]==0)): + continue + if label_color: + fout.write('v %f %f %f %d %d %d\n' % \ + (data[i,0], data[i,1], data[i,2], color[0], color[1], color[2])) + else: + fout.write('v %f %f %f %d %d %d\n' % \ + (data[i,0], data[i,1], data[i,2], data[i,3], data[i,4], data[i,5])) + fout.close() + + + +# ----------------------------------------------------------------------------- +# PREPARE BLOCK DATA FOR DEEPNETS TRAINING/TESTING +# ----------------------------------------------------------------------------- + +def sample_data(data, num_sample): + """ data is in N x ... + we want to keep num_samplexC of them. + if N > num_sample, we will randomly keep num_sample of them. + if N < num_sample, we will randomly duplicate samples. + """ + N = data.shape[0] + if (N == num_sample): + return data, range(N) + elif (N > num_sample): + sample = np.random.choice(N, num_sample) + return data[sample, ...], sample + else: + sample = np.random.choice(N, num_sample-N) + dup_data = data[sample, ...] + return np.concatenate([data, dup_data], 0), range(N)+list(sample) + +def sample_data_label(data, label, num_sample): + new_data, sample_indices = sample_data(data, num_sample) + new_label = label[sample_indices] + return new_data, new_label + +def room2blocks(data, label, num_point, block_size=1.0, stride=1.0, + random_sample=False, sample_num=None, sample_aug=1): + """ Prepare block training data. + Args: + data: N x 6 numpy array, 012 are XYZ in meters, 345 are RGB in [0,1] + assumes the data is shifted (min point is origin) and aligned + (aligned with XYZ axis) + label: N size uint8 numpy array from 0-12 + num_point: int, how many points to sample in each block + block_size: float, physical size of the block in meters + stride: float, stride for block sweeping + random_sample: bool, if True, we will randomly sample blocks in the room + sample_num: int, if random sample, how many blocks to sample + [default: room area] + sample_aug: if random sample, how much aug + Returns: + block_datas: K x num_point x 6 np array of XYZRGB, RGB is in [0,1] + block_labels: K x num_point x 1 np array of uint8 labels + + TODO: for this version, blocking is in fixed, non-overlapping pattern. + """ + assert(stride<=block_size) + + limit = np.amax(data, 0)[0:3] + + # Get the corner location for our sampling blocks + xbeg_list = [] + ybeg_list = [] + if not random_sample: + num_block_x = int(np.ceil((limit[0] - block_size) / stride)) + 1 + num_block_y = int(np.ceil((limit[1] - block_size) / stride)) + 1 + for i in range(num_block_x): + for j in range(num_block_y): + xbeg_list.append(i*stride) + ybeg_list.append(j*stride) + else: + num_block_x = int(np.ceil(limit[0] / block_size)) + num_block_y = int(np.ceil(limit[1] / block_size)) + if sample_num is None: + sample_num = num_block_x * num_block_y * sample_aug + for _ in range(sample_num): + xbeg = np.random.uniform(-block_size, limit[0]) + ybeg = np.random.uniform(-block_size, limit[1]) + xbeg_list.append(xbeg) + ybeg_list.append(ybeg) + + # Collect blocks + block_data_list = [] + block_label_list = [] + idx = 0 + for idx in range(len(xbeg_list)): + xbeg = xbeg_list[idx] + ybeg = ybeg_list[idx] + xcond = (data[:,0]<=xbeg+block_size) & (data[:,0]>=xbeg) + ycond = (data[:,1]<=ybeg+block_size) & (data[:,1]>=ybeg) + cond = xcond & ycond + if np.sum(cond) < 100: # discard block if there are less than 100 pts. + continue + + block_data = data[cond, :] + block_label = label[cond] + + # randomly subsample data + block_data_sampled, block_label_sampled = \ + sample_data_label(block_data, block_label, num_point) + block_data_list.append(np.expand_dims(block_data_sampled, 0)) + block_label_list.append(np.expand_dims(block_label_sampled, 0)) + + return np.concatenate(block_data_list, 0), \ + np.concatenate(block_label_list, 0) + + +def room2blocks_plus(data_label, num_point, block_size, stride, + random_sample, sample_num, sample_aug): + """ room2block with input filename and RGB preprocessing. + """ + data = data_label[:,0:6] + data[:,3:6] /= 255.0 + label = data_label[:,-1].astype(np.uint8) + + return room2blocks(data, label, num_point, block_size, stride, + random_sample, sample_num, sample_aug) + +def room2blocks_wrapper(data_label_filename, num_point, block_size=1.0, stride=1.0, + random_sample=False, sample_num=None, sample_aug=1): + if data_label_filename[-3:] == 'txt': + data_label = np.loadtxt(data_label_filename) + elif data_label_filename[-3:] == 'npy': + data_label = np.load(data_label_filename) + else: + print('Unknown file type! exiting.') + exit() + return room2blocks_plus(data_label, num_point, block_size, stride, + random_sample, sample_num, sample_aug) + +def room2blocks_plus_normalized(data_label, num_point, block_size, stride, + random_sample, sample_num, sample_aug): + """ room2block, with input filename and RGB preprocessing. + for each block centralize XYZ, add normalized XYZ as 678 channels + """ + data = data_label[:,0:6] + data[:,3:6] /= 255.0 + label = data_label[:,-1].astype(np.uint8) + max_room_x = max(data[:,0]) + max_room_y = max(data[:,1]) + max_room_z = max(data[:,2]) + + data_batch, label_batch = room2blocks(data, label, num_point, block_size, stride, + random_sample, sample_num, sample_aug) + new_data_batch = np.zeros((data_batch.shape[0], num_point, 9)) + for b in range(data_batch.shape[0]): + new_data_batch[b, :, 6] = data_batch[b, :, 0]/max_room_x + new_data_batch[b, :, 7] = data_batch[b, :, 1]/max_room_y + new_data_batch[b, :, 8] = data_batch[b, :, 2]/max_room_z + minx = min(data_batch[b, :, 0]) + miny = min(data_batch[b, :, 1]) + data_batch[b, :, 0] -= (minx+block_size/2) + data_batch[b, :, 1] -= (miny+block_size/2) + new_data_batch[:, :, 0:6] = data_batch + return new_data_batch, label_batch + + +def room2blocks_wrapper_normalized(data_label_filename, num_point, block_size=1.0, stride=1.0, + random_sample=False, sample_num=None, sample_aug=1): + if data_label_filename[-3:] == 'txt': + data_label = np.loadtxt(data_label_filename) + elif data_label_filename[-3:] == 'npy': + data_label = np.load(data_label_filename) + else: + print('Unknown file type! exiting.') + exit() + return room2blocks_plus_normalized(data_label, num_point, block_size, stride, + random_sample, sample_num, sample_aug) + +def room2samples(data, label, sample_num_point): + """ Prepare whole room samples. + + Args: + data: N x 6 numpy array, 012 are XYZ in meters, 345 are RGB in [0,1] + assumes the data is shifted (min point is origin) and + aligned (aligned with XYZ axis) + label: N size uint8 numpy array from 0-12 + sample_num_point: int, how many points to sample in each sample + Returns: + sample_datas: K x sample_num_point x 9 + numpy array of XYZRGBX'Y'Z', RGB is in [0,1] + sample_labels: K x sample_num_point x 1 np array of uint8 labels + """ + N = data.shape[0] + order = np.arange(N) + np.random.shuffle(order) + data = data[order, :] + label = label[order] + + batch_num = int(np.ceil(N / float(sample_num_point))) + sample_datas = np.zeros((batch_num, sample_num_point, 6)) + sample_labels = np.zeros((batch_num, sample_num_point, 1)) + + for i in range(batch_num): + beg_idx = i*sample_num_point + end_idx = min((i+1)*sample_num_point, N) + num = end_idx - beg_idx + sample_datas[i,0:num,:] = data[beg_idx:end_idx, :] + sample_labels[i,0:num,0] = label[beg_idx:end_idx] + if num < sample_num_point: + makeup_indices = np.random.choice(N, sample_num_point - num) + sample_datas[i,num:,:] = data[makeup_indices, :] + sample_labels[i,num:,0] = label[makeup_indices] + return sample_datas, sample_labels + +def room2samples_plus_normalized(data_label, num_point): + """ room2sample, with input filename and RGB preprocessing. + for each block centralize XYZ, add normalized XYZ as 678 channels + """ + data = data_label[:,0:6] + data[:,3:6] /= 255.0 + label = data_label[:,-1].astype(np.uint8) + max_room_x = max(data[:,0]) + max_room_y = max(data[:,1]) + max_room_z = max(data[:,2]) + #print(max_room_x, max_room_y, max_room_z) + + data_batch, label_batch = room2samples(data, label, num_point) + new_data_batch = np.zeros((data_batch.shape[0], num_point, 9)) + for b in range(data_batch.shape[0]): + new_data_batch[b, :, 6] = data_batch[b, :, 0]/max_room_x + new_data_batch[b, :, 7] = data_batch[b, :, 1]/max_room_y + new_data_batch[b, :, 8] = data_batch[b, :, 2]/max_room_z + #minx = min(data_batch[b, :, 0]) + #miny = min(data_batch[b, :, 1]) + #data_batch[b, :, 0] -= (minx+block_size/2) + #data_batch[b, :, 1] -= (miny+block_size/2) + new_data_batch[:, :, 0:6] = data_batch + return new_data_batch, label_batch + + +def room2samples_wrapper_normalized(data_label_filename, num_point): + if data_label_filename[-3:] == 'txt': + data_label = np.loadtxt(data_label_filename) + elif data_label_filename[-3:] == 'npy': + data_label = np.load(data_label_filename) + else: + print('Unknown file type! exiting.') + exit() + return room2samples_plus_normalized(data_label, num_point) + + +# ----------------------------------------------------------------------------- +# EXTRACT INSTANCE BBOX FROM ORIGINAL DATA (for detection evaluation) +# ----------------------------------------------------------------------------- + +def collect_bounding_box(anno_path, out_filename): + """ Compute bounding boxes from each instance in original dataset files on + one room. **We assume the bbox is aligned with XYZ coordinate.** + + Args: + anno_path: path to annotations. e.g. Area_1/office_2/Annotations/ + out_filename: path to save instance bounding boxes for that room. + each line is x1 y1 z1 x2 y2 z2 label, + where (x1,y1,z1) is the point on the diagonal closer to origin + Returns: + None + Note: + room points are shifted, the most negative point is now at origin. + """ + bbox_label_list = [] + + for f in glob.glob(os.path.join(anno_path, '*.txt')): + cls = os.path.basename(f).split('_')[0] + if cls not in g_classes: # note: in some room there is 'staris' class.. + cls = 'clutter' + points = np.loadtxt(f) + label = g_class2label[cls] + # Compute tightest axis aligned bounding box + xyz_min = np.amin(points[:, 0:3], axis=0) + xyz_max = np.amax(points[:, 0:3], axis=0) + ins_bbox_label = np.expand_dims( + np.concatenate([xyz_min, xyz_max, np.array([label])], 0), 0) + bbox_label_list.append(ins_bbox_label) + + bbox_label = np.concatenate(bbox_label_list, 0) + room_xyz_min = np.amin(bbox_label[:, 0:3], axis=0) + bbox_label[:, 0:3] -= room_xyz_min + bbox_label[:, 3:6] -= room_xyz_min + + fout = open(out_filename, 'w') + for i in range(bbox_label.shape[0]): + fout.write('%f %f %f %f %f %f %d\n' % \ + (bbox_label[i,0], bbox_label[i,1], bbox_label[i,2], + bbox_label[i,3], bbox_label[i,4], bbox_label[i,5], + bbox_label[i,6])) + fout.close() + +def bbox_label_to_obj(input_filename, out_filename_prefix, easy_view=False): + """ Visualization of bounding boxes. + + Args: + input_filename: each line is x1 y1 z1 x2 y2 z2 label + out_filename_prefix: OBJ filename prefix, + visualize object by g_label2color + easy_view: if True, only visualize furniture and floor + Returns: + output a list of OBJ file and MTL files with the same prefix + """ + bbox_label = np.loadtxt(input_filename) + bbox = bbox_label[:, 0:6] + label = bbox_label[:, -1].astype(int) + v_cnt = 0 # count vertex + ins_cnt = 0 # count instance + for i in range(bbox.shape[0]): + if easy_view and (label[i] not in g_easy_view_labels): + continue + obj_filename = out_filename_prefix+'_'+g_classes[label[i]]+'_'+str(ins_cnt)+'.obj' + mtl_filename = out_filename_prefix+'_'+g_classes[label[i]]+'_'+str(ins_cnt)+'.mtl' + fout_obj = open(obj_filename, 'w') + fout_mtl = open(mtl_filename, 'w') + fout_obj.write('mtllib %s\n' % (os.path.basename(mtl_filename))) + + length = bbox[i, 3:6] - bbox[i, 0:3] + a = length[0] + b = length[1] + c = length[2] + x = bbox[i, 0] + y = bbox[i, 1] + z = bbox[i, 2] + color = np.array(g_label2color[label[i]], dtype=float) / 255.0 + + material = 'material%d' % (ins_cnt) + fout_obj.write('usemtl %s\n' % (material)) + fout_obj.write('v %f %f %f\n' % (x,y,z+c)) + fout_obj.write('v %f %f %f\n' % (x,y+b,z+c)) + fout_obj.write('v %f %f %f\n' % (x+a,y+b,z+c)) + fout_obj.write('v %f %f %f\n' % (x+a,y,z+c)) + fout_obj.write('v %f %f %f\n' % (x,y,z)) + fout_obj.write('v %f %f %f\n' % (x,y+b,z)) + fout_obj.write('v %f %f %f\n' % (x+a,y+b,z)) + fout_obj.write('v %f %f %f\n' % (x+a,y,z)) + fout_obj.write('g default\n') + v_cnt = 0 # for individual box + fout_obj.write('f %d %d %d %d\n' % (4+v_cnt, 3+v_cnt, 2+v_cnt, 1+v_cnt)) + fout_obj.write('f %d %d %d %d\n' % (1+v_cnt, 2+v_cnt, 6+v_cnt, 5+v_cnt)) + fout_obj.write('f %d %d %d %d\n' % (7+v_cnt, 6+v_cnt, 2+v_cnt, 3+v_cnt)) + fout_obj.write('f %d %d %d %d\n' % (4+v_cnt, 8+v_cnt, 7+v_cnt, 3+v_cnt)) + fout_obj.write('f %d %d %d %d\n' % (5+v_cnt, 8+v_cnt, 4+v_cnt, 1+v_cnt)) + fout_obj.write('f %d %d %d %d\n' % (5+v_cnt, 6+v_cnt, 7+v_cnt, 8+v_cnt)) + fout_obj.write('\n') + + fout_mtl.write('newmtl %s\n' % (material)) + fout_mtl.write('Kd %f %f %f\n' % (color[0], color[1], color[2])) + fout_mtl.write('\n') + fout_obj.close() + fout_mtl.close() + + v_cnt += 8 + ins_cnt += 1 + +def bbox_label_to_obj_room(input_filename, out_filename_prefix, easy_view=False, permute=None, center=False, exclude_table=False): + """ Visualization of bounding boxes. + + Args: + input_filename: each line is x1 y1 z1 x2 y2 z2 label + out_filename_prefix: OBJ filename prefix, + visualize object by g_label2color + easy_view: if True, only visualize furniture and floor + permute: if not None, permute XYZ for rendering, e.g. [0 2 1] + center: if True, move obj to have zero origin + Returns: + output a list of OBJ file and MTL files with the same prefix + """ + bbox_label = np.loadtxt(input_filename) + bbox = bbox_label[:, 0:6] + if permute is not None: + assert(len(permute)==3) + permute = np.array(permute) + bbox[:,0:3] = bbox[:,permute] + bbox[:,3:6] = bbox[:,permute+3] + if center: + xyz_max = np.amax(bbox[:,3:6], 0) + bbox[:,0:3] -= (xyz_max/2.0) + bbox[:,3:6] -= (xyz_max/2.0) + bbox /= np.max(xyz_max/2.0) + label = bbox_label[:, -1].astype(int) + obj_filename = out_filename_prefix+'.obj' + mtl_filename = out_filename_prefix+'.mtl' + + fout_obj = open(obj_filename, 'w') + fout_mtl = open(mtl_filename, 'w') + fout_obj.write('mtllib %s\n' % (os.path.basename(mtl_filename))) + v_cnt = 0 # count vertex + ins_cnt = 0 # count instance + for i in range(bbox.shape[0]): + if easy_view and (label[i] not in g_easy_view_labels): + continue + if exclude_table and label[i] == g_classes.index('table'): + continue + + length = bbox[i, 3:6] - bbox[i, 0:3] + a = length[0] + b = length[1] + c = length[2] + x = bbox[i, 0] + y = bbox[i, 1] + z = bbox[i, 2] + color = np.array(g_label2color[label[i]], dtype=float) / 255.0 + + material = 'material%d' % (ins_cnt) + fout_obj.write('usemtl %s\n' % (material)) + fout_obj.write('v %f %f %f\n' % (x,y,z+c)) + fout_obj.write('v %f %f %f\n' % (x,y+b,z+c)) + fout_obj.write('v %f %f %f\n' % (x+a,y+b,z+c)) + fout_obj.write('v %f %f %f\n' % (x+a,y,z+c)) + fout_obj.write('v %f %f %f\n' % (x,y,z)) + fout_obj.write('v %f %f %f\n' % (x,y+b,z)) + fout_obj.write('v %f %f %f\n' % (x+a,y+b,z)) + fout_obj.write('v %f %f %f\n' % (x+a,y,z)) + fout_obj.write('g default\n') + fout_obj.write('f %d %d %d %d\n' % (4+v_cnt, 3+v_cnt, 2+v_cnt, 1+v_cnt)) + fout_obj.write('f %d %d %d %d\n' % (1+v_cnt, 2+v_cnt, 6+v_cnt, 5+v_cnt)) + fout_obj.write('f %d %d %d %d\n' % (7+v_cnt, 6+v_cnt, 2+v_cnt, 3+v_cnt)) + fout_obj.write('f %d %d %d %d\n' % (4+v_cnt, 8+v_cnt, 7+v_cnt, 3+v_cnt)) + fout_obj.write('f %d %d %d %d\n' % (5+v_cnt, 8+v_cnt, 4+v_cnt, 1+v_cnt)) + fout_obj.write('f %d %d %d %d\n' % (5+v_cnt, 6+v_cnt, 7+v_cnt, 8+v_cnt)) + fout_obj.write('\n') + + fout_mtl.write('newmtl %s\n' % (material)) + fout_mtl.write('Kd %f %f %f\n' % (color[0], color[1], color[2])) + fout_mtl.write('\n') + + v_cnt += 8 + ins_cnt += 1 + + fout_obj.close() + fout_mtl.close() + + +def collect_point_bounding_box(anno_path, out_filename, file_format): + """ Compute bounding boxes from each instance in original dataset files on + one room. **We assume the bbox is aligned with XYZ coordinate.** + Save both the point XYZRGB and the bounding box for the point's + parent element. + + Args: + anno_path: path to annotations. e.g. Area_1/office_2/Annotations/ + out_filename: path to save instance bounding boxes for each point, + plus the point's XYZRGBL + each line is XYZRGBL offsetX offsetY offsetZ a b c, + where cx = X+offsetX, cy=X+offsetY, cz=Z+offsetZ + where (cx,cy,cz) is center of the box, a,b,c are distances from center + to the surfaces of the box, i.e. x1 = cx-a, x2 = cx+a, y1=cy-b etc. + file_format: output file format, txt or numpy + Returns: + None + + Note: + room points are shifted, the most negative point is now at origin. + """ + point_bbox_list = [] + + for f in glob.glob(os.path.join(anno_path, '*.txt')): + cls = os.path.basename(f).split('_')[0] + if cls not in g_classes: # note: in some room there is 'staris' class.. + cls = 'clutter' + points = np.loadtxt(f) # Nx6 + label = g_class2label[cls] # N, + # Compute tightest axis aligned bounding box + xyz_min = np.amin(points[:, 0:3], axis=0) # 3, + xyz_max = np.amax(points[:, 0:3], axis=0) # 3, + xyz_center = (xyz_min + xyz_max) / 2 + dimension = (xyz_max - xyz_min) / 2 + + xyz_offsets = xyz_center - points[:,0:3] # Nx3 + dimensions = np.ones((points.shape[0],3)) * dimension # Nx3 + labels = np.ones((points.shape[0],1)) * label # N + point_bbox_list.append(np.concatenate([points, labels, + xyz_offsets, dimensions], 1)) # Nx13 + + point_bbox = np.concatenate(point_bbox_list, 0) # KxNx13 + room_xyz_min = np.amin(point_bbox[:, 0:3], axis=0) + point_bbox[:, 0:3] -= room_xyz_min + + if file_format == 'txt': + fout = open(out_filename, 'w') + for i in range(point_bbox.shape[0]): + fout.write('%f %f %f %d %d %d %d %f %f %f %f %f %f\n' % \ + (point_bbox[i,0], point_bbox[i,1], point_bbox[i,2], + point_bbox[i,3], point_bbox[i,4], point_bbox[i,5], + point_bbox[i,6], + point_bbox[i,7], point_bbox[i,8], point_bbox[i,9], + point_bbox[i,10], point_bbox[i,11], point_bbox[i,12])) + + fout.close() + elif file_format == 'numpy': + np.save(out_filename, point_bbox) + else: + print('ERROR!! Unknown file format: %s, please use txt or numpy.' % \ + (file_format)) + exit() + + diff --git a/sem_seg/meta/all_data_label.txt b/sem_seg/meta/all_data_label.txt new file mode 100644 index 0000000..636e686 --- /dev/null +++ b/sem_seg/meta/all_data_label.txt @@ -0,0 +1,272 @@ +Area_1_conferenceRoom_1.npy +Area_1_conferenceRoom_2.npy +Area_1_copyRoom_1.npy +Area_1_hallway_1.npy +Area_1_hallway_2.npy +Area_1_hallway_3.npy +Area_1_hallway_4.npy +Area_1_hallway_5.npy +Area_1_hallway_6.npy +Area_1_hallway_7.npy +Area_1_hallway_8.npy +Area_1_office_10.npy +Area_1_office_11.npy +Area_1_office_12.npy +Area_1_office_13.npy +Area_1_office_14.npy +Area_1_office_15.npy +Area_1_office_16.npy +Area_1_office_17.npy +Area_1_office_18.npy +Area_1_office_19.npy +Area_1_office_1.npy +Area_1_office_20.npy +Area_1_office_21.npy +Area_1_office_22.npy +Area_1_office_23.npy +Area_1_office_24.npy +Area_1_office_25.npy +Area_1_office_26.npy +Area_1_office_27.npy +Area_1_office_28.npy +Area_1_office_29.npy +Area_1_office_2.npy +Area_1_office_30.npy +Area_1_office_31.npy +Area_1_office_3.npy +Area_1_office_4.npy +Area_1_office_5.npy +Area_1_office_6.npy +Area_1_office_7.npy +Area_1_office_8.npy +Area_1_office_9.npy +Area_1_pantry_1.npy +Area_1_WC_1.npy +Area_2_auditorium_1.npy +Area_2_auditorium_2.npy +Area_2_conferenceRoom_1.npy +Area_2_hallway_10.npy +Area_2_hallway_11.npy +Area_2_hallway_12.npy +Area_2_hallway_1.npy +Area_2_hallway_2.npy +Area_2_hallway_3.npy +Area_2_hallway_4.npy +Area_2_hallway_5.npy +Area_2_hallway_6.npy +Area_2_hallway_7.npy +Area_2_hallway_8.npy +Area_2_hallway_9.npy +Area_2_office_10.npy +Area_2_office_11.npy +Area_2_office_12.npy +Area_2_office_13.npy +Area_2_office_14.npy +Area_2_office_1.npy +Area_2_office_2.npy +Area_2_office_3.npy +Area_2_office_4.npy +Area_2_office_5.npy +Area_2_office_6.npy +Area_2_office_7.npy +Area_2_office_8.npy +Area_2_office_9.npy +Area_2_storage_1.npy +Area_2_storage_2.npy +Area_2_storage_3.npy +Area_2_storage_4.npy +Area_2_storage_5.npy +Area_2_storage_6.npy +Area_2_storage_7.npy +Area_2_storage_8.npy +Area_2_storage_9.npy +Area_2_WC_1.npy +Area_2_WC_2.npy +Area_3_conferenceRoom_1.npy +Area_3_hallway_1.npy +Area_3_hallway_2.npy +Area_3_hallway_3.npy +Area_3_hallway_4.npy +Area_3_hallway_5.npy +Area_3_hallway_6.npy +Area_3_lounge_1.npy +Area_3_lounge_2.npy +Area_3_office_10.npy +Area_3_office_1.npy +Area_3_office_2.npy +Area_3_office_3.npy +Area_3_office_4.npy +Area_3_office_5.npy +Area_3_office_6.npy +Area_3_office_7.npy +Area_3_office_8.npy +Area_3_office_9.npy +Area_3_storage_1.npy +Area_3_storage_2.npy +Area_3_WC_1.npy +Area_3_WC_2.npy +Area_4_conferenceRoom_1.npy +Area_4_conferenceRoom_2.npy +Area_4_conferenceRoom_3.npy +Area_4_hallway_10.npy +Area_4_hallway_11.npy +Area_4_hallway_12.npy +Area_4_hallway_13.npy +Area_4_hallway_14.npy +Area_4_hallway_1.npy +Area_4_hallway_2.npy +Area_4_hallway_3.npy +Area_4_hallway_4.npy +Area_4_hallway_5.npy +Area_4_hallway_6.npy +Area_4_hallway_7.npy +Area_4_hallway_8.npy +Area_4_hallway_9.npy +Area_4_lobby_1.npy +Area_4_lobby_2.npy +Area_4_office_10.npy +Area_4_office_11.npy +Area_4_office_12.npy +Area_4_office_13.npy +Area_4_office_14.npy +Area_4_office_15.npy +Area_4_office_16.npy +Area_4_office_17.npy +Area_4_office_18.npy +Area_4_office_19.npy +Area_4_office_1.npy +Area_4_office_20.npy +Area_4_office_21.npy +Area_4_office_22.npy +Area_4_office_2.npy +Area_4_office_3.npy +Area_4_office_4.npy +Area_4_office_5.npy +Area_4_office_6.npy +Area_4_office_7.npy +Area_4_office_8.npy +Area_4_office_9.npy +Area_4_storage_1.npy +Area_4_storage_2.npy +Area_4_storage_3.npy +Area_4_storage_4.npy +Area_4_WC_1.npy +Area_4_WC_2.npy +Area_4_WC_3.npy +Area_4_WC_4.npy +Area_5_conferenceRoom_1.npy +Area_5_conferenceRoom_2.npy +Area_5_conferenceRoom_3.npy +Area_5_hallway_10.npy +Area_5_hallway_11.npy +Area_5_hallway_12.npy +Area_5_hallway_13.npy +Area_5_hallway_14.npy +Area_5_hallway_15.npy +Area_5_hallway_1.npy +Area_5_hallway_2.npy +Area_5_hallway_3.npy +Area_5_hallway_4.npy +Area_5_hallway_5.npy +Area_5_hallway_6.npy +Area_5_hallway_7.npy +Area_5_hallway_8.npy +Area_5_hallway_9.npy +Area_5_lobby_1.npy +Area_5_office_10.npy +Area_5_office_11.npy +Area_5_office_12.npy +Area_5_office_13.npy +Area_5_office_14.npy +Area_5_office_15.npy +Area_5_office_16.npy +Area_5_office_17.npy +Area_5_office_18.npy +Area_5_office_19.npy +Area_5_office_1.npy +Area_5_office_20.npy +Area_5_office_21.npy +Area_5_office_22.npy +Area_5_office_23.npy +Area_5_office_24.npy +Area_5_office_25.npy +Area_5_office_26.npy +Area_5_office_27.npy +Area_5_office_28.npy +Area_5_office_29.npy +Area_5_office_2.npy +Area_5_office_30.npy +Area_5_office_31.npy +Area_5_office_32.npy +Area_5_office_33.npy +Area_5_office_34.npy +Area_5_office_35.npy +Area_5_office_36.npy +Area_5_office_37.npy +Area_5_office_38.npy +Area_5_office_39.npy +Area_5_office_3.npy +Area_5_office_40.npy +Area_5_office_41.npy +Area_5_office_42.npy +Area_5_office_4.npy +Area_5_office_5.npy +Area_5_office_6.npy +Area_5_office_7.npy +Area_5_office_8.npy +Area_5_office_9.npy +Area_5_pantry_1.npy +Area_5_storage_1.npy +Area_5_storage_2.npy +Area_5_storage_3.npy +Area_5_storage_4.npy +Area_5_WC_1.npy +Area_5_WC_2.npy +Area_6_conferenceRoom_1.npy +Area_6_copyRoom_1.npy +Area_6_hallway_1.npy +Area_6_hallway_2.npy +Area_6_hallway_3.npy +Area_6_hallway_4.npy +Area_6_hallway_5.npy +Area_6_hallway_6.npy +Area_6_lounge_1.npy +Area_6_office_10.npy +Area_6_office_11.npy +Area_6_office_12.npy +Area_6_office_13.npy +Area_6_office_14.npy +Area_6_office_15.npy +Area_6_office_16.npy +Area_6_office_17.npy +Area_6_office_18.npy +Area_6_office_19.npy +Area_6_office_1.npy +Area_6_office_20.npy +Area_6_office_21.npy +Area_6_office_22.npy +Area_6_office_23.npy +Area_6_office_24.npy +Area_6_office_25.npy +Area_6_office_26.npy +Area_6_office_27.npy +Area_6_office_28.npy +Area_6_office_29.npy +Area_6_office_2.npy +Area_6_office_30.npy +Area_6_office_31.npy +Area_6_office_32.npy +Area_6_office_33.npy +Area_6_office_34.npy +Area_6_office_35.npy +Area_6_office_36.npy +Area_6_office_37.npy +Area_6_office_3.npy +Area_6_office_4.npy +Area_6_office_5.npy +Area_6_office_6.npy +Area_6_office_7.npy +Area_6_office_8.npy +Area_6_office_9.npy +Area_6_openspace_1.npy +Area_6_pantry_1.npy diff --git a/sem_seg/meta/anno_paths.txt b/sem_seg/meta/anno_paths.txt new file mode 100644 index 0000000..0ad2f25 --- /dev/null +++ b/sem_seg/meta/anno_paths.txt @@ -0,0 +1,272 @@ +Area_1/conferenceRoom_1/Annotations +Area_1/conferenceRoom_2/Annotations +Area_1/copyRoom_1/Annotations +Area_1/hallway_1/Annotations +Area_1/hallway_2/Annotations +Area_1/hallway_3/Annotations +Area_1/hallway_4/Annotations +Area_1/hallway_5/Annotations +Area_1/hallway_6/Annotations +Area_1/hallway_7/Annotations +Area_1/hallway_8/Annotations +Area_1/office_10/Annotations +Area_1/office_11/Annotations +Area_1/office_12/Annotations +Area_1/office_13/Annotations +Area_1/office_14/Annotations +Area_1/office_15/Annotations +Area_1/office_16/Annotations +Area_1/office_17/Annotations +Area_1/office_18/Annotations +Area_1/office_19/Annotations +Area_1/office_1/Annotations +Area_1/office_20/Annotations +Area_1/office_21/Annotations +Area_1/office_22/Annotations +Area_1/office_23/Annotations +Area_1/office_24/Annotations +Area_1/office_25/Annotations +Area_1/office_26/Annotations +Area_1/office_27/Annotations +Area_1/office_28/Annotations +Area_1/office_29/Annotations +Area_1/office_2/Annotations +Area_1/office_30/Annotations +Area_1/office_31/Annotations +Area_1/office_3/Annotations +Area_1/office_4/Annotations +Area_1/office_5/Annotations +Area_1/office_6/Annotations +Area_1/office_7/Annotations +Area_1/office_8/Annotations +Area_1/office_9/Annotations +Area_1/pantry_1/Annotations +Area_1/WC_1/Annotations +Area_2/auditorium_1/Annotations +Area_2/auditorium_2/Annotations +Area_2/conferenceRoom_1/Annotations +Area_2/hallway_10/Annotations +Area_2/hallway_11/Annotations +Area_2/hallway_12/Annotations +Area_2/hallway_1/Annotations +Area_2/hallway_2/Annotations +Area_2/hallway_3/Annotations +Area_2/hallway_4/Annotations +Area_2/hallway_5/Annotations +Area_2/hallway_6/Annotations +Area_2/hallway_7/Annotations +Area_2/hallway_8/Annotations +Area_2/hallway_9/Annotations +Area_2/office_10/Annotations +Area_2/office_11/Annotations +Area_2/office_12/Annotations +Area_2/office_13/Annotations +Area_2/office_14/Annotations +Area_2/office_1/Annotations +Area_2/office_2/Annotations +Area_2/office_3/Annotations +Area_2/office_4/Annotations +Area_2/office_5/Annotations +Area_2/office_6/Annotations +Area_2/office_7/Annotations +Area_2/office_8/Annotations +Area_2/office_9/Annotations +Area_2/storage_1/Annotations +Area_2/storage_2/Annotations +Area_2/storage_3/Annotations +Area_2/storage_4/Annotations +Area_2/storage_5/Annotations +Area_2/storage_6/Annotations +Area_2/storage_7/Annotations +Area_2/storage_8/Annotations +Area_2/storage_9/Annotations +Area_2/WC_1/Annotations +Area_2/WC_2/Annotations +Area_3/conferenceRoom_1/Annotations +Area_3/hallway_1/Annotations +Area_3/hallway_2/Annotations +Area_3/hallway_3/Annotations +Area_3/hallway_4/Annotations +Area_3/hallway_5/Annotations +Area_3/hallway_6/Annotations +Area_3/lounge_1/Annotations +Area_3/lounge_2/Annotations +Area_3/office_10/Annotations +Area_3/office_1/Annotations +Area_3/office_2/Annotations +Area_3/office_3/Annotations +Area_3/office_4/Annotations +Area_3/office_5/Annotations +Area_3/office_6/Annotations +Area_3/office_7/Annotations +Area_3/office_8/Annotations +Area_3/office_9/Annotations +Area_3/storage_1/Annotations +Area_3/storage_2/Annotations +Area_3/WC_1/Annotations +Area_3/WC_2/Annotations +Area_4/conferenceRoom_1/Annotations +Area_4/conferenceRoom_2/Annotations +Area_4/conferenceRoom_3/Annotations +Area_4/hallway_10/Annotations +Area_4/hallway_11/Annotations +Area_4/hallway_12/Annotations +Area_4/hallway_13/Annotations +Area_4/hallway_14/Annotations +Area_4/hallway_1/Annotations +Area_4/hallway_2/Annotations +Area_4/hallway_3/Annotations +Area_4/hallway_4/Annotations +Area_4/hallway_5/Annotations +Area_4/hallway_6/Annotations +Area_4/hallway_7/Annotations +Area_4/hallway_8/Annotations +Area_4/hallway_9/Annotations +Area_4/lobby_1/Annotations +Area_4/lobby_2/Annotations +Area_4/office_10/Annotations +Area_4/office_11/Annotations +Area_4/office_12/Annotations +Area_4/office_13/Annotations +Area_4/office_14/Annotations +Area_4/office_15/Annotations +Area_4/office_16/Annotations +Area_4/office_17/Annotations +Area_4/office_18/Annotations +Area_4/office_19/Annotations +Area_4/office_1/Annotations +Area_4/office_20/Annotations +Area_4/office_21/Annotations +Area_4/office_22/Annotations +Area_4/office_2/Annotations +Area_4/office_3/Annotations +Area_4/office_4/Annotations +Area_4/office_5/Annotations +Area_4/office_6/Annotations +Area_4/office_7/Annotations +Area_4/office_8/Annotations +Area_4/office_9/Annotations +Area_4/storage_1/Annotations +Area_4/storage_2/Annotations +Area_4/storage_3/Annotations +Area_4/storage_4/Annotations +Area_4/WC_1/Annotations +Area_4/WC_2/Annotations +Area_4/WC_3/Annotations +Area_4/WC_4/Annotations +Area_5/conferenceRoom_1/Annotations +Area_5/conferenceRoom_2/Annotations +Area_5/conferenceRoom_3/Annotations +Area_5/hallway_10/Annotations +Area_5/hallway_11/Annotations +Area_5/hallway_12/Annotations +Area_5/hallway_13/Annotations +Area_5/hallway_14/Annotations +Area_5/hallway_15/Annotations +Area_5/hallway_1/Annotations +Area_5/hallway_2/Annotations +Area_5/hallway_3/Annotations +Area_5/hallway_4/Annotations +Area_5/hallway_5/Annotations +Area_5/hallway_6/Annotations +Area_5/hallway_7/Annotations +Area_5/hallway_8/Annotations +Area_5/hallway_9/Annotations +Area_5/lobby_1/Annotations +Area_5/office_10/Annotations +Area_5/office_11/Annotations +Area_5/office_12/Annotations +Area_5/office_13/Annotations +Area_5/office_14/Annotations +Area_5/office_15/Annotations +Area_5/office_16/Annotations +Area_5/office_17/Annotations +Area_5/office_18/Annotations +Area_5/office_19/Annotations +Area_5/office_1/Annotations +Area_5/office_20/Annotations +Area_5/office_21/Annotations +Area_5/office_22/Annotations +Area_5/office_23/Annotations +Area_5/office_24/Annotations +Area_5/office_25/Annotations +Area_5/office_26/Annotations +Area_5/office_27/Annotations +Area_5/office_28/Annotations +Area_5/office_29/Annotations +Area_5/office_2/Annotations +Area_5/office_30/Annotations +Area_5/office_31/Annotations +Area_5/office_32/Annotations +Area_5/office_33/Annotations +Area_5/office_34/Annotations +Area_5/office_35/Annotations +Area_5/office_36/Annotations +Area_5/office_37/Annotations +Area_5/office_38/Annotations +Area_5/office_39/Annotations +Area_5/office_3/Annotations +Area_5/office_40/Annotations +Area_5/office_41/Annotations +Area_5/office_42/Annotations +Area_5/office_4/Annotations +Area_5/office_5/Annotations +Area_5/office_6/Annotations +Area_5/office_7/Annotations +Area_5/office_8/Annotations +Area_5/office_9/Annotations +Area_5/pantry_1/Annotations +Area_5/storage_1/Annotations +Area_5/storage_2/Annotations +Area_5/storage_3/Annotations +Area_5/storage_4/Annotations +Area_5/WC_1/Annotations +Area_5/WC_2/Annotations +Area_6/conferenceRoom_1/Annotations +Area_6/copyRoom_1/Annotations +Area_6/hallway_1/Annotations +Area_6/hallway_2/Annotations +Area_6/hallway_3/Annotations +Area_6/hallway_4/Annotations +Area_6/hallway_5/Annotations +Area_6/hallway_6/Annotations +Area_6/lounge_1/Annotations +Area_6/office_10/Annotations +Area_6/office_11/Annotations +Area_6/office_12/Annotations +Area_6/office_13/Annotations +Area_6/office_14/Annotations +Area_6/office_15/Annotations +Area_6/office_16/Annotations +Area_6/office_17/Annotations +Area_6/office_18/Annotations +Area_6/office_19/Annotations +Area_6/office_1/Annotations +Area_6/office_20/Annotations +Area_6/office_21/Annotations +Area_6/office_22/Annotations +Area_6/office_23/Annotations +Area_6/office_24/Annotations +Area_6/office_25/Annotations +Area_6/office_26/Annotations +Area_6/office_27/Annotations +Area_6/office_28/Annotations +Area_6/office_29/Annotations +Area_6/office_2/Annotations +Area_6/office_30/Annotations +Area_6/office_31/Annotations +Area_6/office_32/Annotations +Area_6/office_33/Annotations +Area_6/office_34/Annotations +Area_6/office_35/Annotations +Area_6/office_36/Annotations +Area_6/office_37/Annotations +Area_6/office_3/Annotations +Area_6/office_4/Annotations +Area_6/office_5/Annotations +Area_6/office_6/Annotations +Area_6/office_7/Annotations +Area_6/office_8/Annotations +Area_6/office_9/Annotations +Area_6/openspace_1/Annotations +Area_6/pantry_1/Annotations diff --git a/sem_seg/meta/area1_data_label.txt b/sem_seg/meta/area1_data_label.txt new file mode 100644 index 0000000..f2ac937 --- /dev/null +++ b/sem_seg/meta/area1_data_label.txt @@ -0,0 +1,44 @@ +data/stanford_indoor3d/Area_1_conferenceRoom_1.npy +data/stanford_indoor3d/Area_1_conferenceRoom_2.npy +data/stanford_indoor3d/Area_1_copyRoom_1.npy +data/stanford_indoor3d/Area_1_hallway_1.npy +data/stanford_indoor3d/Area_1_hallway_2.npy +data/stanford_indoor3d/Area_1_hallway_3.npy +data/stanford_indoor3d/Area_1_hallway_4.npy +data/stanford_indoor3d/Area_1_hallway_5.npy +data/stanford_indoor3d/Area_1_hallway_6.npy +data/stanford_indoor3d/Area_1_hallway_7.npy +data/stanford_indoor3d/Area_1_hallway_8.npy +data/stanford_indoor3d/Area_1_office_10.npy +data/stanford_indoor3d/Area_1_office_11.npy +data/stanford_indoor3d/Area_1_office_12.npy +data/stanford_indoor3d/Area_1_office_13.npy +data/stanford_indoor3d/Area_1_office_14.npy +data/stanford_indoor3d/Area_1_office_15.npy +data/stanford_indoor3d/Area_1_office_16.npy +data/stanford_indoor3d/Area_1_office_17.npy +data/stanford_indoor3d/Area_1_office_18.npy +data/stanford_indoor3d/Area_1_office_19.npy +data/stanford_indoor3d/Area_1_office_1.npy +data/stanford_indoor3d/Area_1_office_20.npy +data/stanford_indoor3d/Area_1_office_21.npy +data/stanford_indoor3d/Area_1_office_22.npy +data/stanford_indoor3d/Area_1_office_23.npy +data/stanford_indoor3d/Area_1_office_24.npy +data/stanford_indoor3d/Area_1_office_25.npy +data/stanford_indoor3d/Area_1_office_26.npy +data/stanford_indoor3d/Area_1_office_27.npy +data/stanford_indoor3d/Area_1_office_28.npy +data/stanford_indoor3d/Area_1_office_29.npy +data/stanford_indoor3d/Area_1_office_2.npy +data/stanford_indoor3d/Area_1_office_30.npy +data/stanford_indoor3d/Area_1_office_31.npy +data/stanford_indoor3d/Area_1_office_3.npy +data/stanford_indoor3d/Area_1_office_4.npy +data/stanford_indoor3d/Area_1_office_5.npy +data/stanford_indoor3d/Area_1_office_6.npy +data/stanford_indoor3d/Area_1_office_7.npy +data/stanford_indoor3d/Area_1_office_8.npy +data/stanford_indoor3d/Area_1_office_9.npy +data/stanford_indoor3d/Area_1_pantry_1.npy +data/stanford_indoor3d/Area_1_WC_1.npy diff --git a/sem_seg/meta/area2_data_label.txt b/sem_seg/meta/area2_data_label.txt new file mode 100644 index 0000000..f74407a --- /dev/null +++ b/sem_seg/meta/area2_data_label.txt @@ -0,0 +1,40 @@ +data/stanford_indoor3d/Area_2_auditorium_1.npy +data/stanford_indoor3d/Area_2_auditorium_2.npy +data/stanford_indoor3d/Area_2_conferenceRoom_1.npy +data/stanford_indoor3d/Area_2_hallway_10.npy +data/stanford_indoor3d/Area_2_hallway_11.npy +data/stanford_indoor3d/Area_2_hallway_12.npy +data/stanford_indoor3d/Area_2_hallway_1.npy +data/stanford_indoor3d/Area_2_hallway_2.npy +data/stanford_indoor3d/Area_2_hallway_3.npy +data/stanford_indoor3d/Area_2_hallway_4.npy +data/stanford_indoor3d/Area_2_hallway_5.npy +data/stanford_indoor3d/Area_2_hallway_6.npy +data/stanford_indoor3d/Area_2_hallway_7.npy +data/stanford_indoor3d/Area_2_hallway_8.npy +data/stanford_indoor3d/Area_2_hallway_9.npy +data/stanford_indoor3d/Area_2_office_10.npy +data/stanford_indoor3d/Area_2_office_11.npy +data/stanford_indoor3d/Area_2_office_12.npy +data/stanford_indoor3d/Area_2_office_13.npy +data/stanford_indoor3d/Area_2_office_14.npy +data/stanford_indoor3d/Area_2_office_1.npy +data/stanford_indoor3d/Area_2_office_2.npy +data/stanford_indoor3d/Area_2_office_3.npy +data/stanford_indoor3d/Area_2_office_4.npy +data/stanford_indoor3d/Area_2_office_5.npy +data/stanford_indoor3d/Area_2_office_6.npy +data/stanford_indoor3d/Area_2_office_7.npy +data/stanford_indoor3d/Area_2_office_8.npy +data/stanford_indoor3d/Area_2_office_9.npy +data/stanford_indoor3d/Area_2_storage_1.npy +data/stanford_indoor3d/Area_2_storage_2.npy +data/stanford_indoor3d/Area_2_storage_3.npy +data/stanford_indoor3d/Area_2_storage_4.npy +data/stanford_indoor3d/Area_2_storage_5.npy +data/stanford_indoor3d/Area_2_storage_6.npy +data/stanford_indoor3d/Area_2_storage_7.npy +data/stanford_indoor3d/Area_2_storage_8.npy +data/stanford_indoor3d/Area_2_storage_9.npy +data/stanford_indoor3d/Area_2_WC_1.npy +data/stanford_indoor3d/Area_2_WC_2.npy diff --git a/sem_seg/meta/area3_data_label.txt b/sem_seg/meta/area3_data_label.txt new file mode 100644 index 0000000..f0e2147 --- /dev/null +++ b/sem_seg/meta/area3_data_label.txt @@ -0,0 +1,23 @@ +data/stanford_indoor3d/Area_3_conferenceRoom_1.npy +data/stanford_indoor3d/Area_3_hallway_1.npy +data/stanford_indoor3d/Area_3_hallway_2.npy +data/stanford_indoor3d/Area_3_hallway_3.npy +data/stanford_indoor3d/Area_3_hallway_4.npy +data/stanford_indoor3d/Area_3_hallway_5.npy +data/stanford_indoor3d/Area_3_hallway_6.npy +data/stanford_indoor3d/Area_3_lounge_1.npy +data/stanford_indoor3d/Area_3_lounge_2.npy +data/stanford_indoor3d/Area_3_office_10.npy +data/stanford_indoor3d/Area_3_office_1.npy +data/stanford_indoor3d/Area_3_office_2.npy +data/stanford_indoor3d/Area_3_office_3.npy +data/stanford_indoor3d/Area_3_office_4.npy +data/stanford_indoor3d/Area_3_office_5.npy +data/stanford_indoor3d/Area_3_office_6.npy +data/stanford_indoor3d/Area_3_office_7.npy +data/stanford_indoor3d/Area_3_office_8.npy +data/stanford_indoor3d/Area_3_office_9.npy +data/stanford_indoor3d/Area_3_storage_1.npy +data/stanford_indoor3d/Area_3_storage_2.npy +data/stanford_indoor3d/Area_3_WC_1.npy +data/stanford_indoor3d/Area_3_WC_2.npy diff --git a/sem_seg/meta/area4_data_label.txt b/sem_seg/meta/area4_data_label.txt new file mode 100644 index 0000000..cb26084 --- /dev/null +++ b/sem_seg/meta/area4_data_label.txt @@ -0,0 +1,49 @@ +data/stanford_indoor3d/Area_4_conferenceRoom_1.npy +data/stanford_indoor3d/Area_4_conferenceRoom_2.npy +data/stanford_indoor3d/Area_4_conferenceRoom_3.npy +data/stanford_indoor3d/Area_4_hallway_10.npy +data/stanford_indoor3d/Area_4_hallway_11.npy +data/stanford_indoor3d/Area_4_hallway_12.npy +data/stanford_indoor3d/Area_4_hallway_13.npy +data/stanford_indoor3d/Area_4_hallway_14.npy +data/stanford_indoor3d/Area_4_hallway_1.npy +data/stanford_indoor3d/Area_4_hallway_2.npy +data/stanford_indoor3d/Area_4_hallway_3.npy +data/stanford_indoor3d/Area_4_hallway_4.npy +data/stanford_indoor3d/Area_4_hallway_5.npy +data/stanford_indoor3d/Area_4_hallway_6.npy +data/stanford_indoor3d/Area_4_hallway_7.npy +data/stanford_indoor3d/Area_4_hallway_8.npy +data/stanford_indoor3d/Area_4_hallway_9.npy +data/stanford_indoor3d/Area_4_lobby_1.npy +data/stanford_indoor3d/Area_4_lobby_2.npy +data/stanford_indoor3d/Area_4_office_10.npy +data/stanford_indoor3d/Area_4_office_11.npy +data/stanford_indoor3d/Area_4_office_12.npy +data/stanford_indoor3d/Area_4_office_13.npy +data/stanford_indoor3d/Area_4_office_14.npy +data/stanford_indoor3d/Area_4_office_15.npy +data/stanford_indoor3d/Area_4_office_16.npy +data/stanford_indoor3d/Area_4_office_17.npy +data/stanford_indoor3d/Area_4_office_18.npy +data/stanford_indoor3d/Area_4_office_19.npy +data/stanford_indoor3d/Area_4_office_1.npy +data/stanford_indoor3d/Area_4_office_20.npy +data/stanford_indoor3d/Area_4_office_21.npy +data/stanford_indoor3d/Area_4_office_22.npy +data/stanford_indoor3d/Area_4_office_2.npy +data/stanford_indoor3d/Area_4_office_3.npy +data/stanford_indoor3d/Area_4_office_4.npy +data/stanford_indoor3d/Area_4_office_5.npy +data/stanford_indoor3d/Area_4_office_6.npy +data/stanford_indoor3d/Area_4_office_7.npy +data/stanford_indoor3d/Area_4_office_8.npy +data/stanford_indoor3d/Area_4_office_9.npy +data/stanford_indoor3d/Area_4_storage_1.npy +data/stanford_indoor3d/Area_4_storage_2.npy +data/stanford_indoor3d/Area_4_storage_3.npy +data/stanford_indoor3d/Area_4_storage_4.npy +data/stanford_indoor3d/Area_4_WC_1.npy +data/stanford_indoor3d/Area_4_WC_2.npy +data/stanford_indoor3d/Area_4_WC_3.npy +data/stanford_indoor3d/Area_4_WC_4.npy diff --git a/sem_seg/meta/area5_data_label.txt b/sem_seg/meta/area5_data_label.txt new file mode 100644 index 0000000..48c3ea3 --- /dev/null +++ b/sem_seg/meta/area5_data_label.txt @@ -0,0 +1,68 @@ +data/stanford_indoor3d/Area_5_conferenceRoom_1.npy +data/stanford_indoor3d/Area_5_conferenceRoom_2.npy +data/stanford_indoor3d/Area_5_conferenceRoom_3.npy +data/stanford_indoor3d/Area_5_hallway_10.npy +data/stanford_indoor3d/Area_5_hallway_11.npy +data/stanford_indoor3d/Area_5_hallway_12.npy +data/stanford_indoor3d/Area_5_hallway_13.npy +data/stanford_indoor3d/Area_5_hallway_14.npy +data/stanford_indoor3d/Area_5_hallway_15.npy +data/stanford_indoor3d/Area_5_hallway_1.npy +data/stanford_indoor3d/Area_5_hallway_2.npy +data/stanford_indoor3d/Area_5_hallway_3.npy +data/stanford_indoor3d/Area_5_hallway_4.npy +data/stanford_indoor3d/Area_5_hallway_5.npy +data/stanford_indoor3d/Area_5_hallway_6.npy +data/stanford_indoor3d/Area_5_hallway_7.npy +data/stanford_indoor3d/Area_5_hallway_8.npy +data/stanford_indoor3d/Area_5_hallway_9.npy +data/stanford_indoor3d/Area_5_lobby_1.npy +data/stanford_indoor3d/Area_5_office_10.npy +data/stanford_indoor3d/Area_5_office_11.npy +data/stanford_indoor3d/Area_5_office_12.npy +data/stanford_indoor3d/Area_5_office_13.npy +data/stanford_indoor3d/Area_5_office_14.npy +data/stanford_indoor3d/Area_5_office_15.npy +data/stanford_indoor3d/Area_5_office_16.npy +data/stanford_indoor3d/Area_5_office_17.npy +data/stanford_indoor3d/Area_5_office_18.npy +data/stanford_indoor3d/Area_5_office_19.npy +data/stanford_indoor3d/Area_5_office_1.npy +data/stanford_indoor3d/Area_5_office_20.npy +data/stanford_indoor3d/Area_5_office_21.npy +data/stanford_indoor3d/Area_5_office_22.npy +data/stanford_indoor3d/Area_5_office_23.npy +data/stanford_indoor3d/Area_5_office_24.npy +data/stanford_indoor3d/Area_5_office_25.npy +data/stanford_indoor3d/Area_5_office_26.npy +data/stanford_indoor3d/Area_5_office_27.npy +data/stanford_indoor3d/Area_5_office_28.npy +data/stanford_indoor3d/Area_5_office_29.npy +data/stanford_indoor3d/Area_5_office_2.npy +data/stanford_indoor3d/Area_5_office_30.npy +data/stanford_indoor3d/Area_5_office_31.npy +data/stanford_indoor3d/Area_5_office_32.npy +data/stanford_indoor3d/Area_5_office_33.npy +data/stanford_indoor3d/Area_5_office_34.npy +data/stanford_indoor3d/Area_5_office_35.npy +data/stanford_indoor3d/Area_5_office_36.npy +data/stanford_indoor3d/Area_5_office_37.npy +data/stanford_indoor3d/Area_5_office_38.npy +data/stanford_indoor3d/Area_5_office_39.npy +data/stanford_indoor3d/Area_5_office_3.npy +data/stanford_indoor3d/Area_5_office_40.npy +data/stanford_indoor3d/Area_5_office_41.npy +data/stanford_indoor3d/Area_5_office_42.npy +data/stanford_indoor3d/Area_5_office_4.npy +data/stanford_indoor3d/Area_5_office_5.npy +data/stanford_indoor3d/Area_5_office_6.npy +data/stanford_indoor3d/Area_5_office_7.npy +data/stanford_indoor3d/Area_5_office_8.npy +data/stanford_indoor3d/Area_5_office_9.npy +data/stanford_indoor3d/Area_5_pantry_1.npy +data/stanford_indoor3d/Area_5_storage_1.npy +data/stanford_indoor3d/Area_5_storage_2.npy +data/stanford_indoor3d/Area_5_storage_3.npy +data/stanford_indoor3d/Area_5_storage_4.npy +data/stanford_indoor3d/Area_5_WC_1.npy +data/stanford_indoor3d/Area_5_WC_2.npy diff --git a/sem_seg/meta/area6_data_label.txt b/sem_seg/meta/area6_data_label.txt new file mode 100644 index 0000000..d067baa --- /dev/null +++ b/sem_seg/meta/area6_data_label.txt @@ -0,0 +1,48 @@ +data/stanford_indoor3d/Area_6_conferenceRoom_1.npy +data/stanford_indoor3d/Area_6_copyRoom_1.npy +data/stanford_indoor3d/Area_6_hallway_1.npy +data/stanford_indoor3d/Area_6_hallway_2.npy +data/stanford_indoor3d/Area_6_hallway_3.npy +data/stanford_indoor3d/Area_6_hallway_4.npy +data/stanford_indoor3d/Area_6_hallway_5.npy +data/stanford_indoor3d/Area_6_hallway_6.npy +data/stanford_indoor3d/Area_6_lounge_1.npy +data/stanford_indoor3d/Area_6_office_10.npy +data/stanford_indoor3d/Area_6_office_11.npy +data/stanford_indoor3d/Area_6_office_12.npy +data/stanford_indoor3d/Area_6_office_13.npy +data/stanford_indoor3d/Area_6_office_14.npy +data/stanford_indoor3d/Area_6_office_15.npy +data/stanford_indoor3d/Area_6_office_16.npy +data/stanford_indoor3d/Area_6_office_17.npy +data/stanford_indoor3d/Area_6_office_18.npy +data/stanford_indoor3d/Area_6_office_19.npy +data/stanford_indoor3d/Area_6_office_1.npy +data/stanford_indoor3d/Area_6_office_20.npy +data/stanford_indoor3d/Area_6_office_21.npy +data/stanford_indoor3d/Area_6_office_22.npy +data/stanford_indoor3d/Area_6_office_23.npy +data/stanford_indoor3d/Area_6_office_24.npy +data/stanford_indoor3d/Area_6_office_25.npy +data/stanford_indoor3d/Area_6_office_26.npy +data/stanford_indoor3d/Area_6_office_27.npy +data/stanford_indoor3d/Area_6_office_28.npy +data/stanford_indoor3d/Area_6_office_29.npy +data/stanford_indoor3d/Area_6_office_2.npy +data/stanford_indoor3d/Area_6_office_30.npy +data/stanford_indoor3d/Area_6_office_31.npy +data/stanford_indoor3d/Area_6_office_32.npy +data/stanford_indoor3d/Area_6_office_33.npy +data/stanford_indoor3d/Area_6_office_34.npy +data/stanford_indoor3d/Area_6_office_35.npy +data/stanford_indoor3d/Area_6_office_36.npy +data/stanford_indoor3d/Area_6_office_37.npy +data/stanford_indoor3d/Area_6_office_3.npy +data/stanford_indoor3d/Area_6_office_4.npy +data/stanford_indoor3d/Area_6_office_5.npy +data/stanford_indoor3d/Area_6_office_6.npy +data/stanford_indoor3d/Area_6_office_7.npy +data/stanford_indoor3d/Area_6_office_8.npy +data/stanford_indoor3d/Area_6_office_9.npy +data/stanford_indoor3d/Area_6_openspace_1.npy +data/stanford_indoor3d/Area_6_pantry_1.npy diff --git a/sem_seg/meta/class_names.txt b/sem_seg/meta/class_names.txt new file mode 100644 index 0000000..ca1d178 --- /dev/null +++ b/sem_seg/meta/class_names.txt @@ -0,0 +1,13 @@ +ceiling +floor +wall +beam +column +window +door +table +chair +sofa +bookcase +board +clutter