code: def run(FLAGS, cfg):
      # build trainer
      trainer = Trainer(cfg, mode="test")
  
      # load weights
      trainer.load_weights(cfg.weights)
  
      # get inference images
      images = get_test_images(FLAGS.infer_dir, FLAGS.infer_img)
  
      trainer.predict_culane(
          images,
          output_dir=FLAGS.output_dir,
          save_results=FLAGS.save_results,
          visualize=FLAGS.visualize,
      )
  
file_path: PaddleDetection/tools/infer_culane.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import sys
  import warnings
  import glob
  import ast
  import paddle
  from ppdet.core.workspace import load_config, merge_config
  from ppdet.engine import Trainer
  from ppdet.utils.check import check_gpu, check_npu, check_xpu, check_mlu, check_version, check_config
  from ppdet.utils.cli import ArgsParser, merge_args
  from ppdet.slim import build_slim_model
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 3 for calling a global function with example usage: run(FLAGS, cfg) without return types