class_docstr: First version of Epistemic computation used as active learning strategy
class_docstr_tok: ["First","version","of","Epistemic","computation","used","as","active","learning","strategy"]
code: def infer_seg(self, data, model, roi_size, sw_batch_size):
      pre_transforms = (
          None
          if not self.transforms
          else self.transforms
          if isinstance(self.transforms, Compose)
          else Compose(self.transforms)
      )
      # data = run_transforms(data, pre_transforms, log_prefix="EPISTEMIC-PRE") if pre_transforms else data
      if pre_transforms:
          data = pre_transforms(data)
  
      with torch.no_grad():
          preds = sliding_window_inference(
              inputs=data["image"][None].to(self.device),
              roi_size=roi_size,
              sw_batch_size=sw_batch_size,
              predictor=model,
          )
  
      soft_preds = (
          torch.softmax(preds, dim=1)
          if preds.shape[1] > 1
          else torch.sigmoid(preds)
      )
      soft_preds = soft_preds.detach().to("cpu").numpy()
      return soft_preds
  
file_path: MONAILabel/monailabel/tasks/scoring/epistemic.py
imports: import copy
  import logging
  import os
  import time
  import numpy
  import torch
  from monai.inferers import sliding_window_inference
  from monai.transforms import Compose
  from monai.utils import deprecated
  from monailabel.interfaces.datastore import Datastore
  from monailabel.interfaces.tasks.scoring import ScoringMethod
label_desc: Use image node_id 2 for calling the EpistemicScoring obj's underlying member method code with example usage: obj.infer_seg(data, model, roi_size, sw_batch_size) and returns: soft_preds