class_docstr: ImageNet dataset.
class_docstr_tok: ["ImageNet","dataset","."]
code: def _prepare_im_res(self, im_path):
      # Prepare resnet style augmentation.
      im = self.load_image(im_path)
      # Train and test setups differ
      train_size, test_size = (
          self.cfg.DATA.TRAIN_CROP_SIZE,
          self.cfg.DATA.TEST_CROP_SIZE,
      )
      if self.mode == "train":
          # For training use random_sized_crop, horizontal_flip, augment, lighting
          im = transform.random_sized_crop_img(
              im,
              train_size,
              jitter_scale=self.cfg.DATA.TRAIN_JITTER_SCALES_RELATIVE,
              jitter_aspect=self.cfg.DATA.TRAIN_JITTER_ASPECT_RELATIVE,
          )
          im, _ = transform.horizontal_flip(prob=0.5, images=im)
          # im = transforms.augment(im, cfg.TRAIN.AUGMENT)
          im = transform.lighting_jitter(
              im,
              0.1,
              self.cfg.DATA.TRAIN_PCA_EIGVAL,
              self.cfg.DATA.TRAIN_PCA_EIGVEC,
          )
      else:
          # For testing use scale and center crop
          im, _ = transform.uniform_crop(
              im, test_size, spatial_idx=1, scale_size=train_size
          )
      # For training and testing use color normalization
      im = transform.color_normalization(
          im, self.cfg.DATA.MEAN, self.cfg.DATA.STD
      )
      return im
  
imports: import json
  import numpy
  import os
  import random
  import re
  import torch
  import torch.utils.data
  from PIL import Image
  from torchvision import transforms
  import slowfast.datasets.transform
  import slowfast.utils.logging
  from slowfast.models.utils import calc_mvit_feature_geometry
  from slowfast.utils.env import pathmgr
  from .build import DATASET_REGISTRY
  from .transform import MaskingGenerator, transforms_imagenet_train
label_desc: Use image node_id 5 for calling the Imagenet obj's underlying member method code with example usage: obj._prepare_im_res(im_path) and returns: im