https://github.com/hypersolution1/libtrt
https://github.com/hypersolution1/libtrt
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hypersolution1/libtrt
- Owner: hypersolution1
- Created: 2020-06-15T15:16:01.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-16T22:52:40.000Z (over 2 years ago)
- Last Synced: 2026-02-19T11:41:51.328Z (4 months ago)
- Language: C++
- Size: 104 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# libTRT
This library performs non-blocking inference on tensorRT model.
## Features
- Support TensorRT engine model
- Support ONNX model
- Include yolo post processing
## Usage
```js
var model = libTRT()
await model.load("yolov5x.engine") // File generated for the target GPU from a .wts file (see https://github.com/ultralytics/yolov5/releases)
console.log(model.info()) // Model inspection
var input = {}
input['data'] = { // input name in model
"dim": [3, 640, 640], // Used as a validation of the input
"data": arrImgs, // Float32Array, OR Array of Float32Array with length not higher than the maximum batch size of the model
}
var out = await model.execute(input) // Return an object with outputs as keys
var objs = model.yolo({ // This library includes a yolo post processing function
data: out['prob'].data, // OR .data[i] if batch is used
width: 640,
height: 640,
input_size: 640, // or 1280 depending on your model
conf_thresh: 0.5,
nms_thresh: 0.4,
})
```