Spaces:
Running
Running
Nikhil Mudhalwadkar
commited on
Commit
·
aea7215
1
Parent(s):
239501f
update gradio
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
# Hack for spaces
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
|
6 |
# Real code begins
|
7 |
|
@@ -157,12 +157,12 @@ with gr.Blocks() as demo:
|
|
157 |
type="pil",
|
158 |
)
|
159 |
colour_1 = gr.Button("Colour it!")
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
with gr.TabItem("tr_64_val_14"):
|
167 |
with gr.Row():
|
168 |
image_input2 = gr.inputs.Image(type="pil")
|
@@ -170,13 +170,13 @@ with gr.Blocks() as demo:
|
|
170 |
type="pil",
|
171 |
)
|
172 |
colour_2 = gr.Button("Colour it!")
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
|
181 |
colour_1.click(
|
182 |
fn=predict1,
|
|
|
1 |
# Hack for spaces
|
2 |
+
import os
|
3 |
+
os.system("pip uninstall -y gradio")
|
4 |
+
os.system("pip install -r requirements.txt")
|
5 |
|
6 |
# Real code begins
|
7 |
|
|
|
157 |
type="pil",
|
158 |
)
|
159 |
colour_1 = gr.Button("Colour it!")
|
160 |
+
gr.Examples(
|
161 |
+
examples=img_examples,
|
162 |
+
inputs=image_input1,
|
163 |
+
outputs=image_output1,
|
164 |
+
fn=predict1,
|
165 |
+
)
|
166 |
with gr.TabItem("tr_64_val_14"):
|
167 |
with gr.Row():
|
168 |
image_input2 = gr.inputs.Image(type="pil")
|
|
|
170 |
type="pil",
|
171 |
)
|
172 |
colour_2 = gr.Button("Colour it!")
|
173 |
+
with gr.Row():
|
174 |
+
gr.Examples(
|
175 |
+
examples=img_examples,
|
176 |
+
inputs=image_input2,
|
177 |
+
outputs=image_output2,
|
178 |
+
fn=predict2,
|
179 |
+
)
|
180 |
|
181 |
colour_1.click(
|
182 |
fn=predict1,
|