logo
Browse Source

Update

Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
main
shiyu22 3 years ago
parent
commit
0dcaad52a1
  1. 8
      README.md
  2. BIN
      readme_src/operator.png
  3. 2
      transform_image.py
  4. 2
      transform_image.yaml

8
README.md

@ -21,12 +21,12 @@ __init__(self, size: int)
- supported types: `int` - supported types: `int`
```python ```python
__call__(self, img: Union[Image.Image, torch.Tensor, str])
__call__(self, img_path: Union[Image.Image, torch.Tensor, str])
``` ```
**Args:** **Args:**
- img:
- img_path:
- the input image to be processed - the input image to be processed
- supported type: `PIL.image` or `str` (path of the image) - 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 ## 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 ## Reference

BIN
readme_src/operator.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 KiB

2
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. Call it when use this class.

2
transform_image.yaml

@ -8,6 +8,6 @@ init:
size: int size: int
call: call:
input: input:
img: Union[Image.Image, torch.Tensor, str]
img_path: Union[Image.Image, torch.Tensor, str]
output: output:
img_transformed: torch.Tensor img_transformed: torch.Tensor
Loading…
Cancel
Save