logo
Browse Source

Update png and Update README

Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
training
shiyu22 3 years ago
committed by Kaiyuan Hu
parent
commit
96a8263fb1
  1. 12
      README.md
  2. BIN
      pic/operator.png

12
README.md

@ -10,17 +10,17 @@ This Operator generates feature vectors from the pytorch pretrained **Resnet50**
## Interface
`Class Resnet50ImageEmbedding(Operator)` [source](./resnet50_image_embedding.py)
`Class Resnet50ImageEmbedding(Operator)` [\[source\]](./resnet50_image_embedding.py)
`__init__(self, model_name: str)`
**param:**
**params:**
- model_name(str): the model name for embedding, like 'resnet50'.
`__call__(self, img_tensor: torch.Tensor)`
**param:**
**params:**
- img_tensor(torch.Tensor): the normalized image tensor.
@ -41,11 +41,11 @@ You can get the required python package by [requirements.txt](./requirements.txt
### How it works
The towhee/resnet50_image_embedding Operator implements the function of image embedding, which can add to the pipeline, for example, it's the key Operator within [image_embedding_resnet50](https://hub.towhee.io/towhee/image-embedding-resnet50) pipeline, and it is the red box in the picture below.
The `towhee/resnet50-image-embedding` Operator implements the function of image embedding, which can add to the pipeline, for example, it's the key Operator named embedding_model within [image_embedding_resnet50](https://hub.towhee.io/towhee/image-embedding-resnet50) pipeline, and it is the red box in the picture below.
![img](./pic/operator.png)
When using this Operator to write Pipline's Yaml file, you need to declare the following content according to the interface of resnet50_image_embedding class:
When using this Operator to write Pipline's Yaml file, you need to declare the following content according to the interface of Resnet50ImageEmbedding class:
```yaml
operators:
@ -100,7 +100,7 @@ Here is the main file structure of the `resnet50-image-embedding` Operator. If y
│   ├── requirements.txt #The python dependency package for the pytorch model.
│   └── model.py #The code of the pytorch model, including the initialization model and prediction.
├── test_data/ #The directory of test data, including test.jpg
└── test_resnet50_image_embedding.py #The unittest file of the Operator.
└── test_resnet50_image_embedding.py #The unittest file of this Operator.
```
## Reference

BIN
pic/operator.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 KiB

After

Width:  |  Height:  |  Size: 262 KiB

Loading…
Cancel
Save