-
Notifications
You must be signed in to change notification settings - Fork 31.9k
[Maskformer] Add MaskFormerSwin backbone #20344
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
[Maskformer] Add MaskFormerSwin backbone #20344
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
ac15e04 to
692be5a
Compare
sgugger
left a comment
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.
Thanks for working on this, it makes the code of Maskformer much cleaner!
src/transformers/models/maskformer/configuration_maskformer_swin.py
Outdated
Show resolved
Hide resolved
| super().__init__() | ||
| self.encoder = MaskFormerSwinTransformerBackbone(config.backbone_config) | ||
|
|
||
| # TODD: add method to load pretrained weights of backbone |
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.
That's not the job the init, it's more the job of from_pretrained.
322dd71 to
8119850
Compare
src/transformers/models/maskformer/configuration_maskformer_swin.py
Outdated
Show resolved
Hide resolved
* First draft * Fix backwards compatibility * More fixes * More fixes * Make backbone more general * Improve backbone * Improve test * Fix config checkpoint * Address comments * Use model_type * Address more comments * Fix special model names * Remove MaskFormerSwinModel and MaskFormerSwinPreTrainedModel from main init * Fix typo * Update backbone * Apply suggestion Co-authored-by: Niels Rogge <[email protected]>
What does this PR do?
This is part 2 of 3 of the big #20204 PR.
This PR adds MaskFormerSwin to the AutoBackbone API. This ensures that the model can be used as backbone with the MaskFormer framework.
As it makes more sense to move MaskFormerSwin to its own modeling files, this PR implements it in a separate
modeling_maskformer_swin.pyfile, along with a configuration implemented inconfiguration_maskformer_swin.py.To do: