示例#1
0
    def __getitem__(self, index):
        """Returns the item at index idx. """
        category = torch.tensor(self.cat_idxs[index],
                                dtype=torch.long,
                                device=self.device)
        data = TriangleMesh.from_off(self.filepaths[index])
        data.to(self.device)
        if self.transform:
            data = self.transform(data)

        return data, category
示例#2
0
def load_all():
    base = Path('data/ModelNet40')
    all_models = list(base.glob('**/*.off'))
    bad = []
    for model in all_models:
        try:
            data = TriangleMesh.from_off(model)
            samp = data.sample(16)
        except:
            print(model)
            bad.append(model)
            raise
    print(bad)
示例#3
0
 def _get_data(self, index):
     data = TriangleMesh.from_off(self.filepaths[index])
     return data