Utilities for making TensorRT easier to use
Project description
trtutils
A high-level Python interface for TensorRT inference, providing a simple and unified way to run arbitrary TensorRT engines. This library abstracts away the complexity of CUDA memory management, binding management, and engine execution, making it easy to perform inference with any TensorRT engine.
Features
- Simple, high-level interface for TensorRT inference
- Automatic CUDA memory management
- Support for arbitrary TensorRT engines
- Built-in preprocessing and postprocessing capabilities
- Comprehensive type hints and documentation
- Support for both basic engine execution and end-to-end model inference
Quick Start
Basic Engine Usage
The TRTEngine
class provides a simple interface for running any TensorRT engine:
from trtutils import TRTEngine
# Load your TensorRT engine
engine = TRTEngine("path_to_engine")
# Get input specifications
print(engine.input_shapes) # Expected input shapes
print(engine.input_dtypes) # Expected input data types
# Run inference
inputs = read_your_data()
outputs = engine.execute(inputs)
Installation
pip install trtutils
For additional features, you can install optional dependencies:
# For JIT compiler
pip install "trtutils[jit]"
# For development
pip install "trtutils[dev]"
Documentation
For detailed documentation, including advanced usage, examples, and API reference, visit our documentation site.
Examples
Check out our examples directory for more detailed usage examples, including:
- Basic engine usage
- End-to-end model inference
- YOLO model implementation
- Benchmarking utilities
Performance
Device | YOLOv8m | YOLOv8n |
---|---|---|
OrinAGX-64GB | ||
OrinAGX-32GB | ||
OrinNX-16GB | ||
OrinNano-8GB | ||
XavierNX-8GB | ||
3080Ti | ||
TitanRTX |
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trtutils-0.6.1.tar.gz
.
File metadata
- Download URL: trtutils-0.6.1.tar.gz
- Upload date:
- Size: 80.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
31092c436f354874289f9f90b627e9c7e07aa787bf5f72630b8eb732f96caa66
|
|
MD5 |
cde8f2ec544176fbe157f90145246705
|
|
BLAKE2b-256 |
1fb51fb8fa63f204ccd872c8b69b3593932c30a537e44034fe31d86147a8998a
|
File details
Details for the file trtutils-0.6.1-py3-none-any.whl
.
File metadata
- Download URL: trtutils-0.6.1-py3-none-any.whl
- Upload date:
- Size: 106.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
e41f5c7a5c59d3140d5f0ec56b6682e3fea6dbcdbac84d69ef27b32cb0f9cd1a
|
|
MD5 |
b772d36df53d1ec5f36672e6898f1d48
|
|
BLAKE2b-256 |
2436f6d5d4ff6a44957f8698d15141f8c9a7421851387e4771da7f8d4359b9f5
|