copied
Readme
Files and versions
939 B
Image Decode Implementation with CV2
author: Kaiyuan Hu, Rentong Guo
Description
An image decode operator implementation with OpenCV.
Code Example
Load a image from path './dog.jpg'.
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('./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.
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.
939 B
Image Decode Implementation with CV2
author: Kaiyuan Hu, Rentong Guo
Description
An image decode operator implementation with OpenCV.
Code Example
Load a image from path './dog.jpg'.
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('./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.
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.