-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
Description
When using a dataset from alodataset, the items of the dataset are instances of aloscene.Frame and have often a lot properties. When solving a problem, we might :
- want to use data from different datasets, that do not have the same properties
- be interested in only a subset of the properties, that is available for both dataset
Simple example : merging two datasets
We want to train a flow model using data from multiple datasets.
Original datasets
dataset1 : stereo dataset with flow
- flow and disparity properties are not
None - baseline property is not
None
dataset2 : monocular flow
- only flow property ; disparity is
None - baseline is
None
Merged dataset
This can be done by creating an alodataset.MergeDataset to sample frames from both dataset. But when batching the frame, with aloscene.batch_list, we will encounter an error because of property baseline and child disparity.
Example of failing code
In the following code, the disparity and the occlusion of the flow are presented in only one of two datasets. This leads to an error during batch_list if the elements of the batch comes from both datasets.
from torch.utils.data.sampler import Sampler
from alodataset import FlyingThings3DSubsetDataset, MergeDataset
import aloscene
d1 = FlyingThings3DSubsetDataset(labels=["flow", "disp", "flow_occ"])
d2 = FlyingThings3DSubsetDataset(labels=["flow"])
d = MergeDataset([d1, d2])
for data in d.train_loader(batch_size=10):
break
data = aloscene.batch_list(data)