class_docstr: CityScapes metric for instance segmentation.
  
  Args:
      outfile_prefix (str): The prefix of txt and png files. The txt and
          png file will be save in a directory whose path is
          "outfile_prefix.results/".
      seg_prefix (str, optional): Path to the directory which contains the
          cityscapes instance segmentation masks. It's necessary when
          training and validation. It could be None when infer on test
          dataset. Defaults to None.
      format_only (bool): Format the output results without perform
          evaluation. It is useful when you want to format the result
          to a specific format and submit it to the test server.
          Defaults to False.
      collect_device (str): Device name used for collecting results from
          different ranks during distributed training. Must be 'cpu' or
          'gpu'. Defaults to 'cpu'.
      prefix (str, optional): The prefix that will be added in the metric
          names to disambiguate homonymous metrics of different evaluators.
          If prefix is not provided in the argument, self.default_prefix
          will be used instead. Defaults to None.
      dump_matches (bool): Whether dump matches.json file during evaluating.
          Defaults to False.
      file_client_args (dict, optional): Arguments to instantiate the
          corresponding backend in mmdet <= 3.0.0rc6. Defaults to None.
      backend_args (dict, optional): Arguments to instantiate the
          corresponding backend. Defaults to None.
class_docstr_tok: ["CityScapes","metric","for","instance","segmentation",".","Args",":","outfile_prefix","(","str",")",":","The","prefix","of","txt","and","png","files",".","The","txt","and","png","file","will","be","save","in","a","directory","whose","path","is","``","outfile_prefix.results\/","''",".","seg_prefix","(","str",",","optional",")",":","Path","to","the","directory","which","contains","the","cityscapes","instance","segmentation","masks",".","It","'s","necessary","when","training","and","validation",".","It","could","be","None","when","infer","on","test","dataset",".","Defaults","to","None",".","format_only","(","bool",")",":","Format","the","output","results","without","perform","evaluation",".","It","is","useful","when","you","want","to","format","the","result","to","a","specific","format","and","submit","it","to","the","test","server",".","Defaults","to","False",".","collect_device","(","str",")",":","Device","name","used","for","collecting","results","from","different","ranks","during","distributed","training",".","Must","be","'cpu","'","or","'gpu","'",".","Defaults","to","'cpu","'",".","prefix","(","str",",","optional",")",":","The","prefix","that","will","be","added","in","the","metric","names","to","disambiguate","homonymous","metrics","of","different","evaluators",".","If","prefix","is","not","provided","in","the","argument",",","self.default_prefix","will","be","used","instead",".","Defaults","to","None",".","dump_matches","(","bool",")",":","Whether","dump","matches.json","file","during","evaluating",".","Defaults","to","False",".","file_client_args","(","dict",",","optional",")",":","Arguments","to","instantiate","the","corresponding","backend","in","mmdet","<","=","3.0.0rc6",".","Defaults","to","None",".","backend_args","(","dict",",","optional",")",":","Arguments","to","instantiate","the","corresponding","backend",".","Defaults","to","None","."]
docstr: Clean up the results if necessary.
docstr_tok: ["Clean","up","the","results","if","necessary","."]
code: def __del__(self) -> None:
      """Clean up the results if necessary."""
      if self.tmp_dir is not None:
          self.tmp_dir.cleanup()
  
file_path: mmdetection/mmdet/evaluation/metrics/cityscapes_metric.py
imports: import os
  import os.path
  import shutil
  import tempfile
  from collections import OrderedDict
  from typing import Dict, Optional, Sequence
  import mmcv
  import numpy
  from mmengine.dist import is_main_process
  from mmengine.evaluator import BaseMetric
  from mmengine.logging import MMLogger
  from mmdet.registry import METRICS
label_desc: Use image node_id 2 for calling the CityScapesMetric obj's underlying member method code with example usage: obj.__del__() without return types