Spaces:
Runtime error
Runtime error
Commit
·
dc6ced8
1
Parent(s):
6b8e95b
omitted all error causing lines
Browse files
app.py
CHANGED
@@ -45,8 +45,8 @@ def read_image(Image):
|
|
45 |
plt.show()
|
46 |
return img
|
47 |
|
48 |
-
filename ="/content/to.jpeg"
|
49 |
-
Image= read_image(filename)
|
50 |
|
51 |
"""### Step 3:- Converting the Image to respective types
|
52 |
Making diffrent Function for each work
|
@@ -96,7 +96,7 @@ def Main_cartoon(Image,Line_size,Blur_value,Color_count):
|
|
96 |
# cartoon_img=cv2.cvtColor(cartoon_img, cv2.COLOR_RGB2BGR)
|
97 |
return cartoon_img
|
98 |
|
99 |
-
x=Main_cartoon(Image,7,7,10)
|
100 |
|
101 |
"""####3. Painting"""
|
102 |
|
@@ -105,7 +105,7 @@ def Painting(Image, Colour_count):
|
|
105 |
# Painting=cv2.cvtColor(Painting, cv2.COLOR_RGB2BGR)
|
106 |
return Painting
|
107 |
|
108 |
-
y=Painting(Image,10)
|
109 |
|
110 |
"""####2.Pencil Sketch"""
|
111 |
|
@@ -117,7 +117,7 @@ def Pencil_sketch(Image):
|
|
117 |
sketch_img=cv2.divide(grey_img,invblur_img, scale=256.0)
|
118 |
return sketch_img
|
119 |
|
120 |
-
z=Pencil_sketch(Image)
|
121 |
|
122 |
"""####1.Edge Sketch"""
|
123 |
|
@@ -126,25 +126,25 @@ def Edge_sketch(Image):
|
|
126 |
edge_img = cv2.cvtColor(edge_img,cv2.COLOR_BGR2RGB)
|
127 |
return edge_img
|
128 |
|
129 |
-
t=Edge_sketch(Image)
|
130 |
|
131 |
"""###Step 4:- Testing"""
|
132 |
|
133 |
-
plt.imshow(x)
|
134 |
-
plt.show()
|
135 |
-
cv2.imwrite("Final.jpg", x)
|
136 |
|
137 |
-
plt.imshow(y)
|
138 |
-
plt.show()
|
139 |
-
cv2.imwrite("final1.jpg",y)
|
140 |
|
141 |
-
plt.imshow(z)
|
142 |
-
plt.show()
|
143 |
-
cv2.imwrite("final2.jpg",z)
|
144 |
|
145 |
-
plt.imshow(t)
|
146 |
-
plt.show()
|
147 |
-
cv2.imwrite("final3.jpg",t)
|
148 |
|
149 |
"""### Step 5:- Gradio app and driver code
|
150 |
|
|
|
45 |
plt.show()
|
46 |
return img
|
47 |
|
48 |
+
#filename ="/content/to.jpeg"
|
49 |
+
#Image= read_image(filename)
|
50 |
|
51 |
"""### Step 3:- Converting the Image to respective types
|
52 |
Making diffrent Function for each work
|
|
|
96 |
# cartoon_img=cv2.cvtColor(cartoon_img, cv2.COLOR_RGB2BGR)
|
97 |
return cartoon_img
|
98 |
|
99 |
+
#x=Main_cartoon(Image,7,7,10)
|
100 |
|
101 |
"""####3. Painting"""
|
102 |
|
|
|
105 |
# Painting=cv2.cvtColor(Painting, cv2.COLOR_RGB2BGR)
|
106 |
return Painting
|
107 |
|
108 |
+
#y=Painting(Image,10)
|
109 |
|
110 |
"""####2.Pencil Sketch"""
|
111 |
|
|
|
117 |
sketch_img=cv2.divide(grey_img,invblur_img, scale=256.0)
|
118 |
return sketch_img
|
119 |
|
120 |
+
#z=Pencil_sketch(Image)
|
121 |
|
122 |
"""####1.Edge Sketch"""
|
123 |
|
|
|
126 |
edge_img = cv2.cvtColor(edge_img,cv2.COLOR_BGR2RGB)
|
127 |
return edge_img
|
128 |
|
129 |
+
#t=Edge_sketch(Image)
|
130 |
|
131 |
"""###Step 4:- Testing"""
|
132 |
|
133 |
+
#plt.imshow(x)
|
134 |
+
#plt.show()
|
135 |
+
#cv2.imwrite("Final.jpg", x)
|
136 |
|
137 |
+
#plt.imshow(y)
|
138 |
+
#plt.show()
|
139 |
+
#cv2.imwrite("final1.jpg",y)
|
140 |
|
141 |
+
#plt.imshow(z)
|
142 |
+
#plt.show()
|
143 |
+
#cv2.imwrite("final2.jpg",z)
|
144 |
|
145 |
+
#plt.imshow(t)
|
146 |
+
#plt.show()
|
147 |
+
#cv2.imwrite("final3.jpg",t)
|
148 |
|
149 |
"""### Step 5:- Gradio app and driver code
|
150 |
|