Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
@@ -27,12 +27,12 @@ class make_im():
|
|
27 |
cmap = ea
|
28 |
self.epwtimg = ColoredPath(self.epwtpath, self.mask.shape).get_colored_path(cmap)
|
29 |
self.pimg = ColoredPath(self.ppath, self.mask.shape).get_colored_path(cmap)
|
30 |
-
if not os.path.isdir(f"./
|
31 |
-
os.mkdir(f'./
|
32 |
else: pass
|
33 |
-
matplotlib.image.imsave(f"./
|
34 |
-
matplotlib.image.imsave(f"./
|
35 |
-
matplotlib.image.imsave(f"./
|
36 |
|
37 |
def run_1(self,img_size=[128,128],cmap='flag_r',key=0):
|
38 |
randvar = random.randint(2,10)
|
@@ -40,14 +40,14 @@ class make_im():
|
|
40 |
self.epwtpath = EPWTPath(self.mask).get_path()
|
41 |
sel.ppath = ProbabilisticPath(self.mask).get_path()
|
42 |
|
43 |
-
if not os.path.isdir(f"./
|
44 |
-
os.mkdir(f'./
|
45 |
self.epwtimg = ColoredPath(self.epwtpath, self.mask.shape).get_colored_path(cmap)
|
46 |
self.pimg = ColoredPath(self.ppath, self.mask.shape).get_colored_path(cmap)
|
47 |
|
48 |
-
matplotlib.image.imsave(f"./
|
49 |
-
matplotlib.image.imsave(f"./
|
50 |
-
matplotlib.image.imsave(f"./
|
51 |
return self.pimg
|
52 |
#img = get_random_image(img_size) #returns numpy array
|
53 |
#print(img)
|
|
|
27 |
cmap = ea
|
28 |
self.epwtimg = ColoredPath(self.epwtpath, self.mask.shape).get_colored_path(cmap)
|
29 |
self.pimg = ColoredPath(self.ppath, self.mask.shape).get_colored_path(cmap)
|
30 |
+
if not os.path.isdir(f"./image_alls/{ea}"):
|
31 |
+
os.mkdir(f'./images_all/{ea}')
|
32 |
else: pass
|
33 |
+
matplotlib.image.imsave(f"./images_all/{ea}/{ea}_mask.png", self.mask, cmap='gray')
|
34 |
+
matplotlib.image.imsave(f"./images_all/{ea}/{ea}_epwt.png", self.epwtimg)
|
35 |
+
matplotlib.image.imsave(f"./images_all/{ea}/{ea}_prob.png", self.pimg)
|
36 |
|
37 |
def run_1(self,img_size=[128,128],cmap='flag_r',key=0):
|
38 |
randvar = random.randint(2,10)
|
|
|
40 |
self.epwtpath = EPWTPath(self.mask).get_path()
|
41 |
sel.ppath = ProbabilisticPath(self.mask).get_path()
|
42 |
|
43 |
+
if not os.path.isdir(f"./images"):
|
44 |
+
os.mkdir(f'./images')
|
45 |
self.epwtimg = ColoredPath(self.epwtpath, self.mask.shape).get_colored_path(cmap)
|
46 |
self.pimg = ColoredPath(self.ppath, self.mask.shape).get_colored_path(cmap)
|
47 |
|
48 |
+
matplotlib.image.imsave(f"./images/{key}_mask.png", self.mask, cmap='gray')
|
49 |
+
matplotlib.image.imsave(f"./images/{key}_epwt.png", self.epwtimg)
|
50 |
+
matplotlib.image.imsave(f"./images/{key}_prob.png", self.pimg)
|
51 |
return self.pimg
|
52 |
#img = get_random_image(img_size) #returns numpy array
|
53 |
#print(img)
|