NvJpeg - Python
Require
- nvjpeg
- cuda >= 10.2
- numpy >= 1.7
- python >= 3.6
- gcc >= 7.5
- make >= 4.1
System
Linux(x86, x86_64) Nvidia Jetson OS
Install
pip install pynvjpeg
Usage
0. Init PyNvJpeg
from nvjpeg import NvJpeg
nj = NvJpeg()
1. Use PyNvJpeg
Read Jpeg File to Numpy
img = nj.read("_JPEG_FILE_PATH_")
# like cv2.imread("_JPEG_FILE_PATH_")
Write Numpy to Jpeg File
nj.write("_JPEG_FILE_PATH_", img)
# or nj.write("_JPEG_FILE_PATH_", quality)
# int quality default 70, mean jpeg quality
# like cv2.imwrite("_JPEG_FILE_PATH_", img)
Decode Jpeg bytes in variable
img = nj.decode(jpeg_bytes)
# like cv2.imdecode(variable)
Encode image numpy array to bytes
jpeg_bytes = nj.encode(img)
# or with jpeg quality
# jpeg_bytes = nj.encode(img, 70)
# int quality default 70, mean jpeg quality
# like cv2.imencode(".jpg", variable)[1]
Release files for pynvjpeg 0.0.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pynvjpeg-0.0.13.tar.gz | 11.3 kB | Details |
Release files / pynvjpeg-0.0.13.tar.gz
| Download URL | pynvjpeg-0.0.13.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2d84f26395178414c325a18dd83f7fa0fe83b14d9d0b0e8bc0adb7648738360
|
|
BLAKE2b-256 checksum How to use checksums |
4ad3cdafe2fdebae3a7e219e8db0ddc8c9f67ee72a466dc095f56b12c0280252
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.0
|