code: def multithread_predict_dataflow(dataflows, model_funcs):
      
      num_worker = len(model_funcs)
      assert len(dataflows) == num_worker
      if num_worker == 1:
          return predict_dataflow(dataflows[0], model_funcs[0])
      kwargs = {'thread_name_prefix': 'EvalWorker'} if sys.version_info.minor >= 6 else {}
      with ThreadPoolExecutor(max_workers=num_worker, **kwargs) as executor, \
              tqdm.tqdm(total=sum([df.size() for df in dataflows])) as pbar:
          futures = []
          for dataflow, pred in zip(dataflows, model_funcs):
              futures.append(executor.submit(predict_dataflow, dataflow, pred, pbar))
          all_results = list(itertools.chain(*[fut.result() for fut in futures]))
          return all_results
docs: Running multiple `predict_dataflow` in multiple threads, and aggregate the results.
  
      Args:
          dataflows: a list of DataFlow to be used in :func:`predict_dataflow`
          model_funcs: a list of callable to be used in :func:`predict_dataflow`
  
      Returns:
          list of dict, in the format used by
          `DetectionDataset.eval_or_save_inference_results`