Spaces:
Runtime error
Runtime error
| from fastai.vision.all import * | |
| import gradio as gr | |
| categories = ('woman','trans') | |
| learn = load_learner('export.pkl') | |
| def is_woman(x): | |
| woman, idx, probs = learn.predict(x) | |
| return dict(zip(categories, map(float, probs))) | |
| image = gr.components.Image() | |
| label = gr.components.Label() | |
| iface = gr.Interface(fn=is_woman, inputs=image, outputs=label) | |
| iface.launch(inline=False) |