Output layer names for feature extractor #480
-
I want to get the names of layers/blocks giving the output in feature extractors.
Now, I want to get the layer/block/stage names giving these outputs. How can I do that? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
@code-demoe it's all in the feature_info object of the model after it's been created... any of the getters used below will by default return the values for the specified out_indices, but you can request the info for specific indices, including those that weren't selected if you want.
|
Beta Was this translation helpful? Give feedback.
-
This interface was designed so the models that consume these as backbones can be completely dynamic without requiring hard coded values, they can just query the backbone. |
Beta Was this translation helpful? Give feedback.
@code-demoe it's all in the feature_info object of the model after it's been created... any of the getters used below will by default return the values for the specified out_indices, but you can request the info for specific indices, including those that weren't selected if you want.
https://github.com/rwightman/pytorch-image-models/blob/f1f332fee50aa29c435b56cef16e137b6a6ca246/timm/models/features.py#L20-L82