Dataset for whole pointclouds with farthest point sampling _incomplete_

This commit is contained in:
Si11ium
2020-05-19 17:15:01 +02:00
parent 9ccbec9d7c
commit 444725f6af
5 changed files with 105 additions and 3 deletions

View File

@ -0,0 +1,36 @@
from abc import ABC
from pathlib import Path
from torch.utils.data import Dataset
from ml_lib.point_toolset.sampling import FarthestpointSampling
class _Point_Dataset(ABC, Dataset):
@property
def setting(self) -> str:
raise NotImplementedError
headers = ['x', 'y', 'z', 'nx', 'ny', 'nz', 'label', 'cl_idx']
def __init__(self, root=Path('data'), sampling_k=2048, transforms=None, load_preprocessed=True, *args, **kwargs):
super(_Point_Dataset, self).__init__()
self.load_preprocessed = load_preprocessed
self.transforms = transforms if transforms else lambda x: x
self.sampling_k = sampling_k
self.sampling = FarthestpointSampling(K=self.sampling_k)
self.root = Path(root)
self.raw = root / 'raw'
self.processed_ext = '.pik'
self.raw_ext = '.xyz'
self.processed = root / self.setting
self._files = list(self.raw.glob(f'*{self.setting}*'))
def __len__(self):
raise NotImplementedError
def __getitem__(self, item):
raise NotImplementedError