code: def predict(
      model: Union[DetBenchTrain, DetBenchPredict],
      dataset: Dataset,
      detection_threshold: float = 0.5,
      keep_images: bool = False,
      device: Optional[torch.device] = None,
  ) -> List[Prediction]:
      batch, records = build_infer_batch(dataset)
      return _predict_batch(
          model=model,
          batch=batch,
          records=records,
          detection_threshold=detection_threshold,
          keep_images=keep_images,
          device=device,
      )
  
file_path: icevision/icevision/models/ross/efficientdet/prediction.py
imports: from icevision.imports import *
  from icevision.utils import *
  from icevision.core import *
  from icevision.data import *
  from icevision.models.utils import _predict_from_dl
  from icevision.models.ross.efficientdet.dataloaders import *
  from effdet import DetBenchTrain, DetBenchPredict, unwrap_bench
  from icevision.models.inference import *
label_desc: Use image node_id 2 for calling a global function with example usage: predict(model, dataset, detection_threshold, keep_images, device) and returns: _predict_batch