train running dataset fixed

This commit is contained in:
steffen
2020-03-05 20:50:07 +01:00
parent 1f25bf599b
commit 05033bed75
11 changed files with 41 additions and 49 deletions
+4 -4
View File
@@ -45,7 +45,7 @@ class Map(object):
@property
def as_2d_array(self):
return self.map_array[1:]
return self.map_array.squeeze()
def __init__(self, name='', array_like_map_representation=None):
if array_like_map_representation is not None:
@@ -145,9 +145,9 @@ class Map(object):
img = Image.new('L', (self.height, self.width), 0)
draw = ImageDraw.Draw(img)
draw.polygon(polyline, outline=255, fill=255)
draw.polygon(polyline, outline=1, fill=1)
a = (np.asarray(img) * np.where(self.as_2d_array == self.white, 0, 1)).sum()
a = (np.where(np.asarray(img) == self.white, 1, 0) * np.where(self.as_2d_array == self.white, 1, 0)).sum()
if a:
return False # Non-Homotoph
@@ -159,7 +159,7 @@ class Map(object):
# The standard colormaps also all have reversed versions.
# They have the same names with _r tacked on to the end.
# https: // matplotlib.org / api / pyplot_summary.html?highlight = colormaps
img = ax.imshow(self.as_array, cmap='Greys_r')
img = ax.imshow(self.as_2d_array, cmap='Greys_r')
return dict(img=img, fig=fig, ax=ax)