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

Change DataLoader Collate Function #54

Open
ehofesmann opened this issue Feb 21, 2020 · 1 comment
Open

Change DataLoader Collate Function #54

ehofesmann opened this issue Feb 21, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@ehofesmann
Copy link
Member

Currently for datasets with bounding boxes, we need to specify the max bounding boxes possible so all output batches are of the same size:

self.max_objects = 38

What we should do is use a custom collate function in the DataLoader like used in the Pytorch detection tutorial:

https://github.com/pytorch/vision/blob/6c2cda6a0eda4c835f96f18bb2b3be5043d96ad2/references/detection/utils.py#L237

https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html

@ehofesmann ehofesmann added the enhancement New feature or request label Feb 21, 2020
@natlouis
Copy link
Collaborator

Yeah collate is very useful for zero-padding your samples when there's a different number of objects (or lengths in other cases).
But in my experience, it's specific to each problem. I'm not sure how it could generalize across all datasets if we add that to the DataLoader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants