Skip to content

Latest commit

 

History

History

yolo

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

YOLO-Series

Detection Instance Segmentation Pose
Classification Obb
Head Detection Fall Detection Trash Detection
YOLO-World Face Parsing FastSAM

Quick Start

# customized
cargo run -r --example yolo -- --task detect --ver v8 --nc 6 --model xxx.onnx  # YOLOv8

# Classify
cargo run -r --example yolo -- --task classify --ver v5 --scale s --width 224 --height 224 --nc 1000  # YOLOv5
cargo run -r --example yolo -- --task classify --ver v8 --scale n --width 224 --height 224 --nc 1000  # YOLOv8 
cargo run -r --example yolo -- --task classify --ver v11 --scale n --width 224 --height 224 --nc 1000  # YOLOv11 

# Detect
cargo run -r --example yolo -- --task detect --ver v5 --scale n  # YOLOv5 
cargo run -r --example yolo -- --task detect --ver v6 --scale n  # YOLOv6
cargo run -r --example yolo -- --task detect --ver v7 --scale t  # YOLOv7
cargo run -r --example yolo -- --task detect --ver v8 --scale n  # YOLOv8
cargo run -r --example yolo -- --task detect --ver v9 --scale t  # YOLOv9
cargo run -r --example yolo -- --task detect --ver v10 --scale n  # YOLOv10
cargo run -r --example yolo -- --task detect --ver v11 --scale n  # YOLOv11
cargo run -r --example yolo -- --task detect --ver rtdetr --scale l  # RTDETR
cargo run -r --example yolo -- --task detect --ver v8 --model yolo/v8-s-world-v2-shoes.onnx  # YOLOv8-world

# Pose
cargo run -r --example yolo -- --task pose --ver v8 --scale n   # YOLOv8-Pose
cargo run -r --example yolo -- --task pose --ver v11 --scale n  # YOLOv11-Pose

# Segment
cargo run -r --example yolo -- --task segment --ver v5 --scale n  # YOLOv5-Segment
cargo run -r --example yolo -- --task segment --ver v8 --scale n  # YOLOv8-Segment
cargo run -r --example yolo -- --task segment --ver v11 --scale n  # YOLOv8-Segment
cargo run -r --example yolo -- --task segment --ver v8 --model yolo/FastSAM-s-dyn-f16.onnx  # FastSAM

# Obb
cargo run -r --example yolo -- --ver v8 --task obb --scale n --width 1024 --height 1024 --source images/dota.png  # YOLOv8-Obb
cargo run -r --example yolo -- --ver v11 --task obb --scale n --width 1024 --height 1024 --source images/dota.png  # YOLOv11-Obb

cargo run -r --example yolo -- --help for more options

YOLOs configs with Options

Use official YOLO Models
let options = Options::default()
    .with_yolo_version(YOLOVersion::V5)  // YOLOVersion: V5, V6, V7, V8, V9, V10, RTDETR
    .with_yolo_task(YOLOTask::Classify)  // YOLOTask: Classify, Detect, Pose, Segment, Obb
    .with_model("xxxx.onnx")?;
Cutomized your own YOLO model
// This config is for YOLOv8-Segment 
use usls::{AnchorsPosition, BoxType, ClssType, YOLOPreds};

let options = Options::default()
    .with_yolo_preds(
        YOLOPreds {
            bbox: Some(BoxType::Cxcywh),
            clss: ClssType::Clss,
            coefs: Some(true),
            anchors: Some(AnchorsPosition::After),
            ..Default::default()
        }
    )
    // .with_nc(80)
    // .with_names(&COCO_CLASS_NAMES_80)
    .with_model("xxxx.onnx")?;

Other YOLOv8 Solution Models

Model Weights Datasets
Face-Landmark Detection yolov8-face-dyn-f16
Head Detection yolov8-head-f16
Fall Detection yolov8-falldown-f16
Trash Detection yolov8-plastic-bag-f16
FaceParsing yolov8-face-parsing-dyn CelebAMask-HQ
[Processed YOLO labels][Python Script]

Export ONNX Models

YOLOv5

Here

YOLOv6

Here

YOLOv7

Here

YOLOv8, YOLOv11
pip install -U ultralytics

# export onnx model with dynamic shapes
yolo export model=yolov8m.pt format=onnx simplify dynamic
yolo export model=yolov8m-cls.pt format=onnx simplify dynamic
yolo export model=yolov8m-pose.pt format=onnx simplify dynamic
yolo export model=yolov8m-seg.pt format=onnx simplify dynamic
yolo export model=yolov8m-obb.pt format=onnx simplify dynamic

# export onnx model with fixed shapes
yolo export model=yolov8m.pt format=onnx simplify
yolo export model=yolov8m-cls.pt format=onnx simplify
yolo export model=yolov8m-pose.pt format=onnx simplify
yolo export model=yolov8m-seg.pt format=onnx simplify
yolo export model=yolov8m-obb.pt format=onnx simplify
YOLOv9

Here

YOLOv10

Here