-
Notifications
You must be signed in to change notification settings - Fork 7.1k
add a vision_collate function that honours prototype features #6680
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
base: main
Are you sure you want to change the base?
Conversation
|
||
vision_collate_fn_map = { | ||
(Image, Mask, Label, OneHotLabel): new_like_collate_fn, | ||
type(None): no_collate_fn, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this for #5233.
@@ -0,0 +1,29 @@ | |||
from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Type, Union |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've put this into features
for now, put when everything is rolled out it should probably be in datasets
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in terms of vision_collate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we should avoid adding collate methods directly in TorchVision. One option is to keep it on the references. That's something that we plan to discuss with @pmeier once he is back from PTO. The discussion can go either way so, everything is on the table.
I'm going to mark the PR with "request changes" to avoid accidental merges (since 1 approval = merge). After we sync with Philip, we can unblock this. 😃
Addresses #6433 (comment). I've intentionally left out the collation function, since we just use
vision/references/detection/utils.py
Lines 203 to 204 in 07ae61b
which is completely separated from
default_collate
. We might provide it publicly later on as well.