Download pointcept/datasets/structure3d.py from dfki-av/BIMStruct3D-segmentation: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/dfki-av/BIMStruct3D-segmentation/resolve/7ab05dd198d38ea08e60bb1e4f3f04aa369975c2/pointcept/datasets/structure3d.py
- Command line
-
hf download hf://dfki-av/BIMStruct3D-segmentation@7ab05dd198d38ea08e60bb1e4f3f04aa369975c2/pointcept/datasets/structure3d.py
-
curl -L -o structure3d.py https://huggingface.co/dfki-av/BIMStruct3D-segmentation/resolve/7ab05dd198d38ea08e60bb1e4f3f04aa369975c2/pointcept/datasets/structure3d.py
1.12 kB
| """ | |
| Structured3D Datasets | |
| Author: Xiaoyang Wu (xiaoyang.wu.cs@gmail.com) | |
| Please cite our work if the code is helpful to you. | |
| """ | |
| import os | |
| import glob | |
| from collections.abc import Sequence | |
| from .defaults import DefaultDataset | |
| from .builder import DATASETS | |
| class Structured3DDataset(DefaultDataset): | |
| def get_data_list(self): | |
| if isinstance(self.split, str): | |
| data_list = glob.glob( | |
| os.path.join(self.data_root, self.split, "scene_*/room_*") | |
| ) | |
| elif isinstance(self.split, Sequence): | |
| data_list = [] | |
| for split in self.split: | |
| data_list += glob.glob( | |
| os.path.join(self.data_root, split, "scene_*/room_*") | |
| ) | |
| else: | |
| raise NotImplementedError | |
| return data_list | |
| def get_data_name(self, idx): | |
| file_path = self.data_list[idx % len(self.data_list)] | |
| dir_path, room_name = os.path.split(file_path) | |
| scene_name = os.path.basename(dir_path) | |
| data_name = f"{scene_name}_{room_name}" | |
| return data_name | |