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 2 years ago
image-decode
Image Decode Implementation with CV2
author: Kaiyuan Hu, Rentong Guo
Description
An image decode operator implementation with OpenCV. Return BGR image.
Code Example
Load a image from path './src_dog.jpg'.
the src picture:
Write the pipeline in simplified style:
from towhee.dc2 import pipe, ops, DataCollection
p = (
pipe.input('url')
.map('url', 'image', ops.image_decode.cv2())
.output('image')
)
DataCollection(p('./src_dog.jpg')).show()
Factory Constructor
Create the operator via the following factory method:
image_decode.cv2()
Interface
An image decode operator takes an image path as input. It decodes the image back to ndarray, use BGR channel order.
Parameters:
img: str
Local file path or http url.
Returns: towhee.types.Image (a sub-class of numpy.ndarray)
The decoded image data as numpy.ndarray.
junjiejiangjjj
d296966a76
| 21 Commits | ||
---|---|---|---|
.gitattributes |
1.1 KiB
|
3 years ago | |
.gitignore |
1.2 KiB
|
3 years ago | |
README.md |
1.0 KiB
|
2 years ago | |
__init__.py |
700 B
|
3 years ago | |
dog.png |
66 KiB
|
2 years ago | |
image_decode_cv2.py |
2.1 KiB
|
3 years ago | |
requirements.txt |
36 B
|
3 years ago | |
show_result.jpg |
26 KiB
|
3 years ago | |
src_dog.jpg |
26 KiB
|
2 years ago |