Spaces:
Runtime error
Runtime error
Alican Akca
commited on
Commit
•
43562ba
1
Parent(s):
1e4d453
issues...
Browse files- app.py +1 -1
- methods/img2pixl.py +2 -4
app.py
CHANGED
@@ -27,7 +27,7 @@ def func_tab1(image,pixel_size, checkbox1):
|
|
27 |
pixel_size),
|
28 |
background_image = image)
|
29 |
else:
|
30 |
-
images=
|
31 |
result = pixl.toThePixL(images, pixel_size)
|
32 |
return result
|
33 |
|
|
|
27 |
pixel_size),
|
28 |
background_image = image)
|
29 |
else:
|
30 |
+
images=[]
|
31 |
result = pixl.toThePixL(images, pixel_size)
|
32 |
return result
|
33 |
|
methods/img2pixl.py
CHANGED
@@ -7,7 +7,6 @@ class pixL:
|
|
7 |
def __init__(self,numOfSquaresW = None, numOfSquaresH= None, size = [False, (512,512)],square = 6,ImgH = None,ImgW = None,images = [],background_image = None):
|
8 |
self.images = images
|
9 |
self.size = size
|
10 |
-
self.background_image = background_image
|
11 |
self.ImgH = ImgH
|
12 |
self.ImgW = ImgW
|
13 |
self.square = square
|
@@ -26,8 +25,7 @@ class pixL:
|
|
26 |
else:
|
27 |
return self.images
|
28 |
|
29 |
-
def toThePixL(self,images, pixel_size
|
30 |
-
self.background_image = background_image
|
31 |
self.images = []
|
32 |
self.square = pixel_size
|
33 |
for image in images:
|
@@ -67,7 +65,7 @@ class pixL:
|
|
67 |
pt2=(pixValues[pen][1][0] + self.square,pixValues[pen][1][1] + self.square),
|
68 |
color=(pixValues[pen][0][2],pixValues[pen][0][1],pixValues[pen][0][0]),
|
69 |
thickness=-1)
|
70 |
-
background = np.array(
|
71 |
background = cv2.resize(background, (self.ImgW,self.ImgH), interpolation = cv2.INTER_AREA)
|
72 |
|
73 |
return background
|
|
|
7 |
def __init__(self,numOfSquaresW = None, numOfSquaresH= None, size = [False, (512,512)],square = 6,ImgH = None,ImgW = None,images = [],background_image = None):
|
8 |
self.images = images
|
9 |
self.size = size
|
|
|
10 |
self.ImgH = ImgH
|
11 |
self.ImgW = ImgW
|
12 |
self.square = square
|
|
|
25 |
else:
|
26 |
return self.images
|
27 |
|
28 |
+
def toThePixL(self,images, pixel_size):
|
|
|
29 |
self.images = []
|
30 |
self.square = pixel_size
|
31 |
for image in images:
|
|
|
65 |
pt2=(pixValues[pen][1][0] + self.square,pixValues[pen][1][1] + self.square),
|
66 |
color=(pixValues[pen][0][2],pixValues[pen][0][1],pixValues[pen][0][0]),
|
67 |
thickness=-1)
|
68 |
+
background = np.array(background).astype(np.uint8)
|
69 |
background = cv2.resize(background, (self.ImgW,self.ImgH), interpolation = cv2.INTER_AREA)
|
70 |
|
71 |
return background
|