(args)
return class_id, prob
infer_main

    Main inference function.

    Args:
        args: Parameters generated using argparser.

    Returns:
        class_id: Class index of the input.
        prob: : Probability of the input.
infer_main
infer_main
def infer_main(args):
    """infer_main

    Main inference function.

    Args:
        args: Parameters generated using argparser.

    Returns:
        class_id: Class index of the input.
        prob: : Probability of the input.
    """
    # init inference engine
    inference_engine = InferenceEngine(args)

    # init benchmark log
    if args.benchmark:
        import auto_log
        autolog = auto_log.AutoLogger(
            model_name="example",
            batch_size=args.batch_size,
            inference_config=inference_engine.config,
            gpu_ids="auto" if args.use_gpu else None)

    # enable benchmark
    if args.benchmark:
        autolog.times.start()

    # preprocess
    img = inference_engine.preprocess(args.img_path)

    if args.benchmark:
        autolog.times.stamp()

    output = inference_engine.run(img)

    if args.benchmark:
        autolog.times.stamp()

    # postprocess
    class_id, prob = inference_engine.postprocess(output)

    if args.benchmark:
        autolog.times.stamp()
        autolog.times.end(stamp=True)
        autolog.report()

    return class_id, prob
def infer_main ( args ) : # init inference engine inference_engine = InferenceEngine ( args ) # init benchmark log if args . benchmark : import auto_log autolog = auto_log . AutoLogger ( model_name = "example" , batch_size = args . batch_size , inference_config = inference_engine . config , gpu_ids = "auto" if args . use_gpu else None ) # enable benchmark if args . benchmark : autolog . times . start ( ) # preprocess img = inference_engine . preprocess ( args . img_path ) if args . benchmark : autolog . times . stamp ( ) output = inference_engine . run ( img ) if args . benchmark : autolog . times . stamp ( ) # postprocess class_id , prob = inference_engine . postprocess ( output ) if args . benchmark : autolog . times . stamp ( ) autolog . times . end ( stamp = True ) autolog . report ( ) return class_id , prob