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

Uploaded Source

Built Distribution

trtutils-0.2.3-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for trtutils-0.2.3.tar.gz
Algorithm Hash digest
SHA256 ee1aafe0019a680eeaa5816e1c9c1f6904c5ada0a2ea8daac3fee1e4a47ad3c3
MD5 a8194effc99626ed90633c8020b7675b
BLAKE2b-256 13de2387baf311b42f49b66e9e59bc49d8631cd7c8d32c8eb47982fddd85eb1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: trtutils-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 36.8 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.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 82772db6e5d73c699e4ebeec74a3b0f939e58898edb1bb5b3a3060f36bc6921b
MD5 9e320e03f156e70180a982228604ef58
BLAKE2b-256 0e9c8ba4fef200e29acffe9a635e17157aa21ffb3de65b8240497212ac63e23f

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