code: def main(argv):
      tf.logging.set_verbosity(FLAGS.log)
  
      config = configs.CONFIG_MAP[FLAGS.config]
      hparams = config.hparams
  
      for filename in argv[1:]:
          tf.logging.info("Generating spectrogram for %s...", filename)
  
          spec = create_spec(filename, hparams)
          spec_filename = filename + ".json"
          with tf.gfile.Open(spec_filename, "w") as f:
              f.write(json.dumps(spec.tolist()))
              tf.logging.info(
                  "Wrote spectrogram json to %s.", spec_filename
              )
  
file_path: magenta/magenta/models/onsets_frames_transcription/onsets_frames_transcription_spectrogram_json.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import json
  from magenta.models.onsets_frames_transcription import configs
  from magenta.models.onsets_frames_transcription import data
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: main(argv) without return types