Skip to main content

Utilities for making TensorRT easier to use

Project description

trtutils

PyPI CodeFactor

MyPy Ruff PyPi Build

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))

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.2.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

trtutils-0.3.2-py3-none-any.whl (39.6 kB view details)

Uploaded Python 3

File details

Details for the file trtutils-0.3.2.tar.gz.

File metadata

  • Download URL: trtutils-0.3.2.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for trtutils-0.3.2.tar.gz
Algorithm Hash digest
SHA256 98d16ed41c27685804afe5041833c9d0cd3fc9093bdca9f19ba98a66a7040628
MD5 a16c0c53630fc38d689d308709668e1e
BLAKE2b-256 5a00b832f2301d414635c7ea938c61a6ea7a299c90e0a209ab8b0f14443ee034

See more details on using hashes here.

File details

Details for the file trtutils-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: trtutils-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 39.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for trtutils-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d114d6c71c6326bb3e023899d8a60b90d4898db43ee9fa1c566180e87039126a
MD5 a0f26724410bca87608466c71454b2b2
BLAKE2b-256 23d95c5cd9e294b765f205d3d3158915842037b9bba27c562e61e01b91609f32

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page