def METHOD_NAME(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)
    # inference
    trainer.predict(
        images,
        draw_threshold=FLAGS.draw_threshold,
        output_dir=FLAGS.output_dir,
        save_txt=FLAGS.save_txt)