diff --git a/README.md b/README.md index d5154b2..91cb44f 100644 --- a/README.md +++ b/README.md @@ -21,12 +21,12 @@ __init__(self, size: int) - supported types: `int` ```python -__call__(self, img: Union[Image.Image, torch.Tensor, str]) +__call__(self, img_path: Union[Image.Image, torch.Tensor, str]) ``` **Args:** -- img: +- img_path: - the input image to be processed - supported type: `PIL.image` or `str` (path of the image) @@ -44,9 +44,7 @@ You can get the required python package by [requirements.txt](./requirements.txt ## How it works -The `towhee/transform-image` Operator is used for image transformation and is an important part of data preprocessing. It can be added to the pipeline and is usually used as the first custom operator of the pipeline. For example, it's the first Operator named processing within [image-embedding-resnet50](https://hub.towhee.io/towhee/image-embedding-resnet50) pipeline, and it is the red box in the picture below. - -![img](./readme_src/operator.png) +The `towhee/transform-image` Operator is used for image transformation and is an important part of data preprocessing. It can be added to the pipeline and is usually used as the first custom operator of the pipeline. For example, it's the first Operator named processing within [image-embedding-resnet50](https://hub.towhee.io/towhee/image-embedding-resnet50) pipeline. ## Reference diff --git a/readme_src/operator.png b/readme_src/operator.png deleted file mode 100644 index a602aa4..0000000 Binary files a/readme_src/operator.png and /dev/null differ diff --git a/transform_image.py b/transform_image.py index 66b732d..f2fd873 100644 --- a/transform_image.py +++ b/transform_image.py @@ -42,7 +42,7 @@ class TransformImage(Operator): ] ) - def __call__(self, img: Union[Image.Image, torch.Tensor, str]) -> NamedTuple('Outputs', [('img_transformed', torch.Tensor)]): + def __call__(self, img_path: Union[Image.Image, torch.Tensor, str]) -> NamedTuple('Outputs', [('img_transformed', torch.Tensor)]): """ Call it when use this class. diff --git a/transform_image.yaml b/transform_image.yaml index 30bb31a..47b5a41 100644 --- a/transform_image.yaml +++ b/transform_image.yaml @@ -8,6 +8,6 @@ init: size: int call: input: - img: Union[Image.Image, torch.Tensor, str] + img_path: Union[Image.Image, torch.Tensor, str] output: img_transformed: torch.Tensor \ No newline at end of file