nvjpeg for python
Project description
NvJpeg - Python
Require
- nvjpeg
- cuda >= 10.2
- numpy >= 1.7
- python >= 3.6
- gcc >= 7.5
- make >= 4.1
Install
pip install pynvjpeg
Usage
#!/usr/bin/env python3
from nvjpeg import NvJpeg
# read file
fp = open("input-image.jpg", "rb")
jpegData = fp.read()
fp.close()
# decode
nj = NvJpeg()
img_np = nj.decode(jpegData)
# use opencv show numpy image data
cv2.imshow("Demo", img_np)
cv2.waitKey(0)
# encode numpy image data
jpg = nj.encode(img_np)
# write file
fp = open("output-image.jpg", "wb")
fp.write(jpg)
fp.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pynvjpeg-0.0.6.tar.gz
(5.0 kB
view details)
File details
Details for the file pynvjpeg-0.0.6.tar.gz
.
File metadata
- Download URL: pynvjpeg-0.0.6.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.21.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
7c48c8ff8d4270fe00b39479448bad063a35895369a423594ed27123e311a53b
|
|
MD5 |
bef7c04df79352d41567d4539cf43df6
|
|
BLAKE2b-256 |
e2e5ab383e862f8cd3a3add91a7096986ccd1653e9340523e1891a0d1610d13d
|