(self, img_path)
return img
preprocess

        Preprocess to the input.

        Args:
            img_path: Image path.

        Returns: Input data after preprocess.
preprocess
preprocess
def preprocess(self, img_path):
        """preprocess

        Preprocess to the input.

        Args:
            img_path: Image path.

        Returns: Input data after preprocess.
        """
        with open(img_path, "rb") as f:
            img = Image.open(f)
            img = img.convert("RGB")
        img = self.transforms(img)
        img = np.expand_dims(img, axis=0)
        return img
def preprocess ( self , img_path ) : with open ( img_path , "rb" ) as f : img = Image . open ( f ) img = img . convert ( "RGB" ) img = self . transforms ( img ) img = np . expand_dims ( img , axis = 0 ) return img