code: def __init__(self):
      self.resnet50 = (
          models.resnet50(weights=ResNet50_Weights.DEFAULT)
          .eval()
          .to("cpu")
      )
      self.preprocess = transforms.Compose(
          [
              transforms.Resize(256),
              transforms.CenterCrop(224),
              transforms.ToTensor(),
              transforms.Normalize(
                  mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]
              ),
          ]
      )
      resp = requests.get(
          "https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt"
      )
      self.categories = resp.content.decode("utf-8").split("\n")
  
file_path: ray/doc/source/serve/doc_code/resnet50_example.py
imports: import requests
  from io import BytesIO
  from PIL import Image
  import starlette.requests
  import torch
  from torchvision import transforms
  import torchvision.models
  from torchvision.models import ResNet50_Weights
  from ray import serve
label_desc: Use image node_id 1 to create a new Model object  with example: obj = Model()