code: def make_2d_boxes(
      segments: Array, np_backend: PyModule = np
  ) -> Array:
      """Make 2D boxes out of 1D segments.
  
      We reuse tf.image.non_max_suppression_with_scores() for non-maximal
      suppression, which takes 2D boxes.
  
      Args:
        segments: Temporal segments in shape (N, 2).
        np_backend: Numpy backend.
  
      Returns:
        2D boxes in shape (N, 4).
      """
      n = segments.shape[0]
      return np_backend.stack(
          [
              np_backend.zeros((n,), dtype=np_backend.float32),
              segments[:, 0],
              np_backend.ones((n,), dtype=np_backend.float32),
              segments[:, 1],
          ],
          axis=1,
      )
  
file_path: scenic/scenic/projects/unloc/postprocessing_utils.py
imports: from typing import Any, List, Optional, Tuple, Union
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.projects.unloc import model_utils
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: make_2d_boxes(segments, np_backend) and returns: np_backend