broadfield commited on
Commit
bdd5682
·
verified ·
1 Parent(s): 76fb478

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +10 -10
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"./images/{ea}"):
31
- os.mkdir(f'./images/{ea}')
32
  else: pass
33
- matplotlib.image.imsave(f"./images/{ea}/{ea}_mask.png", self.mask, cmap='gray')
34
- matplotlib.image.imsave(f"./images/{ea}/{ea}_epwt.png", self.epwtimg)
35
- matplotlib.image.imsave(f"./images/{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,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"./user"):
44
- os.mkdir(f'./user')
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"./user/{key}_mask.png", self.mask, cmap='gray')
49
- matplotlib.image.imsave(f"./user/{key}_epwt.png", self.epwtimg)
50
- matplotlib.image.imsave(f"./user/{key}_prob.png", self.pimg)
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)