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.
The pipeline parses [the yaml file](./image_embedding_resnet50.yaml), which declares some components we call **Operator** and **DataFrame**. Next, we will introduce the interface, show how to use it and how it works, have fun with it!
When we declare a pipeline object with a specific task, such as `towhee/image-embedding-resnet50` in this repo, it will run according to the Yaml file, and the input and output are:
> You can refer to [Getting Started with Towhee](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).
First of all, you need to learn the pipeline and operator in Towhee architecture:
- **Pipeline**: A `Pipeline` is a single machine learning task that is composed of several operators. Operators are connected together internally via a directed acyclic graph.
- **Operator**: An `Operator` is a single node within a pipeline. It contains files (e.g. code, configs, models, etc...) and works for reusable operations (e.g., preprocessing an image, inference with a pretrained model).
This pipeline includes four functions: `_start_op`, `towhee/transform-image`, `towhee/resnet50-image-embedding` and` _end_op`. 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.
![img](./pic/pipeline.png)
Among the four Operator,`_start_op` and `_end_op` are required in any Pipeline, and they are used to start and end the pipeline in the Towhee system. For the other two Operators, please refer to [towhee/transform-image](https://hub.towhee.io/towhee/transform-image) and [towhee/resnet50-image-embedding](https://hub.towhee.io/towhee/resnet50-image-embedding).