From 37004810712d80b96739753231519d1ac7c14198 Mon Sep 17 00:00:00 2001
From: "Daniel.Frisinghelli" <daniel.frisinghelli@eurac.edu>
Date: Fri, 26 Feb 2021 09:46:21 +0100
Subject: [PATCH] Just set accuracy as title when plotting samples.

---
 pysegcnn/core/graphics.py | 2 +-
 pysegcnn/core/trainer.py  | 9 +--------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/pysegcnn/core/graphics.py b/pysegcnn/core/graphics.py
index a1b64a9..0b76ac3 100644
--- a/pysegcnn/core/graphics.py
+++ b/pysegcnn/core/graphics.py
@@ -304,7 +304,7 @@ def plot_sample(x, use_bands, labels,
         # check whether the ground truth is specified and calculate accuracy
         if y is not None and accuracy:
             acc = accuracy_function(v, y)
-            k += ' ({:.2f}%)'.format(acc * 100)
+            k = '{:.2f}%'.format(acc * 100)
 
         # plot model prediction
         ax.imshow(v, cmap=cmap, interpolation='nearest', norm=norm)
diff --git a/pysegcnn/core/trainer.py b/pysegcnn/core/trainer.py
index 689f9c5..206e780 100644
--- a/pysegcnn/core/trainer.py
+++ b/pysegcnn/core/trainer.py
@@ -2591,19 +2591,12 @@ class NetworkInference(BaseConfig):
 
                     # plot current scene
                     if self.plot:
-
-                        # title for prediction
-                        title = ''.join([
-                            (v[0] + str(k)) for k, v in
-                            self.src_ds.dataset.sensor.band_dict().items()
-                            if v in self.bands])
-
                         # plot inputs, ground truth and model predictions
                         fig = plot_sample(inputs.clip(0, 1),
                                           self.bands,
                                           self.use_labels,
                                           y=labels,
-                                          y_pred={title: prdctn},
+                                          y_pred={'Prediction': prdctn},
                                           accuracy=True,
                                           **self.plot_kwargs)
 
-- 
GitLab