class_docstr: Extract image feature using pretrained CNN network.
class_docstr_tok: ["Extract","image","feature","using","pretrained","CNN","network","."]
code: def __init__(self, opt):
      self.opt = opt.copy()
      self.use_cuda = False
      self.netCNN = None
      self.image_mode = opt.get("image_mode", "no_image_model")
      self.use_cuda = (
          not self.opt.get("no_cuda", False)
          and torch.cuda.is_available()
      )
      if self.image_mode not in ["no_image_model", "raw", "ascii"]:
          if "image_mode" not in opt or "image_size" not in opt:
              raise RuntimeError(
                  "Need to add image arguments to opt. See "
                  "parlai.core.params.ParlaiParser.add_image_args"
              )
          self.image_size = opt["image_size"]
          self.crop_size = opt["image_cropsize"]
          self._init_transform()
          if "resnet" in self.image_mode:
              self._init_resnet_cnn()
          elif "resnext" in self.image_mode:
              self._init_resnext_cnn()
          else:
              raise RuntimeError(
                  "Image mode {} not supported".format(self.image_mode)
              )
  
imports: import parlai.core.build_data
  import parlai.utils.logging
  from parlai.utils.io import PathManager
  import os
  from PIL import Image
  import torch
  from zipfile import ZipFile
label_desc: Use image node_id 1 to create a new ImageLoader object  with example: obj = ImageLoader(opt)