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.3.3.tar.gz
(30.8 kB
view details)
Built Distribution
trtutils-0.3.3-py3-none-any.whl
(39.8 kB
view details)
File details
Details for the file trtutils-0.3.3.tar.gz
.
File metadata
- Download URL: trtutils-0.3.3.tar.gz
- Upload date:
- Size: 30.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08dbf06248b5e2ca4dc194b312a415344436d83130a923aa80f8ad1f5bcefe15 |
|
MD5 | 1ad424c2a43261eda78a7fb8a3e593fb |
|
BLAKE2b-256 | 64a97aaace11ce9db0c908ff0c81c7a4b5ff8ea820dc74e0ae3384038d50cd99 |
File details
Details for the file trtutils-0.3.3-py3-none-any.whl
.
File metadata
- Download URL: trtutils-0.3.3-py3-none-any.whl
- Upload date:
- Size: 39.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 | b4b46a6ab11eb22ea0ecd0bd0693e985db60e9432c0349bf150468735d839ebb |
|
MD5 | 8d85c024427395ed6c5797df59fd4a4a |
|
BLAKE2b-256 | 3f8a2de063f32ab0a08e61e6ecdb02a7749389af47c88490e46ce3e920c70f7e |