cv2
              
                 
                
            
          copied
			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
Updated 4 years ago
image-decode
Image Decode Implementation with CV2
author: Kaiyuan Hu, Rentong Guo
Desription
An image decode operator implementation with OpenCV.
import towhee import ops
img_decode = ops.image_decode.cv2()
img = img_decode('./dog.jpg')
Factory method
Create the operator via the following factory method
ops.image_decode.cv2()
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: numpy.ndarray
 The decoded image data.
Code Example
Load a image from path './dog.jpg'.
Write the pipeline in simplified style:
import towhee.DataCollection as dc
dc.glob(./dog.jpg)
  .image_decode.cv2()
  .show()
Write a same pipeline with explicit inputs/outputs name specifications:
import towhee.DataCollection as dc
dc.glob['path'](./dog.jpg)
  .image_decode.cv2['path', 'img']()
  .select('img')
  .show()
|  | 4 Commits | ||
|---|---|---|---|
|  | 
												1.1 KiB
											 | 4 years ago | |
|  | 
												1.2 KiB
											 | 4 years ago | |
|  | 
												1014 B
											 | 4 years ago | |
|  | 
												700 B
											 | 4 years ago | |
|  | 
												2.1 KiB
											 | 4 years ago | |
|  | 
												28 B
											 | 4 years ago | |
