code: def main(args):
      # Convert recordio to ofrecord
      imgrec, imgidx_list = load_train_data(data_dir=args.data_dir)
  
      output_dir = os.path.join(args.output_filepath, "train")
      if not os.path.exists(output_dir):
          os.makedirs(output_dir)
      output_file = os.path.join(output_dir, "part-0")
      with open(output_file, "wb") as f:
          for idx in imgidx_list:
              if idx % 10000 == 0:
                  print(
                      "Converting images: {} of {}".format(
                          idx, len(imgidx_list)
                      )
                  )
  
              img_data = {}
              rec = imgrec.read_idx(idx)
              header, s = recordio.unpack(rec)
              img_data["label"] = int(header.label[0])
              img_data["pixel_data"] = s
  
              example = convert_to_ofrecord(img_data)
              print("shape", len(img_data["pixel_data"]))
              size = example.ByteSize()
              f.write(struct.pack("q", size))
              f.write(example.SerializeToString())
  
file_path: insightface/recognition/arcface_oneflow/tools/mx_recordio_2_ofrecord.py
imports: import os
  import sys
  import struct
  import argparse
  from mxnet import recordio
  import oneflow.core.record.record_pb2
label_desc: Use image node_id 4 for calling a global function with example usage: main(args) without return types