This pipeline is used to **extract the feature vector of the image**. First step is to normalize the image, and then use resnet50 model to generate the vector.
This pipeline is used to **extract the feature vector of a given image**.
The pipeline performs two major steps. First, normalize the image, and then use resnet50 model to generate the vector.
## Interface
**Args:**
**Pipeline Input Arguments:**
- img(`PIL.Image`):
img_tensor(`PIL.Image`):
The image to be encoded. `PIL.Image` is the currently supported image type.
The image to be encoded.
**Pipeline Returns:**
**Returns:**
- (`Tuple[('cnn', numpy.ndarray)]`)
(`Tuple[('cnn', numpy.ndarray)]`)
The pipeline returns a tuple.
The embedding of the image.
- The `feature_vector` field contains the embedding of the image.
## How to use
@ -43,6 +47,6 @@ $ pip3 install towhee
## How it works
You can learn the pipeline and operator in [Towhee architecture](https://github.com/towhee-io/towhee#towhee-architecture). This pipeline includes two main functions: [towhee/transform-image](https://hub.towhee.io/towhee/transform-image) and [towhee/resnet50-image-embedding](https://hub.towhee.io/towhee/resnet50-image-embedding). It is necessary to ensure that the input and output of the four Operators correspond to each other, and the input and output data types can be defined by DataFrame.
This pipeline includes two main operators: transform image (implemented as [towhee/transform-image](https://hub.towhee.io/towhee/transform-image)) and image embedding (implemented as [towhee/resnet50-image-embedding](https://hub.towhee.io/towhee/resnet50-image-embedding)). The transform image operator will first convert the original image into a normalized format, such as with 512x512 resolutions. Then, the normalized image will be encoded via image embedding operator, and finally we get a feature vector of the given image. (The basic concepts of pipeline and operator are introduced in [Towhee architecture](https://github.com/towhee-io/towhee#towhee-architecture).)