class_docstr: Features generator for images.
  
  Uses ParlAI Image Loader.
class_docstr_tok: ["Features","generator","for","images",".","Uses","ParlAI","Image","Loader","."]
docstr: Get image features for given image id and Image.
  
  :param image_id:
      id for image
  :param image:
      PIL Image object
  
  :return image_features:
      Image Features Tensor
docstr_tok: ["Get","image","features","for","given","image","id","and","Image",".",":","param","image_id",":","id","for","image",":","param","image",":","PIL","Image","object",":","return","image_features",":","Image","Features","Tensor"]
code: def get_image_features(
      self, image_id: str, image: "PIL.Image"
  ) -> torch.Tensor:
      """
      Get image features for given image id and Image.
  
      :param image_id:
          id for image
      :param image:
          PIL Image object
  
      :return image_features:
          Image Features Tensor
      """
      image = image.convert("RGB")
      return self.image_loader.extract(image)
  
imports: import base64
  import io
  from typing import Dict, Union
  import PIL
  import torch
  from parlai.core.image_featurizers import ImageLoader
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from parlai.utils.typing import TShared
label_desc: Use image node_id 2 for calling the ImageFeaturesGenerator obj's underlying member method code with example usage: obj.get_image_features(image_id, image) and returns: self