只存点云:
TEST_DATASET = scannet_dataset.ScannetDataset(root=DATA_PATH, npoints=NUM_POINT, split='test') for i in range(len(TEST_DATASET.scene_points_list)): filename=''.join(["data/test_dataset/test_",str(i+1),'.txt']) np.savetxt(filename, TEST_DATASET.scene_points_list[i],fmt="%.8f", delimiter=',')
点云和标签一起存:
traindata_and_label=np.column_stack((TRAIN_DATASET.scene_points_list, TRAIN_DATASET.semantic_labels_list))#np.column_stack将两个矩阵进行组合连接 filename=''.join(["data/train_dataset/train_data_and_label_",str(1),'.txt']) np.savetxt(filename, traindata_and_label,fmt="%.8f,%.8f,%.8f,%d", delimiter=',')