code: def _predict_from_dl(
      predict_fn,
      model: nn.Module,
      infer_dl: DataLoader,
      keep_images: bool = False,
      show_pbar: bool = True,
      **predict_kwargs,
  ) -> List[Prediction]:
      all_preds = []
      for batch, records in pbar(infer_dl, show=show_pbar):
          preds = predict_fn(
              model=model,
              batch=batch,
              records=records,
              keep_images=keep_images,
              **predict_kwargs,
          )
          all_preds.extend(preds)
  
      return all_preds
  
file_path: icevision/icevision/models/utils.py
imports: from icevision.imports import *
  from icevision.utils import *
  from icevision.core import *
  from icevision.data import *
  from icevision.parsers import *
  from icevision.data.dataset import Dataset
label_desc: Use image node_id 7 for calling a global function with example usage: _predict_from_dl(predict_fn, model, infer_dl, keep_images, show_pbar) and returns: all_preds