Skip to content
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

Where are the hooks among classes? #19

Closed
algoteam5 opened this issue Jul 26, 2021 · 9 comments
Closed

Where are the hooks among classes? #19

algoteam5 opened this issue Jul 26, 2021 · 9 comments

Comments

@algoteam5
Copy link

algoteam5 commented Jul 26, 2021

In your config file for train 65, I can see a class order like this:
ZeroShotMaskRCNN -> BackgroundAwareRPNHead -> SharedFCSemanticBBoxHead - > SemanticFCNMaskHead

They are classes located in mmdet/models, where are the hook functions that connect among those classes?

@zhengye1995
Copy link
Owner

See this code, the mmcv runner hooks all these components.

@algoteam5
Copy link
Author

So they are processed in order right? and what if I just want to run ZeroShotTwoStageDetector only? how would I change?

@zhengye1995
Copy link
Owner

In fact, ZeroShotTwoStageDetector is composed of Backbone, BackgroundAwareRPNHead, SharedFCSemanticBBoxHead and SemanticFCNMaskHead. Just like mask rcnn is also composed of similar modules.

@algoteam5
Copy link
Author

"In fact, ZeroShotTwoStageDetector is composed of Backbone, BackgroundAwareRPNHead, SharedFCSemanticBBoxHead and SemanticFCNMaskHead."
I checked the zero_shot_two_stage.py file and I didn't see where did you call these functions BackgroundAwareRPNHead, SharedFCSemanticBBoxHead.

@zhengye1995
Copy link
Owner

"In fact, ZeroShotTwoStageDetector is composed of Backbone, BackgroundAwareRPNHead, SharedFCSemanticBBoxHead and SemanticFCNMaskHead."
I checked the zero_shot_two_stage.py file and I didn't see where did you call these functions BackgroundAwareRPNHead, SharedFCSemanticBBoxHead.

Please See:
In zero_shot_two_stage:

  1. BackgroundAwareRPNHead: Instantiate,Forward

  2. SharedFCSemanticBBoxHead: Instantiate,Forward

  3. SemanticFCNMaskHead: Instantiate,Forward

@algoteam5
Copy link
Author

algoteam5 commented Jul 26, 2021

Oh we don't need to directly call BackgroundAwareRPNHead, SharedFCSemanticBBoxHead? How does builder know we wanted to call BackgroundAwareRPNHead and SharedFCSemanticBBoxHead from Registry?

@zhengye1995
Copy link
Owner

Yes, we don't need to directly call BackgroundAwareRPNHead, SharedFCSemanticBBoxHead. We pass the class name and the corresponding parameters from config file into zero_shot_two_stage, the the builder uses the class name like BackgroundAwareRPNHead to build it, see the build code here.

@algoteam5
Copy link
Author

algoteam5 commented Jul 26, 2021

You're awesome. I've got it. I was looking at the registry.py and was wondering that what is shared_head and how is it different from head?

@zhengye1995
Copy link
Owner

shared_head is a share head which is shared between bbox_head for detection and mask_head for instance segmentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants