How to create PyTorch Dataset and Dataloader from multiple point cloud files #4089
-
Hi there, Awesome work on the repo! I have individual point cloud files (e.g a "per object" .txt or .las file containing the X,Y,Z's and a separate file for the target) - It's a multitask problem where each point cloud has 2 associated labels. I have been searching issues and looking for information but haven't come across much for this. Every repo for images and point clouds I would have thought the most important thing would be "train on custom dataset" or "dataloader for custom dataset". |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
For each point cloud, you would create an individual import pandas as pd
pos = torch.from_numpy(pd.read_csv(pos.txt).values).to(torch.float)
y = ... # read label into PyTorch tensor
data = Data(pos=pos, y=y) You can then simply hold that in a Python list or merge it into a PyG from torch_geometric.loader import DataLoader
loader = DataLoader([data1, data2, data3, ...], batch_size=16, ...) |
Beta Was this translation helpful? Give feedback.
For each point cloud, you would create an individual
data
object, e.g.:You can then simply hold that in a Python list or merge it into a PyG
InMemoryDataset
and pass it to theDataLoader
: