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

Updated 3 months ago

image-decode

Image Decode Implementation with CV2 and nvjpeg

author: junjie.jiang


Description

An image decode operator implementation with OpenCV and nvjpeg. In CPU env, use OpenCV, in GPU env, use nvjpeg to decode jpeg files.


Code Example

Load a image from path './src_dog.jpg'.

Write the pipeline in simplified style:

from towhee import pipe, ops, DataCollection


p = (
  pipe.input('url')
  .map('url', 'image', ops.image_decode.nvjpeg())
  .output('image')
)

DataCollection(p('./src_dog.jpg')).show()


Factory Constructor

Create the operator via the following factory method:

ops.image_decode.nvjpeg()


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.

More Resources

Jael Gu cee4336f7c Add more resources 12 Commits
folder-icon cpp update 2 years ago
folder-icon py36nvjpeg add so 2 years ago
folder-icon py37nvjpeg add so 2 years ago
folder-icon py38nvjpeg update 2 years ago
folder-icon py39nvjpeg add so 2 years ago
file-icon .gitattributes
1.1 KiB
download-icon
Initial commit 2 years ago
file-icon README.md
3.7 KiB
download-icon
Add more resources 3 months ago
file-icon __init__.py
726 B
download-icon
support decode bytes 2 years ago
file-icon dog.jpg
26 KiB
download-icon
Update readme 2 years ago
file-icon image_decoder.py
2.9 KiB
download-icon
support decode bytes 2 years ago
file-icon requirements.txt
29 B
download-icon
add requirements 2 years ago
file-icon src_dog.jpg
26 KiB
download-icon
Update readme 2 years ago