From f94e06f29af64a36862efb069641e2128c4ba8e4 Mon Sep 17 00:00:00 2001
From: "Daniel.Frisinghelli" <daniel.frisinghelli@eurac.edu>
Date: Tue, 2 Mar 2021 16:39:25 +0100
Subject: [PATCH] Force Float32 dtype when plotting.

---
 pysegcnn/core/graphics.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pysegcnn/core/graphics.py b/pysegcnn/core/graphics.py
index 0b76ac3..4f696ae 100644
--- a/pysegcnn/core/graphics.py
+++ b/pysegcnn/core/graphics.py
@@ -243,7 +243,7 @@ def plot_sample(x, use_bands, labels,
     # check whether to apply constrast stretching
     rgb = np.dstack([np.clip(
         contrast_stretching(x[use_bands.index(band), ...], alpha), 0, 1)
-        for band in bands])
+        for band in bands]).astype(np.float32)
 
     # sort the labels in ascending order
     sorted_labels = {k: v for k, v in sorted(labels.items())}
-- 
GitLab