-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jamjamjon
committed
Sep 13, 2024
1 parent
5720ed6
commit 35be2df
Showing
7 changed files
with
266 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
#![allow(unused)] | ||
use usls::{models::YOLO, Annotator, DataLoader, Options, Vision, YOLOTask, YOLOVersion}; | ||
|
||
fn main() -> anyhow::Result<()> { | ||
let options = Options::default() | ||
let options = Options::new() | ||
.with_cuda(0) | ||
.with_model("yolo/v8-m-dyn.onnx")? | ||
.with_yolo_version(YOLOVersion::V8) | ||
|
@@ -14,34 +13,31 @@ fn main() -> anyhow::Result<()> { | |
let mut model = YOLO::new(options)?; | ||
|
||
// build dataloader | ||
// let image = DataLoader::try_read("images/car.jpg")?; | ||
let dl = DataLoader::new( | ||
// "rtsp://admin:[email protected]:554/h265/ch1/", | ||
// "rtsp://admin:[email protected]:554/h264/ch1/", | ||
// "../hall.mp4", | ||
// "./assets/bus.jpg", | ||
"./assets/bus.jpg", | ||
// "images/car.jpg", | ||
// "../set-negs", | ||
// "/home/qweasd/Desktop/coco/val2017/images/test", | ||
"/home/qweasd/Desktop/SourceVideos/3.mp4", | ||
// "/home/qweasd/Desktop/SourceVideos/3.mp4", | ||
// "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4", | ||
)? | ||
.with_batch(1) | ||
.build()?; | ||
|
||
// build annotator | ||
let annotator = Annotator::default() | ||
.with_bboxes_thickness(4) | ||
.with_saveout("YOLO-DataLoader"); | ||
// // build annotator | ||
let annotator = Annotator::new().with_saveout("YOLO-DataLoader"); | ||
|
||
for (xs, _paths) in dl { | ||
println!("xs: {:?} | {:?}", xs.len(), _paths); | ||
// run | ||
for (xs, _) in dl { | ||
let ys = model.forward(&xs, false)?; | ||
annotator.annotate(&xs, &ys); | ||
} | ||
|
||
// images -> video | ||
// DataLoader::new("runs/YOLO-DataLoader")?.to_video(30)?; | ||
DataLoader::is2v("runs/YOLO-DataLoader", &["runs", "is2v"], 24)?; | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.