SHARE
TWEET

Untitled

a guest Jun 26th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #[macro_use]
  2. extern  crate clap;
  3. use clap::{App, ArgMatches, Arg};
  4.  
  5. fn main() {
  6.     let matches = parse_args();
  7.     println!("Input video is: {}", matches.value_of("INPUT").unwrap());
  8. }
  9.  
  10. fn parse_args() -> ArgMatches {
  11.     let matches = App::new("My bachelor's diploma")
  12.         .version("1.0")
  13.         .author("Anton P.")
  14.         .about("Analyze road traffic to predict crashes")
  15.         .arg(Arg::with_name("INPUT")
  16.             .help("Sets the input video to use")
  17.             .required(true)
  18.             .index(1))
  19.         .arg(Arg::with_name("OUTPUT")
  20.             .help("Sets the output video file name")
  21.             .required(true)
  22.             .index(2))
  23.         .arg(Arg::with_name("YOLO")
  24.             .help("Sets the input YOLO config path")
  25.             .required(true)
  26.             .index(3))
  27.         .arg(Arg::with_name("confidence")
  28.             .help("Minimum probability to filter weak detections")
  29.             .default_value("0.5")
  30.             .required(false)
  31.             .long("confidence")
  32.             .short("c"))
  33.         .arg(Arg::with_name("threshold")
  34.             .help("Threshold when applying non-maxima suppression")
  35.             .default_value("0.3")
  36.             .required(false)
  37.             .long("threshold")
  38.             .short("t"))
  39.         .get_matches();
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top