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.0.tar.gz
(26.6 kB
view details)
Built Distribution
trtutils-0.2.0-py3-none-any.whl
(34.2 kB
view details)
File details
Details for the file trtutils-0.2.0.tar.gz
.
File metadata
- Download URL: trtutils-0.2.0.tar.gz
- Upload date:
- Size: 26.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1699ce73434be4fc833d42e601024697f2559220018bc8edc4fc0a80b92ad1e2 |
|
MD5 | 7999f475131fb0547a60b74296b38579 |
|
BLAKE2b-256 | f20902fc8e407d0a210ed3e49a553998489ac3a494dd239ff16ebcb49d6d5239 |
File details
Details for the file trtutils-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: trtutils-0.2.0-py3-none-any.whl
- Upload date:
- Size: 34.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 | 2e72c74e1332e221f032f5a135c5c2590d2d4e98d0e633d8f8c6e4c386492c40 |
|
MD5 | 4b1ffc68680b0d4f24b85a6002aec5ac |
|
BLAKE2b-256 | d6a20f6d1100a5a5f9a8703b7c8512bf81ed12b31d5eb0c72beaf4c03b57baa9 |