Options -> ModelConfig

This commit is contained in:
jamjamjon
2025-05-16 15:45:27 +08:00
parent 54045543fc
commit 70e6b2f03e
118 changed files with 1735 additions and 2503 deletions

View File

@ -1,5 +1,5 @@
use anyhow::Result;
use usls::{models::RTDETR, Annotator, DataLoader, Options};
use usls::{models::RTDETR, Annotator, DataLoader, ModelConfig};
fn main() -> Result<()> {
tracing_subscriber::fmt()
@ -7,15 +7,14 @@ fn main() -> Result<()> {
.with_timer(tracing_subscriber::fmt::time::ChronoLocal::rfc_3339())
.init();
// options
let options = Options::rtdetr_v2_s_coco()
// rtdetr_v1_r18vd_coco()
// rtdetr_v2_ms_coco()
// rtdetr_v2_m_coco()
// rtdetr_v2_l_coco()
// rtdetr_v2_x_coco()
.commit()?;
let mut model = RTDETR::new(options)?;
// config
let config = ModelConfig::rtdetr_v2_s_coco().commit()?;
// rtdetr_v1_r18vd_coco()
// rtdetr_v2_ms_coco()
// rtdetr_v2_m_coco()
// rtdetr_v2_l_coco()
// rtdetr_v2_x_coco()
let mut model = RTDETR::new(config)?;
// load
let xs = DataLoader::try_read_n(&["./assets/bus.jpg"])?;