(self, args)
return
Args:
            args: Parameters generated using argparser.

        Returns: None
Args:
            args: Parameters generated using argparser.
Args : args : Parameters generated using argparser .
def __init__(self, args):
        """
        Args:
            args: Parameters generated using argparser.

        Returns: None
        """
        super().__init__()
        self.args = args

        # init inference engine
        self.predictor, self.config, self.input_tensor, self.output_tensor = self.load_predictor(
            os.path.join(args.model_dir, "inference.pdmodel"),
            os.path.join(args.model_dir, "inference.pdiparams"))

        # build transforms
        self.transforms = Compose([
            ResizeImage(args.resize_size), CenterCropImage(args.crop_size),
            NormalizeImage(), ToCHW()
        ])

        # wamrup
        if self.args.warmup > 0:
            for idx in range(args.warmup):
                print(idx)
                x = np.random.rand(1, 3, self.args.crop_size,
                                   self.args.crop_size).astype("float32")
                self.input_tensor.copy_from_cpu(x)
                self.predictor.run()
                self.output_tensor.copy_to_cpu()
        return
def __init__ ( self , args ) : super ( ) . __init__ ( ) self . args = args # init inference engine self . predictor , self . config , self . input_tensor , self . output_tensor = self . load_predictor ( os . path . join ( args . model_dir , "inference.pdmodel" ) , os . path . join ( args . model_dir , "inference.pdiparams" ) ) # build transforms self . transforms = Compose ( [ ResizeImage ( args . resize_size ) , CenterCropImage ( args . crop_size ) , NormalizeImage ( ) , ToCHW ( ) ] ) # wamrup if self . args . warmup > 0 : for idx in range ( args . warmup ) : print ( idx ) x = np . random . rand ( 1 , 3 , self . args . crop_size , self . args . crop_size ) . astype ( "float32" ) self . input_tensor . copy_from_cpu ( x ) self . predictor . run ( ) self . output_tensor . copy_to_cpu ( ) return