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.1.tar.gz
(26.8 kB
view details)
Built Distribution
trtutils-0.2.1-py3-none-any.whl
(34.5 kB
view details)
File details
Details for the file trtutils-0.2.1.tar.gz
.
File metadata
- Download URL: trtutils-0.2.1.tar.gz
- Upload date:
- Size: 26.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 | f6accd9377879ca9cea665916d9968d0040da02552891cc39f722bb68af5b2cc |
|
MD5 | 68719ccf0aaa9d1b0ecabeb3fc6eac61 |
|
BLAKE2b-256 | 686db8ea530ec8845003c00843d2d4f00a8549fadba59467ed0aa52fb5eafbf6 |
File details
Details for the file trtutils-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: trtutils-0.2.1-py3-none-any.whl
- Upload date:
- Size: 34.5 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 | 587a631cef117376e2e7119159f73575840554b38736ed5eb89ad43b78348d14 |
|
MD5 | 9f878f2bd3e4806f6624103314111435 |
|
BLAKE2b-256 | 107755ad89c4e1f4379ce3855be3eebfbd15100bff3cb15eccf94d70e6c203fb |