1 use anyhow::{Context, Result}; 2 use std::fs; 3 use test_programs::nn::{sort_results, witx}; 4 main() -> Result<()>5pub fn main() -> Result<()> { 6 let graph = witx::load_by_name( 7 "fixtures", 8 witx::GraphEncoding::Openvino, 9 witx::ExecutionTarget::CPU, 10 )?; 11 let tensor: Vec<u8> = fs::read("fixture/tensor.bgr") 12 .context("the tensor file to be mapped to the fixture directory")?; 13 let results = witx::classify(graph, tensor)?; 14 let top_five = &sort_results(&results)[..5]; 15 println!("found results, sorted top 5: {top_five:?}"); 16 Ok(()) 17 } 18