| import gradio as gr | |
| from inference import predict_from_pil | |
| def infer(img): | |
| return predict_from_pil(img) | |
| demo = gr.Interface( | |
| fn=infer, | |
| inputs=gr.Image(type="pil", label="28x28 grayscale image (any image will be resized)"), | |
| outputs=gr.Label(num_top_classes=3, label="Top-3 predictions"), | |
| title="Tiny Digits (Toy Classifier)", | |
| description="Ultra-small CNN demo for deployment tests. Not trained; for pipeline sanity only." | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch() | |