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.5.tar.gz
(39.2 kB
view details)
Built Distribution
trtutils-0.3.5-py3-none-any.whl
(50.9 kB
view details)
File details
Details for the file trtutils-0.3.5.tar.gz
.
File metadata
- Download URL: trtutils-0.3.5.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 | 4a18366f01d095088b1a5b180e961174ab320ccd3a1fdb2462d2886b27ef7466 |
|
MD5 | 5ac266a08b01241b0a7f1385c7bb939b |
|
BLAKE2b-256 | d3357af40b19b0adae44ed2cd7a0967f70fbbc1368b102dac3d8a453aa4a13fb |
File details
Details for the file trtutils-0.3.5-py3-none-any.whl
.
File metadata
- Download URL: trtutils-0.3.5-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 | 9d56819dce3e829d0585e9f091a8a32eeb5a3aad46102506ea45ab5f67e37a84 |
|
MD5 | 7867ae23df0c4f8ce59e01a0543a80e7 |
|
BLAKE2b-256 | 211a0f1c367c758ceda3a1c2bbf5619cc3179da44ea14d038facf3fab8b6cd25 |