Minor adjustments to YOLO (#17)

This commit is contained in:
Jamjamjon
2024-06-02 12:49:42 +08:00
committed by GitHub
parent 20577e4242
commit 311d49f5b7
5 changed files with 116 additions and 122 deletions

View File

@@ -1,15 +1,14 @@
use usls::{
models::{YOLOTask, YOLO},
models::{YOLOTask, YOLOVersion, YOLO},
Annotator, DataLoader, Options,
};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// build model
let options = Options::default()
.with_conf_independent(true)
.with_anchors_first(true)
.with_yolo_version(YOLOVersion::V5)
.with_model("../models/yolov5s-seg.onnx")?
.with_yolo_task(YOLOTask::Segment)
.with_model("yolov5s-seg.onnx")?
// .with_trt(0)
// .with_fp16(true)
.with_i00((1, 1, 4).into())

View File

@@ -3,11 +3,11 @@ use usls::{coco, models::YOLO, Annotator, DataLoader, Options};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// build model
let options = Options::default()
// .with_model("yolov8m-dyn.onnx")?
.with_model("yolov8m-dyn.onnx")?
// .with_model("yolov8m-dyn-f16.onnx")?
// .with_model("yolov8m-pose-dyn.onnx")?
// .with_model("yolov8m-cls-dyn.onnx")?
.with_model("yolov8m-seg-dyn.onnx")?
// .with_model("yolov8m-seg-dyn.onnx")?
// .with_model("yolov8m-obb-dyn.onnx")?
// .with_model("yolov8m-oiv7-dyn.onnx")?
// .with_trt(0)
@@ -19,7 +19,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.with_i03((224, 640, 800).into())
.with_confs(&[0.4, 0.15]) // class 0: 0.4, others: 0.15
.with_names2(&coco::KEYPOINTS_NAMES_17)
// .with_dry_run(10)
.with_profile(false);
let mut model = YOLO::new(options)?;

View File

@@ -1,9 +1,13 @@
use usls::{models::YOLO, Annotator, DataLoader, Options};
use usls::{
models::{YOLOVersion, YOLO},
Annotator, DataLoader, Options,
};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// build model
let options = Options::default()
.with_model("yolov9-c-dyn-f16.onnx")?
.with_model("../models/yolov9-c.onnx")?
.with_yolo_version(YOLOVersion::V9)
.with_i00((1, 1, 4).into())
.with_i02((416, 640, 800).into())
.with_i03((416, 640, 800).into())