code: def main(unused_argv):
      shard_names = decode_sharded_names(FLAGS.input_tfrecord)
      for shard_name in shard_names:
          print("Processing", shard_name)
          raw_ds = tf.data.TFRecordDataset(shard_name)
          raw_data_iter = iter(raw_ds)
          shard_appendix = shard_name[
              -len(FILE_SUFFIX_PATTERN.format(0, 0)) :
          ]
          writer = tf.io.TFRecordWriter(
              f"{FLAGS.output_tfrecord}{shard_appendix}"
          )
          while True:
              try:
                  raw_data = next(raw_data_iter)
                  example = tf.train.SequenceExample.FromString(
                      raw_data.numpy()
                  )
              except:  # pylint: disable=bare-except
                  break
              video_data_path = (
                  example.context.feature["data_path"].bytes_list.value[
                      0
                  ]
              ).decode("utf-8")
              key = int(
                  video_data_path[
                      video_data_path.rfind("/") + 1 : -len(".webm")
                  ]
              )
              video_box_path = f"{FLAGS.bbox_folder}/{key}/"
              box_tensors = read_and_convert_boxes(video_box_path)
              example = process(example, ann=box_tensors)
              writer.write(example.SerializeToString())
          writer.close()
  
file_path: scenic/scenic/projects/objectvivit/tools/add_orvit_bbox_to_tfrecord.py
imports: import os
  from absl import app
  from absl import flags
  import numpy
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: main(unused_argv) without return types