code: def create_map_files(data_folder, class_dict, training_set):
      # get relative paths for map files
      img_file_paths = _get_image_paths(data_folder, training_set)
  
      out_map_file_path = os.path.join(
          data_folder,
          "{}_img_file.txt".format("train" if training_set else "test"),
      )
      roi_file_path = os.path.join(
          data_folder,
          "{}_roi_file.txt".format("train" if training_set else "test"),
      )
  
      counter = 0
      with open(out_map_file_path, "w") as img_file:
          with open(roi_file_path, "w") as roi_file:
              for img_path in img_file_paths:
                  abs_img_path = os.path.join(data_folder, img_path)
                  gt_annotations = _load_annotation(
                      abs_img_path, class_dict
                  )
                  if gt_annotations is None:
                      continue
  
                  img_line = "{}\t{}\t0\n".format(counter, img_path)
                  img_file.write(img_line)
  
                  roi_line = "{} |roiAndLabel".format(counter)
                  for val in gt_annotations.flatten():
                      roi_line += " {}".format(val)
  
                  roi_file.write(roi_line + "\n")
                  counter += 1
                  if counter % 500 == 0:
                      print("Processed {} images".format(counter))
  
file_path: CNTK/Examples/Image/Detection/utils/annotations/annotations_helper.py
imports: import numpy
  import os
label_desc: Use image node_id 5 for calling a global function with example usage: create_map_files(data_folder, class_dict, training_set) without return types