Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import annotations
|
2 |
+
|
3 |
+
import gradio as gr
|
4 |
+
import numpy as np
|
5 |
+
|
6 |
+
|
7 |
+
def image_classifier(input_image: np.ndarray) -> dict[str, float]:
|
8 |
+
"""Output a dummy probability for the image to be a dog or a cat."""
|
9 |
+
return {"cat": 0.3, "dog": 0.7}
|
10 |
+
|
11 |
+
|
12 |
+
demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label")
|
13 |
+
demo.launch()
|