From 24a3da88ef5adde6a94a862ad44207ec553bef40 Mon Sep 17 00:00:00 2001 From: Lilian Mallardeau Date: Tue, 30 Nov 2021 04:32:31 +0100 Subject: [PATCH] Allow comparison_plots.py to take trackers name to include in plots Allow the comparison_plots.py script to take as parameters a list of trackers to include in the generated plots. If no parameter is provided, all the trackers found in the trackers folder are included (default and previous behavior). If a tracker name is provided as parameter but not found in the trackers folder, an exception is raised and the script stops. --- scripts/comparison_plots.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/comparison_plots.py b/scripts/comparison_plots.py index a338f97c..a1d9c32c 100644 --- a/scripts/comparison_plots.py +++ b/scripts/comparison_plots.py @@ -16,5 +16,12 @@ data_fol = os.path.join(tracker_folder, dataset) trackers = os.listdir(data_fol) out_loc = os.path.join(plots_folder, dataset) + +if len(sys.argv[1:]) > 0: + if not set(sys.argv[1:]).issubset(set(trackers)): + not_found_trackers = set(sys.argv[1:]) - set(trackers) + raise Exception(f"The following trackers could not be found in {data_fol}: {', '.join(not_found_trackers)}") + trackers = sys.argv[1:] + for cls in classes: trackeval.plotting.plot_compare_trackers(data_fol, trackers, cls, out_loc)