Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,35 +20,10 @@ def predict_image(image):
|
|
20 |
prediction = classifier.predict(image)
|
21 |
return prediction[0]
|
22 |
|
23 |
-
with gr.Blocks() as demo:
|
24 |
-
txt = gr.Textbox(label = "Input", lines =2)
|
25 |
-
txt_2 = gr.Textbox(label = "Input 2")
|
26 |
-
txt_3 = gr.Textbox(value = "", label = "Output")
|
27 |
-
btn = gr.Button(value = "submit")
|
28 |
-
btn.click(combine, inputs = [txt, txt_2]), outputs = [txt_3]
|
29 |
-
|
30 |
-
with gr.Row():
|
31 |
-
im = gr.Image()
|
32 |
-
im_2 = gr.Image()
|
33 |
-
|
34 |
-
btn = gr.Button(value = "Mirror image")
|
35 |
-
btn.click(mirror, inputs = [im], outputs = [im_2])
|
36 |
-
|
37 |
-
gr.Markdown("## Image Examples")
|
38 |
-
gr.Examples(
|
39 |
-
examples=[os.path.join(os.path.dirname(__file__), "0.png")],
|
40 |
-
inputs=im,
|
41 |
-
outputs=im_2,
|
42 |
-
fn=mirror,
|
43 |
-
cache_examples=True,
|
44 |
-
)
|
45 |
-
|
46 |
-
|
47 |
imagenes_muestra =[
|
48 |
-
"knnExample/0.png"
|
49 |
-
"knnExample/5.png"
|
50 |
"knnExample/7.png"
|
51 |
-
|
52 |
]
|
53 |
iface = gr.Interface(
|
54 |
fn = predict_image,
|
|
|
20 |
prediction = classifier.predict(image)
|
21 |
return prediction[0]
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
imagenes_muestra =[
|
24 |
+
"knnExample/0.png",
|
25 |
+
"knnExample/5.png",
|
26 |
"knnExample/7.png"
|
|
|
27 |
]
|
28 |
iface = gr.Interface(
|
29 |
fn = predict_image,
|