use std::cli; use console; use osprey; fn main() { let argv = cli_args(); let count = args_len(argv); if count == 1 && args_at(argv, 0) == "--help" { println!("Score a detection against a reference after clipping both to the camera frame."); println!("Usage: osprey pred truth width height threshold"); println!("Vector arguments are comma-separated; use [] for an empty vector."); return; } let mut result = []; if count == 0 { result = osprey_compare([-2, 0, 2, 2], [0, 0, 4, 2], 4.0, 4.0, 0.5); } else { if count != 5 { stderr_line("Wrong argument count. Use --help."); process_exit(2); } let pred = console_vector(args_at(argv, 0)); let truth = console_vector(args_at(argv, 1)); let width = console_value(args_at(argv, 2)); let height = console_value(args_at(argv, 3)); let threshold = console_value(args_at(argv, 4)); result = osprey_compare(pred, truth, width, height, threshold); } if len(result) == 0 { stderr_line("Invalid input for Osprey. See the package input contract."); process_exit(1); } let mut i = 0; while i < len(result) { println!(at(result, i)); i += 1; } }