Spaces:
Sleeping
Sleeping
experiment
Browse files
app.py
CHANGED
|
@@ -1,7 +1,17 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
iface = gr.Interface(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import numpy as np
|
| 3 |
|
| 4 |
+
def on_submit(img):
|
| 5 |
+
img = img['composite']
|
| 6 |
+
print(img.shape)
|
| 7 |
+
print(img.dtype)
|
| 8 |
+
print(img[:3, :3])
|
| 9 |
+
return f"Sum: {np.sum(img)}"
|
| 10 |
|
| 11 |
+
iface = gr.Interface(
|
| 12 |
+
title = "LeNet",
|
| 13 |
+
fn = on_submit,
|
| 14 |
+
inputs=gr.Sketchpad(image_mode='P'),
|
| 15 |
+
outputs=gr.Label(),
|
| 16 |
+
)
|
| 17 |
iface.launch()
|