project Refactor, CNN Classifier Basics
This commit is contained in:
+5
-4
@@ -12,6 +12,7 @@ import networkx as nx
|
||||
from matplotlib import pyplot as plt
|
||||
|
||||
from lib.objects.trajectory import Trajectory
|
||||
import lib.variables as V
|
||||
|
||||
|
||||
class Map(object):
|
||||
@@ -145,14 +146,14 @@ class Map(object):
|
||||
|
||||
img = Image.new('L', (self.height, self.width), 0)
|
||||
draw = ImageDraw.Draw(img)
|
||||
draw.polygon(polyline, outline=1, fill=1)
|
||||
draw.polygon(polyline, outline=self.white, fill=self.white)
|
||||
|
||||
a = (np.where(np.asarray(img) == self.white, 1, 0) * np.where(self.as_2d_array == self.white, 1, 0)).sum()
|
||||
a = (np.where(np.asarray(img) == self.white, 1, 0) * np.where(self.as_2d_array == self.black, 1, 0)).sum()
|
||||
|
||||
if a:
|
||||
return False # Non-Homotoph
|
||||
return V.ALTERNATIVE # Non-Homotoph
|
||||
else:
|
||||
return True # Homotoph
|
||||
return V.HOMOTOPIC # Homotoph
|
||||
|
||||
def draw(self):
|
||||
fig, ax = plt.gcf(), plt.gca()
|
||||
|
||||
Reference in New Issue
Block a user