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.3.tar.gz
(28.2 kB
view details)
Built Distribution
trtutils-0.2.3-py3-none-any.whl
(36.8 kB
view details)
File details
Details for the file trtutils-0.2.3.tar.gz
.
File metadata
- Download URL: trtutils-0.2.3.tar.gz
- Upload date:
- Size: 28.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee1aafe0019a680eeaa5816e1c9c1f6904c5ada0a2ea8daac3fee1e4a47ad3c3 |
|
MD5 | a8194effc99626ed90633c8020b7675b |
|
BLAKE2b-256 | 13de2387baf311b42f49b66e9e59bc49d8631cd7c8d32c8eb47982fddd85eb1c |
File details
Details for the file trtutils-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: trtutils-0.2.3-py3-none-any.whl
- Upload date:
- Size: 36.8 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 | 82772db6e5d73c699e4ebeec74a3b0f939e58898edb1bb5b3a3060f36bc6921b |
|
MD5 | 9e320e03f156e70180a982228604ef58 |
|
BLAKE2b-256 | 0e9c8ba4fef200e29acffe9a635e17157aa21ffb3de65b8240497212ac63e23f |