From fd3506d3abb0927ce483035ff7b5665e1c4f4f3d Mon Sep 17 00:00:00 2001 From: Josef Haupt Date: Wed, 7 Aug 2024 14:26:31 +0200 Subject: [PATCH] Added labels to review tab regression plot (#400) Co-authored-by: Josef Haupt --- gui.py | 6 +++++- lang/de.json | 3 +++ lang/en.json | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gui.py b/gui.py index e65f2625..0df29066 100644 --- a/gui.py +++ b/gui.py @@ -1348,7 +1348,7 @@ def on_autotune_change(value): label=loc.localize("training-tab-crop-mode-radio-label"), info=loc.localize("training-tab-crop-mode-radio-info"), ) - + crop_overlap = gr.Slider( minimum=0, maximum=2.99, @@ -1610,6 +1610,10 @@ def create_log_plot(positives, negatives, fig_num=None): ax = f.add_subplot(111) ax.set_xlim(0, 1) ax.set_yticks([0, 1]) + ax.set_ylabel( + f"{loc.localize('review-tab-regression-plot-y-label-false')}/{loc.localize('review-tab-regression-plot-y-label-true')}" + ) + ax.set_xlabel(loc.localize("review-tab-regression-plot-x-label")) x_vals = [float(os.path.basename(fl).split("_", 1)[0]) for fl in positives + negatives] y_val = [1] * len(positives) + [0] * len(negatives) diff --git a/lang/de.json b/lang/de.json index c5c1af24..5f5c7ba2 100644 --- a/lang/de.json +++ b/lang/de.json @@ -143,6 +143,9 @@ "review-tab-no-species-found-error": "Keine Arten im ausgewählten Verzeichnis gefunden.", "review-tab-start-button-label": "Überprüfung starten", "review-tab-segment-matrix-count-header": "Anzahl", + "review-tab-regression-plot-x-label": "Konfidenzwert", + "review-tab-regression-plot-y-label-false": "Falsch", + "review-tab-regression-plot-y-label-true": "Wahr", "species-tab-title": "Arten", "species-tab-select-output-directory-button-label": "Wählen Sie das Ausgabeverzeichnis", "species-tab-filename-textbox-label": "Name der Datei, wenn nicht angegeben, wird 'species_list.txt' verwendet.", diff --git a/lang/en.json b/lang/en.json index 9e84e718..29d4de01 100644 --- a/lang/en.json +++ b/lang/en.json @@ -143,6 +143,9 @@ "review-tab-no-species-found-error": "No species found in the selected directory.", "review-tab-start-button-label": "Start reviewing", "review-tab-segment-matrix-count-header": "Count", + "review-tab-regression-plot-x-label": "Confidence", + "review-tab-regression-plot-y-label-false": "False", + "review-tab-regression-plot-y-label-true": "True", "species-tab-title": "Species", "species-tab-select-output-directory-button-label": "Select output directory", "species-tab-filename-textbox-label": "Name of the file, if not specified 'species_list.txt' will be used.",