code: def project_real_images(
      network_pkl, dataset_name, data_dir, num_images, num_snapshots
  ):
      print('Loading networks from "%s"...' % network_pkl)
      _G, _D, Gs = pretrained_networks.load_networks(network_pkl)
      proj = projector.Projector()
      proj.set_network(Gs)
  
      print('Loading images from "%s"...' % dataset_name)
      dataset_obj = dataset.load_dataset(
          data_dir=data_dir,
          tfrecord_dir=dataset_name,
          max_label_size=0,
          repeat=False,
          shuffle_mb=0,
      )
      assert dataset_obj.shape == Gs.output_shape[1:]
  
      for image_idx in range(num_images):
          print("Projecting image %d/%d ..." % (image_idx, num_images))
          images, _labels = dataset_obj.get_minibatch_np(1)
          images = misc.adjust_dynamic_range(images, [0, 255], [-1, 1])
          project_image(
              proj,
              targets=images,
              png_prefix=dnnlib.make_run_dir_path(
                  "image%04d-" % image_idx
              ),
              num_snapshots=num_snapshots,
          )
  
file_path: insightface/reconstruction/ostec/external/stylegan2/run_projector.py
imports: import argparse
  import numpy
  import dnnlib
  import dnnlib.tflib
  import re
  import sys
  import projector
  import pretrained_networks
  from training import dataset
  from training import misc
label_desc: Use image node_id 3 for calling a global function with example usage: project_real_images(network_pkl, dataset_name, data_dir, num_images, num_snapshots) without return types