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.0.tar.gz
(30.5 kB
view details)
Built Distribution
trtutils-0.3.0-py3-none-any.whl
(39.2 kB
view details)
File details
Details for the file trtutils-0.3.0.tar.gz
.
File metadata
- Download URL: trtutils-0.3.0.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 | f553d626e85b96e64c11716c629b1d38738dfa6f698ead35b5af6a6a90b0af7c |
|
MD5 | 5a1c76d17014b1342a661ac929680aa2 |
|
BLAKE2b-256 | b2b11c0bb2b11cb6f685a2b2df9978e06b59cd2e73630847d3a914d2df4601b8 |
File details
Details for the file trtutils-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: trtutils-0.3.0-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 | 4d079a54281ab4564095d0d3312620452a2bfbb6880f687c5ef0aa14e6599a2d |
|
MD5 | f2cea779f584ca0cf8289cefa5e89b4f |
|
BLAKE2b-256 | 9d084b5b3701bd57b68bb374f9d27d967aaacd0edf6fbe5cc6c6bf521c44aa1a |