def __init__(self, lane_seg_config, model_dir):
        """
        Prepare for prediction.
        The usage and docs of paddle inference, please refer to
        https://paddleinference.paddlepaddle.org.cn/product_introduction/summary.html
        """
        if not os.path.exists(lane_seg_config):
            raise ValueError("Cannot find : {},".format(lane_seg_config))

        args = yaml.safe_load(open(lane_seg_config))
        self.model_dir = model_dir
        self.args = args[args['type']]

        self.shape = None
        self.filter_horizontal_flag = self.args['filter_horizontal_flag']
        self.horizontal_filtration_degree = self.args[
            'horizontal_filtration_degree']
        self.horizontal_filtering_threshold = self.args[
            'horizontal_filtering_threshold']

        try:
            self.predictor, _ = load_predictor(
                model_dir=self.model_dir,
                run_mode=self.args['run_mode'],
                batch_size=self.args['batch_size'],
                device=self.args['device'],
                min_subgraph_size=self.args['min_subgraph_size'],
                use_dynamic_shape=self.args['use_dynamic_shape'],
                trt_min_shape=self.args['trt_min_shape'],
                trt_max_shape=self.args['trt_max_shape'],
                trt_opt_shape=self.args['trt_opt_shape'],
                trt_calib_mode=self.args['trt_calib_mode'],
                cpu_threads=self.args['cpu_threads'],
                enable_mkldnn=self.args['enable_mkldnn'])
        except Exception as e:
            print(str(e))
            exit()

        Prepare for prediction.
        The usage and docs of paddle inference, please refer to
        https://paddleinference.paddlepaddle.org.cn/product_introduction/summary.html
        
deploy/pipeline/ppvehicle/lane_seg_infer.py