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.4.tar.gz
(39.2 kB
view details)
Built Distribution
trtutils-0.3.4-py3-none-any.whl
(50.9 kB
view details)
File details
Details for the file trtutils-0.3.4.tar.gz
.
File metadata
- Download URL: trtutils-0.3.4.tar.gz
- Upload date:
- Size: 39.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 | 4e45830336d70042a99328bf5846a5a8c474eec2d1d587e896098eadb6172e59 |
|
MD5 | 5794c56fe407e327eedbbb5211dc955c |
|
BLAKE2b-256 | f398c6e80bedf1a354f80c59f15195e7aa91ca93955c332eb97d3b316bdf4c91 |
File details
Details for the file trtutils-0.3.4-py3-none-any.whl
.
File metadata
- Download URL: trtutils-0.3.4-py3-none-any.whl
- Upload date:
- Size: 50.9 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 | f5197b7bcf2296f9dfcb74a24b8825ff7298109c0c88097fea5b6a770f28ba09 |
|
MD5 | cd8c84f5448019d8c589dbb22a1e5893 |
|
BLAKE2b-256 | 16cb98e5b7a227c078e56e4504235bcc0d3bdad493de110b2fc15b8b6627d1a3 |