docstr: Predict values for the label column of new data.
  
  Parameters
  ----------
  data
      The data to make predictions for. Should contain same column names as training data and
      follow same format (except for the `label` column).
  realtime
      Whether to do realtime inference, which is efficient for small data (default False).
      If provided None, we would infer it on based on the data modalities
      and sample number.
  save_results
      Whether to save the prediction results.
  
  Returns
  -------
  Array of predictions, one corresponding to each row in given dataset.
  When save_results is True, the output is a pandas dataframe containing the path of the predicted mask file for each input image.
  Otherwise, the output will have shape (#samples, height, width).
code: def predict(
      self,
      data: Union[pd.DataFrame, dict, list, str],
      realtime: Optional[bool] = False,
      save_results: Optional[bool] = None,
      **kwargs,
  ):
      """
      Predict values for the label column of new data.
  
      Parameters
      ----------
      data
          The data to make predictions for. Should contain same column names as training data and
          follow same format (except for the `label` column).
      realtime
          Whether to do realtime inference, which is efficient for small data (default False).
          If provided None, we would infer it on based on the data modalities
          and sample number.
      save_results
          Whether to save the prediction results.
  
      Returns
      -------
      Array of predictions, one corresponding to each row in given dataset.
      When save_results is True, the output is a pandas dataframe containing the path of the predicted mask file for each input image.
      Otherwise, the output will have shape (#samples, height, width).
      """
      data = self.on_predict_start(data)
      if self._output_shape == 1:
          ret_type = LOGITS
      else:
          ret_type = SEMANTIC_MASK
  
      outputs = self.predict_per_run(
          data=data,
          realtime=realtime,
          requires_label=False,
      )
  
      logits = self.post_process_prediction(data, outputs, ret_type)
  
      pred = []
      for logit in logits:
          logit = logit.numpy()
          if ret_type == SEMANTIC_MASK:
              pred.append(logit.argmax(axis=1))
          else:
              pred.append((logit > 0.5).squeeze(axis=1))
  
      if save_results:
          self._save_path = setup_save_path(
              old_save_path=self._save_path,
              warn_if_exist=False,
          )
          pred = self.save_segmentation_result(
              pred=pred,
              data=data,
              result_path=self._save_path,
          )
  
      return pred
  
imports: import logging
  import os
  from typing import Dict, Iterable, List, Optional, Union
  import matplotlib.pyplot
  import numpy
  import pandas
  import torch
  import torch.nn.functional
  from omegaconf import OmegaConf
  from PIL import Image
  from scipy.special import softmax
  from autogluon.core.metrics import Scorer
  from ..constants import LABEL, LOGITS, SEMANTIC_MASK, SEMANTIC_SEGMENTATION, SEMANTIC_SEGMENTATION_IMG
  from ..optimization.lit_semantic_seg import SemanticSegmentationLitModule
  from ..optimization.semantic_seg_metrics import Balanced_Error_Rate_Pred
  from ..optimization.semantic_seg_metrics import Binary_IoU_Pred
  from ..optimization.semantic_seg_metrics import COD_METRICS_NAMES_Pred
  from ..optimization.semantic_seg_metrics import Multiclass_IoU_Pred
  from ..optimization.utils import get_loss_func, get_norm_layer_param_names, get_trainable_params_efficient_finetune
  from ..utils import extract_from_output, setup_save_path
  from .base import BaseLearner
  from ..constants import BER, EM, FM, IOU, MAE, SEMANTIC_SEGMENTATION, SM
label_desc: Use image node_id 10 for calling the SemanticSegmentationLearner obj's underlying member method code with example usage: obj.predict(data, realtime, save_results) and returns: pred