code: def get_frames_with_roi_meta(data_path, ext):
      """
      Create a ready to register list of SingleFrame(s)
  
      :param data_path: Path to the folder you like to register
      :type data_path: str
      :param ext: Files extension to upload from the dir
      :type ext: str
      :return: List[SingleFrame] list contains all the SingleFrame that should be register
      """
      frames_to_reg = []
      # Go over each jpg file in base path
      for file in glob.glob(
          os.path.join(data_path, "*.{}".format(ext))
      ):
          full_path = os.path.abspath(file)
          print("Getting files from: " + full_path)
          # read the json file next to the image
          data = get_json_file(full_path)
  
          # Create the SingleFrame object
          a_frame = SingleFrame(source=full_path)
  
          # Iterating over rois in the json, and add them
          for roi in data["rois"]:
              a_frame.add_annotation(
                  poly2d_xy=roi["poly"],
                  labels=roi["labels"],
                  metadata={"alive": roi["meta"]["alive"]},
                  confidence=roi["confidence"],
              )
          # add generic meta-data to the frame
          a_frame.width = data["size"]["x"]
          a_frame.height = data["size"]["y"]
          a_frame.metadata["dangerous"] = data["meta"]["dangerous"]
  
          # add to our SingleFrame Collection
          frames_to_reg.append(a_frame)
      return frames_to_reg
  
file_path: clearml/examples/hyperdatasets/data-registration/register_dataset_with_roi.py
imports: import glob
  import json
  import os
  from allegroai import DatasetVersion, SingleFrame, Task
  from argparse import ArgumentParser
  from clearml import StorageManager
label_desc: Use image node_id 2 for calling a global function with example usage: get_frames_with_roi_meta(data_path, ext) and returns: frames_to_reg