Skip to content

Commit

Permalink
Add YOLOv12 model
Browse files Browse the repository at this point in the history
  • Loading branch information
jamjamjon authored Feb 20, 2025
1 parent 018b884 commit fcc3ba9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

**usls** is a Rust library integrated with **ONNXRuntime**, offering a suite of advanced models for **Computer Vision** and **Vision-Language** tasks, including:

- **YOLO Models**: [YOLOv5](https://github.com/ultralytics/yolov5), [YOLOv6](https://github.com/meituan/YOLOv6), [YOLOv7](https://github.com/WongKinYiu/yolov7), [YOLOv8](https://github.com/ultralytics/ultralytics), [YOLOv9](https://github.com/WongKinYiu/yolov9), [YOLOv10](https://github.com/THU-MIG/yolov10), [YOLO11](https://github.com/ultralytics/ultralytics)
- **YOLO Models**: [YOLOv5](https://github.com/ultralytics/yolov5), [YOLOv6](https://github.com/meituan/YOLOv6), [YOLOv7](https://github.com/WongKinYiu/yolov7), [YOLOv8](https://github.com/ultralytics/ultralytics), [YOLOv9](https://github.com/WongKinYiu/yolov9), [YOLOv10](https://github.com/THU-MIG/yolov10), [YOLO11](https://github.com/ultralytics/ultralytics), [YOLOv12](https://github.com/sunsmarterjie/yolov12)
- **SAM Models**: [SAM](https://github.com/facebookresearch/segment-anything), [SAM2](https://github.com/facebookresearch/segment-anything-2), [MobileSAM](https://github.com/ChaoningZhang/MobileSAM), [EdgeSAM](https://github.com/chongzhou96/EdgeSAM), [SAM-HQ](https://github.com/SysCV/sam-hq), [FastSAM](https://github.com/CASIA-IVA-Lab/FastSAM)
- **Vision Models**: [RT-DETR](https://arxiv.org/abs/2304.08069), [RTMO](https://github.com/open-mmlab/mmpose/tree/main/projects/rtmo), [Depth-Anything](https://github.com/LiheYoung/Depth-Anything), [DINOv2](https://github.com/facebookresearch/dinov2), [MODNet](https://github.com/ZHKKKe/MODNet), [Sapiens](https://arxiv.org/abs/2408.12569), [DepthPro](https://github.com/apple/ml-depth-pro), [FastViT](https://github.com/apple/ml-fastvit), [BEiT](https://github.com/microsoft/unilm/tree/master/beit), [MobileOne](https://github.com/apple/ml-mobileone)
- **Vision-Language Models**: [CLIP](https://github.com/openai/CLIP), [jina-clip-v1](https://huggingface.co/jinaai/jina-clip-v1), [BLIP](https://arxiv.org/abs/2201.12086), [GroundingDINO](https://github.com/IDEA-Research/GroundingDINO), [YOLO-World](https://github.com/AILab-CVC/YOLO-World), [Florence2](https://arxiv.org/abs/2311.06242), [Moondream2](https://github.com/vikhyat/moondream/tree/main)
Expand All @@ -57,6 +57,7 @@
| [YOLOv8<br />YOLO11](https://github.com/ultralytics/ultralytics) | Object Detection<br />Instance Segmentation<br />Image Classification<br />Oriented Object Detection<br />Keypoint Detection | [demo](examples/yolo) ||||||
| [YOLOv9](https://github.com/WongKinYiu/yolov9) | Object Detection | [demo](examples/yolo) ||||||
| [YOLOv10](https://github.com/THU-MIG/yolov10) | Object Detection | [demo](examples/yolo) ||||||
| [YOLOv12](https://github.com/sunsmarterjie/yolov12) | Object Detection | [demo](examples/yolo) ||||||
| [RT-DETR](https://github.com/lyuwenyu/RT-DETR) | Object Detection | [demo](examples/rtdetr) |||| | |
| [PP-PicoDet](https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.8/configs/picodet) | Object Detection | [demo](examples/picodet-layout) |||| | |
| [DocLayout-YOLO](https://github.com/opendatalab/DocLayout-YOLO) | Object Detection | [demo](examples/picodet-layout) |||| | |
Expand Down
4 changes: 4 additions & 0 deletions src/models/yolo/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ impl Options {
Self::yolo().with_model_version(11.0.into())
}

pub fn yolo_v12() -> Self {
Self::yolo().with_model_version(12.0.into())
}

pub fn yolo_v8_n() -> Self {
Self::yolo()
.with_model_version(8.0.into())
Expand Down
9 changes: 5 additions & 4 deletions src/models/yolo/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ impl YOLO {
(Task::ObjectDetection, Version(5, 0) | Version(6, 0) | Version(7, 0)) => {
YOLOPredsFormat::n_a_cxcywh_confclss()
}
(Task::ObjectDetection, Version(8, 0) | Version(9, 0) | Version(11, 0)) => {
YOLOPredsFormat::n_cxcywh_clss_a()
}
(
Task::ObjectDetection,
Version(8, 0) | Version(9, 0) | Version(11, 0) | Version(12, 0),
) => YOLOPredsFormat::n_cxcywh_clss_a(),
(Task::ObjectDetection, Version(10, 0)) => {
YOLOPredsFormat::n_a_xyxy_confcls().apply_nms(false)
}
Expand All @@ -143,7 +144,7 @@ impl YOLO {
let layout = match version {
// single task, no need to specified task
Version(6, 0) | Version(7, 0) => YOLOPredsFormat::n_a_cxcywh_confclss(),
Version(9, 0) => YOLOPredsFormat::n_cxcywh_clss_a(),
Version(9, 0) | Version(12, 0) => YOLOPredsFormat::n_cxcywh_clss_a(),
Version(10, 0) => YOLOPredsFormat::n_a_xyxy_confcls().apply_nms(false),
_ => {
anyhow::bail!(
Expand Down

0 comments on commit fcc3ba9

Please sign in to comment.