Expand description
§usls
usls is a cross-platform Rust library that provides efficient inference for SOTA vision and multi-modal models using ONNX Runtime (typically under 1B parameters).
§📚 Documentation
§🚀 Quick Start
# CPU
cargo run -r --example yolo # YOLOv8 detect by default
# NVIDIA CUDA
cargo run -r -F cuda --example yolo -- --device cuda:0
# NVIDIA TensorRT
cargo run -r -F tensorrt --example yolo -- --device tensorrt:0
# Apple Silicon CoreML
cargo run -r -F coreml --example yolo -- --device coreml
# Intel OpenVINO
cargo run -r -F openvino -F ort-load-dynamic --example yolo -- --device openvino:CPU§⚡ Cargo Features
ort-download-binaries(default): Automatically downloads prebuilt ONNXRuntime binaries for supported platformsort-load-dynamic: Dynamic linking to ONNXRuntime libraries (Guide)video: Enable video stream reading and writing (via video-rsviewer: Enable image and video stream visualization (via minifb)cuda: NVIDIA CUDA GPU acceleration supporttensorrt: NVIDIA TensorRT optimization for inference accelerationcoreml: Apple CoreML acceleration for macOS/iOS devicesopenvino: Intel OpenVINO toolkit for CPU/GPU/VPU accelerationonednn: Intel oneDNN (formerly MKL-DNN) for CPU optimizationdirectml: Microsoft DirectML for Windows GPU accelerationxnnpack: Google XNNPACK for mobile and edge device optimizationrocm: AMD ROCm platform for GPU accelerationcann: Huawei CANN (Compute Architecture for Neural Networks) supportrknpu: Rockchip NPU accelerationacl: Arm Compute Library for Arm processorsnnapi: Android Neural Networks API supportarmnn: Arm NN inference enginetvm: Apache TVM tensor compiler stackqnn: Qualcomm Neural Network SDKmigraphx: AMD MIGraphX for GPU accelerationvitis: Xilinx Vitis AI for FPGA accelerationazure: Azure Machine Learning integration
Re-exports§
Modules§
Macros§
- elapsed
- A macro to measure the execution time of a given code block and optionally log the result.
- elapsed_
annotator - Annotator-specific timing macro
- elapsed_
dataloader - Dataloader-specific timing macro
- elapsed_
engine - Engine-specific timing macro
- elapsed_
global - High-performance global timing macro with zero overhead when disabled
- elapsed_
module - High-performance module timing macro with zero overhead when disabled
- retry
- A macro to retry an expression multiple times with configurable delays between attempts.
Structs§
- Connection
- Connection between two keypoints with optional color.
- Hbb
- Horizontal bounding box with position, size, and metadata.
- Instance
Meta - Metadata for detection instances including ID, confidence, and name.
- Keypoint
- Represents a keypoint in a 2D space with optional metadata.
- Mask
- Mask: Gray Image.
- Obb
- Oriented bounding box with four vertices and metadata.
- Polygon
- Polygon with metadata.
- Prob
- Probability result with classification metadata.
- Skeleton
- Skeleton structure containing keypoint connections.
- Text
- Text detection result with content and metadata.
- Y
- Container for inference results for each image.
Enums§
- Key
- Key is used by the get key functions to check if some keys on the keyboard has been pressed
Constants§
- SKELETON_
COCO_ 19 - Defines the keypoint connections for the COCO person skeleton with 19 connections. Each tuple (a, b) represents a connection between keypoint indices a and b. The connections define the following body parts:
- SKELETON_
COCO_ 65 - Defines the keypoint connections for the COCO-133 person skeleton with 65 connections. Each tuple (a, b) represents a connection between keypoint indices a and b. The connections define the following parts:
- SKELETON_
COLOR_ COCO_ 19 - Defines colors for visualizing each connection in the COCO person skeleton. Colors are grouped by body parts:
- SKELETON_
COLOR_ COCO_ 65 - Defines colors for visualizing each connection in the COCO-133 person skeleton. Colors are grouped by body parts:
- SKELETON_
COLOR_ HALPE_ 27 - Defines colors for visualizing each connection in the HALPE person skeleton. Colors are grouped by body parts and sides:
- SKELETON_
COLOR_ HAND_ 21 - Defines colors for visualizing each connection in the hand skeleton. Colors are grouped by fingers:
- SKELETON_
HALPE_ 27 - Defines the keypoint connections for the HALPE person skeleton with 27 connections. Each tuple (a, b) represents a connection between keypoint indices a and b. The connections define the following body parts:
- SKELETON_
HAND_ 21 - Defines the keypoint connections for the hand skeleton with 20 connections. Each tuple (a, b) represents a connection between keypoint indices a and b. The connections define the following parts: