Sanket
commited on
Commit
•
b94f049
1
Parent(s):
05fa07b
error fix
Browse files
app.py
CHANGED
@@ -122,16 +122,24 @@ def predict(input_img, ver):
|
|
122 |
source = drawing.split()
|
123 |
|
124 |
R, G, B = 0, 1, 2
|
125 |
-
|
126 |
|
127 |
-
Red = source[R].point(
|
128 |
-
Green = source[G].point(
|
129 |
-
Blue = source[B].point(
|
130 |
|
131 |
im_output = Image.merge(im_output.mode, (Red, Green, Blue))
|
132 |
return im_output
|
133 |
|
134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
title = "Image to Line Drawings - Complex and Simple Portraits and Landscapes"
|
136 |
examples = [
|
137 |
["01.jpg", "Complex Lines"],
|
|
|
122 |
source = drawing.split()
|
123 |
|
124 |
R, G, B = 0, 1, 2
|
125 |
+
# constant by which each pixel is divided
|
126 |
|
127 |
+
Red = source[R].point(darken_pixel)
|
128 |
+
Green = source[G].point(darken_pixel)
|
129 |
+
Blue = source[B].point(darken_pixel)
|
130 |
|
131 |
im_output = Image.merge(im_output.mode, (Red, Green, Blue))
|
132 |
return im_output
|
133 |
|
134 |
|
135 |
+
def darken_pixel(pixel):
|
136 |
+
constant = 2.0
|
137 |
+
if pixel < 200:
|
138 |
+
return pixel / constant
|
139 |
+
else:
|
140 |
+
return pixel
|
141 |
+
|
142 |
+
|
143 |
title = "Image to Line Drawings - Complex and Simple Portraits and Landscapes"
|
144 |
examples = [
|
145 |
["01.jpg", "Complex Lines"],
|