Utilities for making TensorRT easier to use
Project description
trtutils
Utilities for enabling easier high-level usage of TensorRT in Python.
TRTEngine
The TRTEngine is a high-level abstraction allowing easy use of TensorRT engines through Python. Once an engine is built, it is simple and easy to use:
from trtutils import TRTEngine
engine = TRTEngine("path_to_engine")
inputs = read_your_data()
for i in inputs:
print(engine.execute(i))
We also provide an abstraction for defining higher-level models. The TRTModel is designed to allow a user to define a pre and post processing step along with the engine to create an end-to-end inference object.
from trtutils import TRTModel
# scale some images down
def pre(inputs):
return [i / 255 for i in inputs]
# access the output classes from object detection
def post(outputs):
return [o[0][0] for o in outputs]
model = TRTModel("path_to_engine", pre, post)
inputs = read_your_data()
for i in inputs:
print(model(i))
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
trtutils-0.2.2.tar.gz
(26.9 kB
view details)
Built Distribution
trtutils-0.2.2-py3-none-any.whl
(34.6 kB
view details)
File details
Details for the file trtutils-0.2.2.tar.gz
.
File metadata
- Download URL: trtutils-0.2.2.tar.gz
- Upload date:
- Size: 26.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0419e9a15320d6589fc7c8b59a57b104974d27d944b1d17c6cb1aeee51062e95 |
|
MD5 | de68ed53a1a13e82f82050f3ebe24080 |
|
BLAKE2b-256 | 0960456899f1f678d46c6fcb69540782dbc483d09d4dc233427e3298fd897d46 |
File details
Details for the file trtutils-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: trtutils-0.2.2-py3-none-any.whl
- Upload date:
- Size: 34.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd347587c1f34817a5920db86e6dd73d10a10dfab740755ce783e9c0a0c42c49 |
|
MD5 | 955d8a83f79449602b262ae642778e96 |
|
BLAKE2b-256 | dc46ca22a8ca965c93b905a0bc0f4fb395a8dd52b90d2528514b52f10d0857fe |