class_docstr: IntermediateLayerGetter borrowed from torchvision
  
  Args:
      model (`nn.Module`):
          model on which we will extract the features.
      return_layers(`Dict`):
          a dict containing the names
          of the modules for which the activations will be returned as
          the key of the dict, and the value of the dict is the name
          of the returned activation (which the user can specify).
class_docstr_tok: ["IntermediateLayerGetter","borrowed","from","torchvision","Args",":","model","(","`","nn.Module","`",")",":","model","on","which","we","will","extract","the","features",".","return_layers","(","`","Dict","`",")",":","a","dict","containing","the","names","of","the","modules","for","which","the","activations","will","be","returned","as","the","key","of","the","dict",",","and","the","value","of","the","dict","is","the","name","of","the","returned","activation","(","which","the","user","can","specify",")","."]
code: def __init__(
      self, model: nn.Module, return_layers: Dict[str, str]
  ) -> None:
      if not set(return_layers).issubset(
          [name for name, _ in model.named_children()]
      ):
          raise ValueError("return_layers are not present in model")
      orig_return_layers = return_layers
      return_layers = {str(k): str(v) for k, v in return_layers.items()}
      layers = OrderedDict()
      for name, module in model.named_children():
          layers[name] = module
          if name in return_layers:
              del return_layers[name]
          if not return_layers:
              break
  
      super().__init__(layers)
      self.return_layers = orig_return_layers
  
file_path: towhee/towhee/models/retina_face/utils.py
imports: from typing import Dict
  from collections import OrderedDict
  import torch
  from torch import nn
label_desc: Use image node_id 1 to create a new IntermediateLayerGetter object from inherited base classes: nn with example: obj = IntermediateLayerGetter(model, return_layers)