code: def test_get_segments_from_frame_predictions(
      self,
      score_threshold,
      expected_class_indices,
      expected_class_probs,
      expected_segments,
  ):
      class_probs = np.array(
          [
              [0.9, 0.1, 0.2],
              [0.1, 0.1, 0.2],
              [0.6, 0.3, 0.2],
              [0.1, 0.8, 0.2],
          ]
      )
      displacements = np.array(
          [
              [[0.5, 0.5], [0.1, 0.1], [0.2, 0.2]],
              [[0.1, 0.2], [0.1, 0.2], [0.2, 0.3]],
              [[0.5, 0.5], [0.1, 0.1], [0.2, 0.2]],
              [[0.1, 0.2], [0.1, 0.2], [0.2, 0.3]],
          ]
      )
      input_mask = np.array([1, 1, 1, 0], dtype=np.int32)
      total_frames = 16
      (
          actual_class_indices,
          actual_class_probs,
          actual_segments,
      ) = postprocessing_utils.get_segments_from_frame_predictions(
          class_probs,
          displacements,
          input_mask=input_mask,
          total_frames=total_frames,
          stride=1,
          displacement_normalizer="sampled_span",
          secs_per_timestep=1.0,
          score_threshold=score_threshold,
      )
      self.assertAllEqual(actual_class_indices, expected_class_indices)
      self.assertAllClose(actual_class_probs, expected_class_probs)
      self.assertAllClose(actual_segments, expected_segments)
  
file_path: scenic/scenic/projects/unloc/postprocessing_utils_test.py
imports: from absl.testing import parameterized
  import ml_collections
  import numpy
  from scenic.projects.unloc import metrics
  from scenic.projects.unloc import postprocessing_utils
  import tensorflow
label_desc: Use image node_id 3 for calling the PostprocessingUtilsTest obj's underlying member method code with example usage: obj.test_get_segments_from_frame_predictions(score_threshold, expected_class_indices, expected_class_probs, expected_segments) without return types