From c05836f02e4be48d6b5adf6ecdba6e6058263fff Mon Sep 17 00:00:00 2001 From: Jamjamjon <51357717+jamjamjon@users.noreply.github.com> Date: Sun, 14 Apr 2024 18:11:09 +0800 Subject: [PATCH] Clean up --- .github/workflows/rust-ci.yml | 4 ++-- Cargo.toml | 1 - examples/dinov2/main.rs | 1 - src/core/options.rs | 4 ++-- src/core/utils.rs | 1 - src/models/yolo.rs | 2 -- 6 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 211ba64..e249782 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macOS-latest] + os: [ubuntu-latest, macOS-latest, windows-latest] rust: [stable] steps: - uses: actions/checkout@v2 @@ -31,7 +31,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macOS-latest] + os: [ubuntu-latest, macOS-latest, windows-latest] rust: [stable] steps: - uses: actions/checkout@v2 diff --git a/Cargo.toml b/Cargo.toml index a0ae5d6..e5d10fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,6 @@ ureq = { version = "2.9.1", default-features = true, features = [ ] } walkdir = { version = "2.5.0" } tokenizers = { version = "0.15.2" } -usearch = { version = "2.10.4" } rayon = "1.10.0" indicatif = "0.17.8" image = "0.25.1" diff --git a/examples/dinov2/main.rs b/examples/dinov2/main.rs index 38bcdf6..76310fa 100644 --- a/examples/dinov2/main.rs +++ b/examples/dinov2/main.rs @@ -4,7 +4,6 @@ fn main() -> Result<(), Box> { // build model let options = Options::default() .with_model("../models/dinov2-s14-dyn-f16.onnx") - // .with_model("../models/dinov2-b14-dyn.onnx") .with_i00((1, 1, 1).into()) .with_i02((224, 224, 224).into()) .with_i03((224, 224, 224).into()); diff --git a/src/core/options.rs b/src/core/options.rs index 9a1dd01..2041b6f 100644 --- a/src/core/options.rs +++ b/src/core/options.rs @@ -46,8 +46,8 @@ pub struct Options { pub apply_nms: bool, pub tokenizer: Option, pub vocab: Option, - pub names: Option>, // class names - pub names2: Option>, // could be keypoints names + pub names: Option>, // names + pub names2: Option>, // names2, could be keypoints names pub anchors_first: bool, // otuput format: [bs, anchors/na, pos+nc+nm] pub min_width: Option, pub min_height: Option, diff --git a/src/core/utils.rs b/src/core/utils.rs index 7a80fd2..fe76ff5 100644 --- a/src/core/utils.rs +++ b/src/core/utils.rs @@ -5,7 +5,6 @@ use std::io::{Read, Write}; use std::path::{Path, PathBuf}; pub fn auto_load>(src: P) -> Result { - // check if input file exists let src = src.as_ref(); let p = if src.is_file() { src.into() diff --git a/src/models/yolo.rs b/src/models/yolo.rs index 3d72a4b..c17cd24 100644 --- a/src/models/yolo.rs +++ b/src/models/yolo.rs @@ -153,8 +153,6 @@ impl YOLO { let mut ys = Vec::new(); for (idx, anchor) in preds.axis_iter(Axis(0)).enumerate() { - // [b, 4 + nc + nm, na] - // input image let width_original = xs0[idx].width() as f32; let height_original = xs0[idx].height() as f32; let ratio = (self.width() as f32 / width_original)