class_docstr: `Cityscapes <http://www.cityscapes-dataset.com/>`_ Dataset.
  
  Args:
      root (string): Root directory of dataset where directory ``leftImg8bit``
          and ``gtFine`` or ``gtCoarse`` are located.
      split (string, optional): The image split to use, ``train``, ``test`` or ``val`` if mode="fine"
          otherwise ``train``, ``train_extra`` or ``val``
      mode (string, optional): The quality mode to use, ``fine`` or ``coarse``
      target_type (string or list, optional): Type of target to use, ``instance``, ``semantic``, ``polygon``
          or ``color``. Can also be a list to output a tuple with all specified target types.
      transform (callable, optional): A function/transform that takes in a PIL image
          and returns a transformed version. E.g, ``transforms.RandomCrop``
      target_transform (callable, optional): A function/transform that takes in the
          target and transforms it.
      transforms (callable, optional): A function/transform that takes input sample and its target as entry
          and returns a transformed version.
  
  Examples:
  
      Get semantic segmentation target
  
      .. code-block:: python
  
          dataset = Cityscapes('./data/cityscapes', split='train', mode='fine',
                               target_type='semantic')
  
          img, smnt = dataset[0]
  
      Get multiple targets
  
      .. code-block:: python
  
          dataset = Cityscapes('./data/cityscapes', split='train', mode='fine',
                               target_type=['instance', 'color', 'polygon'])
  
          img, (inst, col, poly) = dataset[0]
  
      Validate on the "coarse" set
  
      .. code-block:: python
  
          dataset = Cityscapes('./data/cityscapes', split='val', mode='coarse',
                               target_type='semantic')
  
          img, smnt = dataset[0]
class_docstr_tok: ["`","Cityscapes","<","http",":","\/\/www.cityscapes-dataset.com\/",">","`","_","Dataset",".","Args",":","root","(","string",")",":","Root","directory","of","dataset","where","directory","``","leftImg8bit","``","and","``","gtFine","``","or","``","gtCoarse","``","are","located",".","split","(","string",",","optional",")",":","The","image","split","to","use",",","``","train","``",",","``","test","``","or","``","val","``","if","mode=","''","fine","''","otherwise","``","train","``",",","``","train_extra","``","or","``","val","``","mode","(","string",",","optional",")",":","The","quality","mode","to","use",",","``","fine","``","or","``","coarse","``","target_type","(","string","or","list",",","optional",")",":","Type","of","target","to","use",",","``","instance","``",",","``","semantic","``",",","``","polygon","``","or","``","color","``",".","Can","also","be","a","list","to","output","a","tuple","with","all","specified","target","types",".","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","a","PIL","image","and","returns","a","transformed","version",".","E.g",",","``","transforms.RandomCrop","``","target_transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","the","target","and","transforms","it",".","transforms","(","callable",",","optional",")",":","A","function\/transform","that","takes","input","sample","and","its","target","as","entry","and","returns","a","transformed","version",".","Examples",":","Get","semantic","segmentation","target","..","code-block",":",":","python","dataset","=","Cityscapes","(","'.\/data\/cityscapes","'",",","split='train","'",",","mode='fine","'",",","target_type='semantic","'",")","img",",","smnt","=","dataset","[","0","]","Get","multiple","targets","..","code-block",":",":","python","dataset","=","Cityscapes","(","'.\/data\/cityscapes","'",",","split='train","'",",","mode='fine","'",",","target_type=","[","'instance","'",",","'color","'",",","'polygon","'","]",")","img",",","(","inst",",","col",",","poly",")","=","dataset","[","0","]","Validate","on","the","``","coarse","''","set","..","code-block",":",":","python","dataset","=","Cityscapes","(","'.\/data\/cityscapes","'",",","split='val","'",",","mode='coarse","'",",","target_type='semantic","'",")","img",",","smnt","=","dataset","[","0","]"]
code: def __len__(self) -> int:
      return len(self.images)
  
file_path: vision/torchvision/datasets/cityscapes.py
imports: import json
  import os
  from collections import namedtuple
  from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  from PIL import Image
  from .utils import extract_archive, iterable_to_str, verify_str_arg
  from .vision import VisionDataset
label_desc: Use image node_id 3 for calling the Cityscapes obj's underlying member method code with example usage: obj.__len__() and returns: len