Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choice of required properties during call to batch_list #272

Open
jsalotti opened this issue Nov 17, 2022 · 0 comments
Open

Choice of required properties during call to batch_list #272

jsalotti opened this issue Nov 17, 2022 · 0 comments
Assignees
Labels
alobugdays aloscene aloscene enhancement New feature or request hard

Comments

@jsalotti
Copy link
Contributor

jsalotti commented Nov 17, 2022

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alobugdays aloscene aloscene enhancement New feature or request hard
Projects
None yet
Development

No branches or pull requests

1 participant