From e71c5d901beec2b15052785893f7250f958f7719 Mon Sep 17 00:00:00 2001 From: Lia Lenckowski Date: Thu, 28 Nov 2024 16:16:23 +0100 Subject: wrap help, add flag for path rotation, change default 2-opt iteration count --- src/main.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 45621cf..3055768 100644 --- a/src/main.rs +++ b/src/main.rs @@ -67,9 +67,14 @@ struct Args { tsp_approx: TspBaseAlg, /// Number of 2-Opt refinement steps. Has quickly diminishing returns - #[arg(short = 'r', default_value = "3")] + #[arg(short = 'r', default_value = "5")] refine: usize, + /// Don't try to improve result by rotating the output path such that less emphasis is put on + /// the similarity of the first and last image + #[arg(long)] + no_rotate: bool, + /// Ignore failed embeddings #[arg(short = 'i', long)] ignore_errors: bool, @@ -174,7 +179,13 @@ where }) .unzip(); - let (tsp_path, total_dist) = tsp(&embeds, &args.tsp_approx, args.refine, &args.hash_seed); + let (tsp_path, total_dist) = tsp( + &embeds, + &args.tsp_approx, + args.refine, + !args.no_rotate, + &args.hash_seed, + ); Ok(( tsp_path.iter().map(|i| images[*i].clone()).collect(), -- cgit v1.2.3-70-g09d2