gradio_article / app.py
gathemin's picture
Create app.py
5252e66 verified
raw
history blame contribute delete
342 Bytes
from __future__ import annotations
import gradio as gr
import numpy as np
def image_classifier(input_image: np.ndarray) -> dict[str, float]:
"""Output a dummy probability for the image to be a dog or a cat."""
return {"cat": 0.3, "dog": 0.7}
demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label")
demo.launch()