logo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions

45 lines
1.1 KiB

2 years ago
# Pipeline: Image Embedding using resnet50
2 years ago
2 years ago
Authors: Filip
## Overview
2 years ago
The pipeline is used to **extract the feature vector of a given image**. It uses the the resnet50 model from Ross Wightman's [`timm`](https://github.com/rwightman/pytorch-image-models) to generate the vector.
## Interface
**Input Arguments:**
- img_path:
2 years ago
- the input image path
- supported types: `str`
**Pipeline Output:**
The pipeline returns a tuple `Tuple[('feature_vector', numpy.ndarray)]` containing following fields:
- feature_vector:
- the embedding of input image
- data type: `numpy.ndarray`
2 years ago
- shape: (1, 2048)
## How to use
1. Install [Towhee](https://github.com/towhee-io/towhee)
```bash
$ pip3 install towhee
```
> You can refer to [Getting Started with Towhee](https://towhee.io/) for more details. If you have any questions, you can [submit an issue to the towhee repository](https://github.com/towhee-io/towhee/issues).
2. Run it with Towhee
```python
>>> from towhee import pipeline
2 years ago
>>> img_path = 'path/to/your/image'
>>> embedding_pipeline = pipeline('towhee/image-embedding-resnet50')
2 years ago
>>> embedding = embedding_pipeline(img_path)
```