class_docstr: Provide methods to access metadata for :class:`ILSVRC12` dataset.
class_docstr_tok: ["Provide","methods","to","access","metadata","for",":","class",":","`","ILSVRC12","`","dataset","."]
docstr: Args:
      name (str): 'train' or 'val' or 'test'
      dir_structure (str): same as in :meth:`ILSVRC12.__init__()`.
  Returns:
      list: list of (image filename, label)
docstr_tok: ["Args",":","name","(","str",")",":","'train","'","or","'val","'","or","'test'","dir_structure","(","str",")",":","same","as","in",":","meth",":","`","ILSVRC12.__init__","(",")","`",".","Returns",":","list",":","list","of","(","image","filename",",","label",")"]
code: def get_image_list(self, name, dir_structure="original"):
      """
      Args:
          name (str): 'train' or 'val' or 'test'
          dir_structure (str): same as in :meth:`ILSVRC12.__init__()`.
      Returns:
          list: list of (image filename, label)
      """
      assert name in ["train", "val", "test"]
      assert dir_structure in ["original", "train"]
      add_label_to_fname = (
          name != "train" and dir_structure != "original"
      )
      if add_label_to_fname:
          synset = self.get_synset_1000()
  
      fname = os.path.join(self.dir, name + ".txt")
      assert os.path.isfile(fname), fname
      with open(fname) as f:
          ret = []
          for line in f.readlines():
              name, cls = line.strip().split()
              cls = int(cls)
  
              if add_label_to_fname:
                  name = os.path.join(synset[cls], name)
  
              ret.append((name.strip(), cls))
      assert len(ret), fname
      return ret
  
imports: import numpy
  import os
  import tarfile
  import tqdm
  from pathlib import Path
  from ...utils import logger
  from ...utils.fs import download, get_dataset_path, mkdir_p
  from ...utils.loadcaffe import get_caffe_pb
  from ...utils.timer import timed_operation
  from ..base import RNGDataFlow
label_desc: Use image node_id 5 for calling the ILSVRCMeta obj's underlying member method code with example usage: obj.get_image_list(name, dir_structure) and returns: ret