Skip to content

Commit

Permalink
0.0.5 (#24)
Browse files Browse the repository at this point in the history
* Using Rayon to accelarate YOLO post-processing

* Refactor YOLO with outputs format

* Optimize `conf * clss` for yolov5 v6 v7

* Add depth-anything-v2

* Update README.md

* Update CHANGELOG.md
  • Loading branch information
jamjamjon authored Jul 12, 2024
1 parent 25d9088 commit edc3a88
Show file tree
Hide file tree
Showing 69 changed files with 1,564 additions and 1,204 deletions.
34 changes: 30 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,46 @@
## v0.0.5 - 2024-07-12

### Changed

- Accelerated `YOLO`'s post-processing using `Rayon`. Now, `YOLOv8-seg` takes only around **~8ms (~20ms in the previous version)**, depending on your machine. Note that this repo's implementation of `YOLOv8-Segment` saves not only the masks but also their contour points. The official `YOLOv8` Python version only saves the masks, making it appear much faster.
- Merged all `YOLOv8-related` solution models into YOLO examples.
- Consolidated all `YOLO-series` model examples into the YOLO example.
- Refactored the `YOLO` struct to unify all `YOLO versions` and `YOLO tasks`. It now supports user-defined YOLO models with different `Preds Tensor Formats`.
- Introduced a new `Nms` trait, combining `apply_bboxes_nms()` and `apply_mbrs_nms()` into `apply_nms()`.

### Added

- Added support for `YOLOv6` and `YOLOv7`.
- Updated documentation for `y.rs`.
- Updated documentation for `bbox.rs`.
- Updated the `README.md`.
- Added `with_yolo_preds()` to `Options`.
- Added support for `Depth-Anything-v2`.
- Added `RTDETR` to the `YOLOVersion` struct.

### Removed

- Merged the following models' examples into the YOLOv8 example: `yolov8-face`, `yolov8-falldown`, `yolov8-head`, `yolov8-trash`, `fastsam`, and `face-parsing`.
- Removed `anchors_first`, `conf_independent`, and their related methods from `Options`.


## v0.0.4 - 2024-06-30

### Added

- Add X struct to handle input and preprocessing
- Add X struct to handle input and preprocessing
- Add Ops struct to manage common operations
- Use SIMD (fast_image_resize) to accelerate model pre-processing and post-processing.YOLOv8-seg post-processing (~120ms => ~20ms), Depth-Anything post-processing (~23ms => ~2ms).

### Deprecated
- Mark `Ops::descale_mask()` as deprecated.

- Mark `Ops::descale_mask()` as deprecated.

### Fixed
### Fixed

### Changed

### Removed
### Removed

### Refactored

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "usls"
version = "0.0.4"
version = "0.0.5"
edition = "2021"
description = "A Rust library integrated with ONNXRuntime, providing a collection of ML models."
repository = "https://github.com/jamjamjon/usls"
Expand All @@ -11,7 +11,7 @@ exclude = ["assets/*", "examples/*"]

[dependencies]
clap = { version = "4.2.4", features = ["derive"] }
ndarray = { version = "0.15.6" }
ndarray = { version = "0.15.6", features = ["rayon"] }
ort = { version = "2.0.0-rc.2", default-features = false, features = [
"load-dynamic",
"copy-dylibs",
Expand Down
145 changes: 49 additions & 96 deletions README.md

Large diffs are not rendered by default.

Binary file removed assets/falldown.jpg
Binary file not shown.
Binary file removed assets/trash.jpg
Binary file not shown.
1 change: 1 addition & 0 deletions examples/depth-anything/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cargo run -r --example depth-anything
- [depth-anything-s-dyn](https://github.com/jamjamjon/assets/releases/download/v0.0.1/depth-anything-s-dyn.onnx)
- [depth-anything-b-dyn](https://github.com/jamjamjon/assets/releases/download/v0.0.1/depth-anything-b-dyn.onnx)
- [depth-anything-l-dyn](https://github.com/jamjamjon/assets/releases/download/v0.0.1/depth-anything-l-dyn.onnx)
- [depth-anything-v2-s](https://github.com/jamjamjon/assets/releases/download/v0.0.1/depth-anything-v2-s.onnx)


## Results
Expand Down
5 changes: 3 additions & 2 deletions examples/depth-anything/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use usls::{models::DepthAnything, Annotator, DataLoader, Options};

fn main() -> Result<(), Box<dyn std::error::Error>> {
// visual
// options
let options = Options::default()
.with_model("depth-anything-s-dyn.onnx")?
// .with_model("depth-anything-s-dyn.onnx")?
.with_model("depth-anything-v2-s.onnx")?
.with_i00((1, 1, 8).into())
.with_i02((384, 512, 1024).into())
.with_i03((384, 512, 1024).into());
Expand Down
93 changes: 0 additions & 93 deletions examples/face-parsing/README.md

This file was deleted.

32 changes: 0 additions & 32 deletions examples/face-parsing/main.rs

This file was deleted.

23 changes: 0 additions & 23 deletions examples/fastsam/README.md

This file was deleted.

24 changes: 0 additions & 24 deletions examples/fastsam/main.rs

This file was deleted.

21 changes: 0 additions & 21 deletions examples/rtdetr/README.md

This file was deleted.

Binary file removed examples/rtdetr/demo.png
Binary file not shown.
22 changes: 0 additions & 22 deletions examples/rtdetr/main.rs

This file was deleted.

43 changes: 0 additions & 43 deletions examples/yolo-world/README.md

This file was deleted.

25 changes: 0 additions & 25 deletions examples/yolo-world/main.rs

This file was deleted.

Loading

0 comments on commit edc3a88

Please sign in to comment.