class_docstr: Run prediction in multiple processes, on either CPU or GPU.
  Each process fetch datapoints as tasks and run predictions independently.
class_docstr_tok: ["Run","prediction","in","multiple","processes",",","on","either","CPU","or","GPU",".","Each","process","fetch","datapoints","as","tasks","and","run","predictions","independently","."]
code: def get_result(self):
      try:
          sz = len(self.dataset)
      except NotImplementedError:
          sz = 0
      with get_tqdm(total=sz, disable=(sz == 0)) as pbar:
          die_cnt = 0
          while True:
              res = self.result_queue.get()
              pbar.update()
              if res[0] != DIE:
                  yield res[1]
              else:
                  die_cnt += 1
                  if die_cnt == self.nr_proc:
                      break
      self.inqueue_proc.join()
      self.inqueue_proc.terminate()
      if self.ordered:  # if ordered, than result_queue is a Process
          self.result_queue.join()
          self.result_queue.terminate()
      for p in self.workers:
          p.join()
          p.terminate()
  
imports: import multiprocessing
  import os
  from abc import ABCMeta, abstractmethod
  import six
  from ..dataflow import DataFlow
  from ..dataflow.remote import dump_dataflow_to_process_queue
  from ..utils import logger
  from ..utils.develop import HIDE_DOC
  from ..utils.concurrency import DIE, OrderedResultGatherProc, ensure_proc_terminate
  from ..utils.gpu import change_gpu, get_num_gpu
  from ..utils.utils import get_tqdm
  from .base import OfflinePredictor
  from .concurrency import MultiProcessQueuePredictWorker
  from .config import PredictConfig
label_desc: Use image node_id 2 for calling the MultiProcessDatasetPredictor obj's underlying member method code with example usage: obj.get_result() without return types