Sanket
commited on
Commit
·
4e0eaa4
1
Parent(s):
a820e5d
improving algo
Browse files
app.py
CHANGED
@@ -122,11 +122,11 @@ def predict(input_img, ver):
|
|
122 |
source = drawing.split()
|
123 |
|
124 |
R, G, B = 0, 1, 2
|
125 |
-
constant = 2 # constant by which each pixel is divided
|
126 |
|
127 |
-
Red = source[R].point(lambda i: i <
|
128 |
-
Green = source[G].point(lambda i: i <
|
129 |
-
Blue = source[B].point(lambda i: i <
|
130 |
|
131 |
im_output = Image.merge(drawing.mode, (Red, Green, Blue))
|
132 |
return im_output
|
|
|
122 |
source = drawing.split()
|
123 |
|
124 |
R, G, B = 0, 1, 2
|
125 |
+
constant = 2.0 # constant by which each pixel is divided
|
126 |
|
127 |
+
Red = source[R].point(lambda i: i < 200 & i / constant)
|
128 |
+
Green = source[G].point(lambda i: i < 200 & i / constant)
|
129 |
+
Blue = source[B].point(lambda i: i < 200 & i / constant)
|
130 |
|
131 |
im_output = Image.merge(drawing.mode, (Red, Green, Blue))
|
132 |
return im_output
|