-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Normalization for object detection #2397
Comments
Hey, So, the issue is that we embed the normalization (and other transforms) inside the model itself, see vision/torchvision/models/detection/transform.py Lines 104 to 105 in e212cc8
This inconsistency is unfortunate, but was kind of necessary in order to make it easier for users to use the detection models. My thinking was that we might want at some point in the future to make all the models have data transformations inside them, as the way you normalize the inputs is tied with the pre-trained weights that we provide. For now, I think we might want to improve the documentation to potentially clarify any confusions |
OK, thanks. I also think it's worth updating the docs. |
@mattans We are happy to accept a PR for that. Would you like to send one? |
Yes, I will do it in the following days. Thank you very much. |
Just to make sure: @fmassa , what will happen if I use the object detection models without pretraining? Will it still auto-normalize the inputs? |
Yes. The normalization transform is "hard coded" into the models: vision/torchvision/models/detection/faster_rcnn.py Lines 227 to 233 in 131ba13
Yes. The model is created the same for training and inference vision/references/detection/train.py Lines 95 to 98 in 131ba13
and the transform is also applied unconditionally:
|
Migrated from discuss.pytorch.org. Requests were made by @mattans.
📚 Documentation
The reference implementations for classification, segmentation, and video classification all use a normalization transform. In contrast, object detection does not use any normalization.
The text was updated successfully, but these errors were encountered: