Spaces:
Sleeping
Sleeping
Update utils.py
Browse files
utils.py
CHANGED
@@ -27,9 +27,14 @@ class make_im():
|
|
27 |
if not os.path.isdir(f"{self.root}/image_alls/{ea}"):
|
28 |
os.mkdir(f'{self.root}/images_all/{ea}')
|
29 |
else: pass
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
def run_1(self,name='temp',img_size=[128,128],cmap='flag_r',key=0):
|
35 |
randvar = random.randint(2,10)
|
|
|
27 |
if not os.path.isdir(f"{self.root}/image_alls/{ea}"):
|
28 |
os.mkdir(f'{self.root}/images_all/{ea}')
|
29 |
else: pass
|
30 |
+
buffer = io.BytesIO()
|
31 |
+
buffer.write(self.pimg)
|
32 |
+
buffer.seek(0)
|
33 |
+
#matplotlib.image.imsave(f"{self.root}/images_all/{ea}/{ea}_mask.png", self.mask, cmap='gray')
|
34 |
+
#matplotlib.image.imsave(f"{self.root}/images_all/{ea}/{ea}_epwt.png", self.epwtimg)
|
35 |
+
#matplotlib.image.imsave(f"{self.root}/images_all/{ea}/{ea}_prob.png", self.pimg)
|
36 |
+
return buffer
|
37 |
+
|
38 |
|
39 |
def run_1(self,name='temp',img_size=[128,128],cmap='flag_r',key=0):
|
40 |
randvar = random.randint(2,10)
|