class_docstr: Runs an image through [ResNet](https://api.semanticscholar.org/CorpusID:206594692),
  as implemented by [torchvision](https://pytorch.org/docs/stable/torchvision/models.html).
class_docstr_tok: ["Runs","an","image","through","[","ResNet","]","(","https",":","\/\/api.semanticscholar.org\/CorpusID:206594692",")",",","as","implemented","by","[","torchvision","]","(","https",":","\/\/pytorch.org\/docs\/stable\/torchvision\/models.html",")","."]
code: def __init__(self) -> None:
      super().__init__()
      detection_model = (
          torchvision.models.detection.fasterrcnn_resnet50_fpn(
              pretrained=True
          )
      )
      self.backbone = detection_model.backbone
      # Don't need the rest of this.
      del detection_model
      self.feature_names = tuple(
          [
              self.backbone.body.return_layers[key]
              for key in self.backbone.body.keys()
              if key in self.backbone.body.return_layers
          ]
          + ["pool"]
      )
  
file_path: allennlp/allennlp/modules/vision/grid_embedder.py
imports: from collections import OrderedDict
  from typing import Tuple
  from torch import nn, FloatTensor, IntTensor
  import torchvision
  from allennlp.common.registrable import Registrable
label_desc: Use image node_id 1 to create a new ResnetBackbone object from inherited base classes: GridEmbedder with example: obj = ResnetBackbone()