1+ from colr import color
2+
13from eggdriver .resources .structures .lists import List
24from eggdriver .resources .structures .matrices import listMatrix
35from eggdriver .resources .modules import installFromRequests
46from eggdriver .resources .console import sleep
57from eggdriver .resources .constants import limit , square , whiteSquare , blackSquare
68
79class Image (listMatrix ):
8- def __init__ (self , listOfLists = []):
9- installFromRequests (["numpy" , "tensorflow" , "keras" , "Pillow" , "Colr" ], False ) # Install
10+ def __init__ (self , listOfLists = [], auto_install = True ):
1011 super ().__init__ (listOfLists )
1112 self .bias = [0 , 0 , 0 ]
13+
14+ if auto_install :
15+ installFromRequests (["numpy" , "tensorflow" , "keras" , "Pillow" , "Colr" ], False ) # Install
16+
1217 def load (self , fileName ):
1318 from keras .preprocessing import image # Local import
1419 import numpy as np # Local import
@@ -31,7 +36,6 @@ def loadFromBW(self, vanillaMatrix):
3136 def loadFromRGB (self , vanillaMatrix ):
3237 [self .addLast (List (vanillaList )) for vanillaList in vanillaMatrix ]
3338 def printRGB (self ):
34- from colr import color # Local import
3539 b = self .bias
3640 for vanillaList in self .matrix :
3741 line = limit
@@ -57,4 +61,4 @@ def colour(self, list, id):
5761 return 0
5862 if result > 255 :
5963 return 255
60- return result
64+ return result
0 commit comments