-
Notifications
You must be signed in to change notification settings - Fork 443
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
Refactoring visual prompting #3789
Refactoring visual prompting #3789
Conversation
4b58132
to
9f35628
Compare
5ffc596
to
c2f5e64
Compare
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 your work :) I think code becomes much clear. I left minor comments. Please take a look.
@kprokofi I discussed our current design with @eunwoosh and @harimkang, and they suggested using only one main model (YOLOX) instead of separating specific models (YOLOX-TINY, YOLOX-S, ...) because there are only a few different parameters in the same model family and we can just change them. We can change those values using a parameter container like below: |
My proposal was to unify all our models and tasks. Here I see that instead of creating separate classes and use simple So, @sungchul2 , @harimkang , @eunwoosh , are you proposing to use config based approach for all models rather than creating separate classes for each model size? |
I personally like the way you refactored VPT task (from the whole structure) and vote to stick such structure for other tasks as well. @eunwoosh @sungchul2 @harimkang, what concerns do you have regarding this example? |
I have only one question regarding postprocessing and other methods related to NN model. You put postprocessing in separate file and added methods related to NN model like freeze_network(), _embed_point(), etc to SAM class which inherited from OTXModel (as main parent). |
I think both directions have pros and cons respectively. |
Yes, I'm considering to move And, I think it is very important to distinguish functionalities between NNModel's and OTXModel's. |
Co-authored-by: Eunwoo Shin <[email protected]>
Therefore, this is considered to be a detriment to flexibility. In such cases, it might make sense to have one class that can be distinguished by the argument What me and Sungchul and Eunwoo were talking about was what would be appropriate to apply to the entire model class of OTX, and I mentioned the big drawback of |
It may look dicts parameter and regression, but I think it's different than that. I think it's rather similar to what you said, providing a class w/ default parameter. I think the point is whether API provides interface to set configuration using dict. I think current design just provides interface to set backbone using backbone name. So, user who want to use the model w/ other backbone can do that with single argument. So, in my thought, drawback of 'before' design is that backbone initialization is a little bit hidden because it's conducted in factory function rather than aggravating API. This is my thought and it may be wrong. Please correct me if it is or tell me your opinion :) |
I agree with both directions, and it's up to us to decide. Using a parameter container like dict is similar with mmlab direction. And separating classes that can have different parameters or modules is similar with torchvision and timm. |
But I cannot agree with @harimkang comment below, because I think we have to have a unified structure across all tasks, not having a flexible structure depending on tasks.
If there is any one model that is difficult to handle with a parameter container, we have no choice but to choose @kprokofi's opinion. |
With these examples Sungchul gave, it seems to me that the way mmlab or another library does it is the right way to go. |
@kprokofi For this case about moving |
@sungchul2 Can we add postprocess as method for SegmentAnything model? Why circular import occurred? "get_prepadded_size" can be auxiliary function inside postprocess method. |
Both |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3789 +/- ##
===========================================
- Coverage 80.63% 80.48% -0.15%
===========================================
Files 272 274 +2
Lines 27507 27541 +34
===========================================
- Hits 22180 22167 -13
- Misses 5327 5374 +47
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
d77423e
Summary
This PR includes:
Refine directory structure and merge fine-tuning and zero-shot into a single file
Rename
OTXSegmentAnything
toSAM
and move common modules toOTXVisualPromptingModel
Move functions related to OTX functionalities to
OTXModel
Enable for NNModel to get loss module
How to test
Checklist
License
Feel free to contact the maintainers if that's a concern.