https://github.com/justincdavis/trtutils
Utilities for enabling easier high-level usage of TensorRT in Python
https://github.com/justincdavis/trtutils
cuda dnn-inference gpu-acceleration image-classification inference jetson nvidia object-detection python tensorrt tensorrt-inference
Last synced: 3 months ago
JSON representation
Utilities for enabling easier high-level usage of TensorRT in Python
- Host: GitHub
- URL: https://github.com/justincdavis/trtutils
- Owner: justincdavis
- License: mit
- Created: 2023-11-08T23:19:24.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-03-06T23:54:38.000Z (4 months ago)
- Last Synced: 2026-03-07T01:40:06.760Z (4 months ago)
- Topics: cuda, dnn-inference, gpu-acceleration, image-classification, inference, jetson, nvidia, object-detection, python, tensorrt, tensorrt-inference
- Language: Python
- Homepage: https://trtutils.readthedocs.io/en/latest/index.html
- Size: 78.2 MB
- Stars: 19
- Watchers: 2
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
# trtutils
[](https://pypi.org/pypi/trtutils/)

[](https://www.codefactor.io/repository/github/justincdavis/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
## Supported Models
The models listed in the [documentation](https://trtutils.readthedocs.io/en/latest/models.html) are officially supported for inference.
## Quick Start
### Basic Engine Usage
The `TRTEngine` class provides a simple interface for running any TensorRT engine:
```python
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
```bash
pip install trtutils
```
For additional features, you can install optional dependencies:
```bash
# 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](https://trtutils.readthedocs.io/).
## Examples
Check out our [examples directory](examples/) 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.