code: def convert_blobs(exp_dir, out_dir):
      def convert_blob_value(blob_file_paths):
          # Exported values are lists of paths to .bin binary files, representing
          # the blobs in each sequence, for each blob sequence in the series.
          blobs = []
          for blob_file_path in blob_file_paths:
              if os.path.dirname(blob_file_path) != _BLOBS_DIR:
                  logging.warning(
                      "Skipping invalid blob file path %r",
                      blob_file_path,
                  )
                  continue
              with open(
                  os.path.join(exp_dir, blob_file_path), mode="rb"
              ) as f:
                  blobs.append(f.read())
          # Omit dtype; that's fine since read path ignores it anyway.
          blob_tensor = tensor_util.make_tensor_proto(
              values=blobs, shape=[len(blobs)]
          )
          return Summary.Value(tensor=blob_tensor)
  
      run_to_series = load_run_to_series(
          os.path.join(exp_dir, _BLOBS_FILE)
      )
      for run, series_list in run_to_series.items():
          w = create_writer_for_run(out_dir, run, "blobs")
          for series in series_list:
              tag = series["tag"]
              summary_metadata = base64.b64decode(
                  series["summary_metadata"]
              )
              points = zip(
                  series["points"]["steps"],
                  series["points"]["wall_times"],
                  series["points"]["blob_file_paths"],
              )
              for step, wall_time, blob_file_paths in points:
                  e = Event(step=step, wall_time=wall_time)
                  value = convert_blob_value(blob_file_paths)
                  if value is None:
                      continue
                  e.summary.value.append(value)
                  e.summary.value[0].tag = tag
                  e.summary.value[0].metadata.MergeFromString(
                      summary_metadata
                  )
                  w.add_event(e)
          w.close()
  
file_path: tensorboard/tensorboard/tools/convert_tbdev_export.py
imports: import argparse
  import base64
  import collections
  import json
  import logging
  import os
  import re
  import tempfile
  from tensorboard.compat.proto.event_pb2 import Event
  from tensorboard.compat.proto.summary_pb2 import Summary
  from tensorboard.summary.writer.event_file_writer import EventFileWriter
  from tensorboard.util import tensor_util
label_desc: Use image node_id 5 for calling a global function with example usage: convert_blobs(exp_dir, out_dir) and returns: Summary