1 use anyhow::{Context, Result}; 2 use std::fs; 3 use test_programs::nn::{sort_results, wit}; 4 main() -> Result<()>5pub fn main() -> Result<()> { 6 let graph = wit::load_by_name("mobilenet")?; 7 let tensor = fs::read("fixture/tensor.bgr") 8 .context("the tensor file to be mapped to the fixture directory")?; 9 let results = wit::classify(graph, ("input", tensor))?; 10 let top_five = &sort_results(&results)[..5]; 11 println!("found results, sorted top 5: {top_five:?}"); 12 assert_eq!(top_five[0].class_id(), 284); 13 Ok(()) 14 } 15