0.0.14: DataLoader now support video and streaming

- Added `Hub` for resource management
- Updated `DataLoader` to support video and streaming
- Updated `CI`
- Replaced `println!` with `tracing` for logging
This commit is contained in:
Jamjamjon
2024-09-16 10:41:16 +08:00
committed by GitHub
parent 826da4037e
commit 0adddd3bbd
82 changed files with 1739 additions and 583 deletions

View File

@ -4,12 +4,7 @@
cargo run -r --example modnet
```
## ONNX Model
- [modnet-dyn](https://github.com/jamjamjon/assets/releases/download/v0.0.1/modnet-dyn.onnx)
## Results
![](./demo.png)
![](https://github.com/jamjamjon/assets/releases/download/modnet/demo.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

View File

@ -3,14 +3,14 @@ use usls::{models::MODNet, Annotator, DataLoader, Options};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// build model
let options = Options::default()
.with_model("modnet-dyn.onnx")?
.with_model("modnet/dyn-f32.onnx")?
.with_i00((1, 1, 4).into())
.with_i02((416, 512, 800).into())
.with_i03((416, 512, 800).into());
let mut model = MODNet::new(options)?;
// load image
let x = vec![DataLoader::try_read("./assets/liuyifei.png")?];
let x = [DataLoader::try_read("images/liuyifei.png")?];
// run
let y = model.run(&x)?;