class_docstr: Display and save evaluation results.
  
  Args:
      show (bool): Whether to show the image. Default: True.
      wait_time (float): Value of waitKey param. Default: 0.
      score_thr (float): Minimum score of bboxes to be shown.
         Default: 0.
      runner (:obj:`Runner`): The runner of the visualization process.
class_docstr_tok: ["Display","and","save","evaluation","results",".","Args",":","show","(","bool",")",":","Whether","to","show","the","image",".","Default",":","True",".","wait_time","(","float",")",":","Value","of","waitKey","param",".","Default",":","0.","score_thr","(","float",")",":","Minimum","score","of","bboxes","to","be","shown",".","Default",":","0.","runner","(",":","obj",":","`","Runner","`",")",":","The","runner","of","the","visualization","process","."]
docstr: Evaluate and show results.
  
  Args:
      dataset (Dataset): A PyTorch dataset.
      results (list): Object detection or panoptic segmentation
          results from test results pkl file.
      topk (int): Number of the highest topk and
          lowest topk after evaluation index sorting. Default: 20.
      show_dir (str, optional): The filename to write the image.
          Default: 'work_dir'
docstr_tok: ["Evaluate","and","show","results",".","Args",":","dataset","(","Dataset",")",":","A","PyTorch","dataset",".","results","(","list",")",":","Object","detection","or","panoptic","segmentation","results","from","test","results","pkl","file",".","topk","(","int",")",":","Number","of","the","highest","topk","and","lowest","topk","after","evaluation","index","sorting",".","Default",":","20.","show_dir","(","str",",","optional",")",":","The","filename","to","write","the","image",".","Default",":","'work_dir","'"]
code: def evaluate_and_show(
      self, dataset, results, topk=20, show_dir="work_dir"
  ):
      """Evaluate and show results.
  
      Args:
          dataset (Dataset): A PyTorch dataset.
          results (list): Object detection or panoptic segmentation
              results from test results pkl file.
          topk (int): Number of the highest topk and
              lowest topk after evaluation index sorting. Default: 20.
          show_dir (str, optional): The filename to write the image.
              Default: 'work_dir'
      """
  
      self.visualizer.dataset_meta = dataset.metainfo
  
      assert topk > 0
      if (topk * 2) > len(dataset):
          topk = len(dataset) // 2
  
      good_dir = osp.abspath(osp.join(show_dir, "good"))
      bad_dir = osp.abspath(osp.join(show_dir, "bad"))
  
      if "pred_panoptic_seg" in results[0].keys():
          good_samples, bad_samples = self.panoptic_evaluate(
              dataset, results, topk=topk
          )
          self._save_image_gts_results(
              dataset, results, good_samples, good_dir, task="seg"
          )
          self._save_image_gts_results(
              dataset, results, bad_samples, bad_dir, task="seg"
          )
      elif "pred_instances" in results[0].keys():
          good_samples, bad_samples = self.detection_evaluate(
              dataset, results, topk=topk
          )
          self._save_image_gts_results(
              dataset, results, good_samples, good_dir, task="det"
          )
          self._save_image_gts_results(
              dataset, results, bad_samples, bad_dir, task="det"
          )
      else:
          raise "expect 'pred_panoptic_seg' or 'pred_instances' \
                  in dict result"
  
imports: import argparse
  import os.path
  from multiprocessing import Pool
  import mmcv
  import numpy
  from mmengine.config import Config, DictAction
  from mmengine.fileio import load
  from mmengine.registry import init_default_scope
  from mmengine.runner import Runner
  from mmengine.structures import InstanceData, PixelData
  from mmengine.utils import ProgressBar, check_file_exist, mkdir_or_exist
  from mmdet.datasets import get_loading_pipeline
  from mmdet.evaluation import eval_map
  from mmdet.registry import DATASETS, RUNNERS
  from mmdet.structures import DetDataSample
  from mmdet.utils import replace_cfg_vals, update_data_root
  from mmdet.visualization import DetLocalVisualizer
label_desc: Use image node_id 3 for calling the ResultVisualizer obj's underlying member method code with example usage: obj.evaluate_and_show(dataset, results, topk, show_dir) without return types