Clean up
This commit is contained in:
parent
a717b98f7b
commit
c05836f02e
|
|
@ -12,7 +12,7 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macOS-latest]
|
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||||
rust: [stable]
|
rust: [stable]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
@ -31,7 +31,7 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macOS-latest]
|
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||||
rust: [stable]
|
rust: [stable]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ ureq = { version = "2.9.1", default-features = true, features = [
|
||||||
] }
|
] }
|
||||||
walkdir = { version = "2.5.0" }
|
walkdir = { version = "2.5.0" }
|
||||||
tokenizers = { version = "0.15.2" }
|
tokenizers = { version = "0.15.2" }
|
||||||
usearch = { version = "2.10.4" }
|
|
||||||
rayon = "1.10.0"
|
rayon = "1.10.0"
|
||||||
indicatif = "0.17.8"
|
indicatif = "0.17.8"
|
||||||
image = "0.25.1"
|
image = "0.25.1"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
// build model
|
// build model
|
||||||
let options = Options::default()
|
let options = Options::default()
|
||||||
.with_model("../models/dinov2-s14-dyn-f16.onnx")
|
.with_model("../models/dinov2-s14-dyn-f16.onnx")
|
||||||
// .with_model("../models/dinov2-b14-dyn.onnx")
|
|
||||||
.with_i00((1, 1, 1).into())
|
.with_i00((1, 1, 1).into())
|
||||||
.with_i02((224, 224, 224).into())
|
.with_i02((224, 224, 224).into())
|
||||||
.with_i03((224, 224, 224).into());
|
.with_i03((224, 224, 224).into());
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ pub struct Options {
|
||||||
pub apply_nms: bool,
|
pub apply_nms: bool,
|
||||||
pub tokenizer: Option<String>,
|
pub tokenizer: Option<String>,
|
||||||
pub vocab: Option<String>,
|
pub vocab: Option<String>,
|
||||||
pub names: Option<Vec<String>>, // class names
|
pub names: Option<Vec<String>>, // names
|
||||||
pub names2: Option<Vec<String>>, // could be keypoints names
|
pub names2: Option<Vec<String>>, // names2, could be keypoints names
|
||||||
pub anchors_first: bool, // otuput format: [bs, anchors/na, pos+nc+nm]
|
pub anchors_first: bool, // otuput format: [bs, anchors/na, pos+nc+nm]
|
||||||
pub min_width: Option<f32>,
|
pub min_width: Option<f32>,
|
||||||
pub min_height: Option<f32>,
|
pub min_height: Option<f32>,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ use std::io::{Read, Write};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
pub fn auto_load<P: AsRef<Path>>(src: P) -> Result<String> {
|
pub fn auto_load<P: AsRef<Path>>(src: P) -> Result<String> {
|
||||||
// check if input file exists
|
|
||||||
let src = src.as_ref();
|
let src = src.as_ref();
|
||||||
let p = if src.is_file() {
|
let p = if src.is_file() {
|
||||||
src.into()
|
src.into()
|
||||||
|
|
|
||||||
|
|
@ -153,8 +153,6 @@ impl YOLO {
|
||||||
|
|
||||||
let mut ys = Vec::new();
|
let mut ys = Vec::new();
|
||||||
for (idx, anchor) in preds.axis_iter(Axis(0)).enumerate() {
|
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 width_original = xs0[idx].width() as f32;
|
||||||
let height_original = xs0[idx].height() as f32;
|
let height_original = xs0[idx].height() as f32;
|
||||||
let ratio = (self.width() as f32 / width_original)
|
let ratio = (self.width() as f32 / width_original)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue