forked from jamjamjon/usls
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread_video.rs
More file actions
36 lines (31 loc) · 895 Bytes
/
Copy pathread_video.rs
File metadata and controls
36 lines (31 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use usls::DataLoader;
#[derive(argh::FromArgs)]
/// Example
struct Args {
/// source
#[argh(
option,
default = "String::from(\"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4\")"
)]
source: String,
}
fn main() -> anyhow::Result<()> {
let args: Args = argh::from_env();
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.with_timer(tracing_subscriber::fmt::time::ChronoLocal::rfc_3339())
.init();
// load images or video stream
let dl = DataLoader::new(args.source.as_str())?
.with_batch(1)
// .with_nf_skip(1)
// .with_progress_bar(true)
.build()?;
// iterate over the dataloader
for images in &dl {
for image in &images {
println!("## {:?}", image);
}
}
Ok(())
}