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.1.tar.gz
(30.5 kB
view details)
Built Distribution
trtutils-0.3.1-py3-none-any.whl
(39.2 kB
view details)
File details
Details for the file trtutils-0.3.1.tar.gz
.
File metadata
- Download URL: trtutils-0.3.1.tar.gz
- Upload date:
- Size: 30.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3daeedd1576b878ba7beb0445192e6240b8b2f2a846d87f544ffa5ff64948b0b |
|
MD5 | 6b21be435dc6b5b8188365a21d53b779 |
|
BLAKE2b-256 | 17efbe9dfef3a93642791a3bf46dd8d7244c45cfa2ebda6f2d82807aec6ebea1 |
File details
Details for the file trtutils-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: trtutils-0.3.1-py3-none-any.whl
- Upload date:
- Size: 39.2 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 | 9906c572e616d98e007ebf0f419ad934a0b812882e86b8877afd8bad866c914b |
|
MD5 | 653955a3514f7b4bd3559eceee1ed99c |
|
BLAKE2b-256 | 25955ab2903d74fd2fb0a0d757a9f1b2e2bed8cb636c8f42639b4f7e6f4c1faa |