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

82 lines
3.0 KiB

2 years ago
# Image Decode Implementation with CV2
*author: Kaiyuan Hu, Rentong Guo*
<br />
## Description
An image decode operator implementation with OpenCV.
<br />
## Code Example
Load a image from path './src_dog.jpg'.
2 years ago
*Write a pipeline with explicit inputs/outputs name specifications:*
2 years ago
```python
from towhee import pipe, ops, DataCollection
2 years ago
p = (
pipe.input('path')
.map('path', 'image', ops.image_decode.cv2_rgb())
.output('path', 'image')
)
2 years ago
```
<img src="./result.png" height="150px"/>
2 years ago
<br />
## Factory Constructor
Create the operator via the following factory method:
***image_decode.cv2_rgb()***
2 years ago
<br />
## Interface
An image decode operator takes an image path as input. It decodes the image back to ndarray.
**Parameters:**
**img**: *str*
​ Image file path.
**Returns**: *towhee.types.Image (a sub-class of numpy.ndarray)*
​ The decoded image data as numpy.ndarray.
2 years ago
# More Resources
- [Scalar Quantization and Product Quantization - Zilliz blog](https://zilliz.com/learn/scalar-quantization-and-product-quantization): A hands-on dive into scalar quantization (integer quantization) and product quantization with Python.
- [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.
- [Understanding Computer Vision - Zilliz blog](https://zilliz.com/learn/what-is-computer-vision): Computer Vision is a field of Artificial Intelligence that enables machines to capture and interpret visual information from the world just like humans do.
- [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
- [Demystifying Color Histograms: A Guide to Image Processing and Analysis - Zilliz blog](https://zilliz.com/learn/demystifying-color-histograms): Mastering color histograms is indispensable for anyone involved in image processing and analysis. By understanding the nuances of color distributions and leveraging advanced techniques, practitioners can unlock the full potential of color histograms in various imaging projects and research endeavors.
- [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.
- [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.