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

57 lines
3.4 KiB

3 years ago
# Pipeline: Image Embedding using resnet50
3 years ago
3 years ago
Authors: Filip
## Overview
3 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:
3 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`
3 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
3 years ago
>>> img_path = 'path/to/your/image'
>>> embedding_pipeline = pipeline('towhee/image-embedding-resnet50')
3 years ago
>>> embedding = embedding_pipeline(img_path)
```
# More Resources
- [Exploring Multimodal Embeddings with FiftyOne and Milvus - Zilliz blog](https://zilliz.com/blog/exploring-multimodal-embeddings-with-fiftyone-and-milvus): This post explored how multimodal embeddings work with Voxel51 and Milvus.
- [How to Get the Right Vector Embeddings - Zilliz blog](https://zilliz.com/blog/how-to-get-the-right-vector-embeddings): A comprehensive introduction to vector embeddings and how to generate them with popular open-source models.
- [Building Production Ready Search Pipelines with Spark and Milvus - Zilliz blog](https://zilliz.com/blog/building-production-ready-search-pipelines-spark-milvus): A step-by-step process to build an efficient and production-ready vector search pipeline using Databricks Spark and Milvus.
- [The guide to clip-vit-base-patch32 | OpenAI](https://zilliz.com/ai-models/clip-vit-base-patch32): clip-vit-base-patch32: a CLIP multimodal model variant by OpenAI for image and text embedding.
- [Using Vector Search to Better Understand Computer Vision Data - Zilliz blog](https://zilliz.com/blog/use-vector-search-to-better-understand-computer-vision-data): How Vector Search improves your understanding of Computer Vision Data
- [Understanding ImageNet: A Key Resource for Computer Vision and AI Research](https://zilliz.com/glossary/imagenet): The large-scale image database with over 14 million annotated images. Learn how this dataset supports advancements in computer vision.
- [Understanding Neural Network Embeddings - Zilliz blog](https://zilliz.com/learn/understanding-neural-network-embeddings): This article is dedicated to going a bit more in-depth into embeddings/embedding vectors, along with how they are used in modern ML algorithms and pipelines.
- [Image Embeddings for Enhanced Image Search - Zilliz blog](https://zilliz.com/learn/image-embeddings-for-enhanced-image-search): Image Embeddings are the core of modern computer vision algorithms. Understand their implementation and use cases and explore different image embedding models.
- [Enhancing Information Retrieval with Sparse Embeddings | Zilliz Learn - Zilliz blog](https://zilliz.com/learn/enhancing-information-retrieval-learned-sparse-embeddings): Explore the inner workings, advantages, and practical applications of learned sparse embeddings with the Milvus vector database