-
Notifications
You must be signed in to change notification settings - Fork 27.3k
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
Add parameters to make custom backbone for detr #14933
Changes from 3 commits
8146214
15ba331
2815479
42624b2
9880a19
23986a3
aaacc2b
f267747
8ac8b66
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -155,6 +155,10 @@ def __init__( | |||||
bbox_loss_coefficient=5, | ||||||
giou_loss_coefficient=2, | ||||||
eos_coefficient=0.1, | ||||||
in_chans=3, | ||||||
pretrained=True, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
This can be renamed to |
||||||
freeze_layers=True, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would leave away this one, as there's already a method one can call on Maybe we can improve its documentation for visibility. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this parameter is more specific, it disables freezing 2-4 layer of resnet-50 (this was just hard coded into encoder initialisation), but I can change it if you think freeze_backbone is better anyway |
||||||
fix_batch_norm=True, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the reason you want to replace the frozen batch norm layers? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Training from scratch, I want to try training from fully randomly initialised model. Also I don't have pretrained backbone for my problem anyway, so I think this parameter won't harm |
||||||
**kwargs | ||||||
): | ||||||
self.num_queries = num_queries | ||||||
|
@@ -190,6 +194,10 @@ def __init__( | |||||
self.bbox_loss_coefficient = bbox_loss_coefficient | ||||||
self.giou_loss_coefficient = giou_loss_coefficient | ||||||
self.eos_coefficient = eos_coefficient | ||||||
self.in_chans = in_chans | ||||||
self.pretrained = pretrained | ||||||
self.freeze_layers = freeze_layers | ||||||
self.fix_batch_norm = fix_batch_norm | ||||||
super().__init__(is_encoder_decoder=is_encoder_decoder, **kwargs) | ||||||
|
||||||
@property | ||||||
|
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 would rename this to num_channels to be consistent with other models in the library (like ViT).