import tensorflow as tf

    num_boxes = sample['num_boxes'].numpy()
    labeled_boxes_init = tf.gather(
      sample['groundtruth_boxes'], axis=1, indices=[1, 0, 3, 2]) * 256.0

    for _, metric in self.metrics.items():
      if isinstance(metric, ShapeAccuracyMetric):
        labels = sample['shapes']
        weights = tf.math.sign(labels + 1)  # -1 is mapped to zero, else 1
        metric.update(labels, detections['shapes_logits'], weights)
      elif isinstance(metric, BoxIoUMetric):
        scene_id = str(sample['scene_filename'].numpy(), 'utf-8')

        # Get ground truth boxes
        labeled_boxes = labeled_boxes_init
