Created
April 30, 2021 09:06
-
-
Save gisbi-kim/8e1b9dcc4926428efbfeae3bf8363c88 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| import time | |
| import copy | |
| import numpy as np | |
| import open3d as o3d | |
| # | |
| parent_dir = 'ScanNet/scans' | |
| seq_dir_names = os.listdir(parent_dir) | |
| seq_dir_paths = [os.path.join(parent_dir, name) for name in seq_dir_names] | |
| seq_ply_paths = [os.path.join(parent_dir, name, name+"_vh_clean_2.ply") for name in seq_dir_names] | |
| print(seq_dir_names) | |
| print(seq_dir_paths) | |
| print(seq_ply_paths) | |
| print(" ") | |
| # | |
| init_pcd = o3d.io.read_point_cloud(seq_ply_paths[0]) | |
| pcd = copy.deepcopy(init_pcd) | |
| vis = o3d.visualization.Visualizer() | |
| vis.create_window('ScanNet', visible = True) | |
| vis.add_geometry(pcd) | |
| time_duration = 0.5 | |
| for ii, ply_file in enumerate(seq_ply_paths): | |
| curr_pcd = o3d.io.read_point_cloud(ply_file) | |
| pcd.points = o3d.utility.Vector3dVector(np.asarray(curr_pcd.points)) | |
| pcd.colors = o3d.utility.Vector3dVector(np.asarray(curr_pcd.colors)) | |
| vis.update_geometry(pcd) | |
| vis.poll_events() | |
| vis.update_renderer() | |
| time.sleep(time_duration) | |
| print(seq_dir_names[ii], ", (", ii, "/", len(seq_ply_paths), ") in training set") | |
| print(curr_pcd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment