From 235fa776fdd3cedb5fab8b1512f62c83433118e2 Mon Sep 17 00:00:00 2001 From: Lewis Fishgold Date: Thu, 2 Jul 2020 20:05:42 -0400 Subject: [PATCH] Fix speckles in dataset viz I think matplotlib somehow got upgraded and it made the training chips get speckly and I applied this fix: https://github.com/matplotlib/matplotlib/issues/17732 --- .../pytorch_learner/semantic_segmentation_learner.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rastervision_pytorch_learner/rastervision/pytorch_learner/semantic_segmentation_learner.py b/rastervision_pytorch_learner/rastervision/pytorch_learner/semantic_segmentation_learner.py index 06209fbca..6bbe79fbe 100644 --- a/rastervision_pytorch_learner/rastervision/pytorch_learner/semantic_segmentation_learner.py +++ b/rastervision_pytorch_learner/rastervision/pytorch_learner/semantic_segmentation_learner.py @@ -141,4 +141,10 @@ def plot_xyz(self, ax, x, y, z=None): colors = [tuple([_c / 255 for _c in c]) for c in colors] cmap = matplotlib.colors.ListedColormap(colors) labels = labels.numpy() - ax.imshow(labels, alpha=0.4, vmin=0, vmax=len(colors), cmap=cmap) + ax.imshow( + labels, + alpha=0.4, + vmin=0, + vmax=len(colors), + cmap=cmap, + interpolation='none')