from huggingface_hub import from_pretrained_fastai | |
import gradio as gr | |
from fastai.vision.all import * | |
repo_id = "joortif/Practica3" | |
learn = from_pretrained_fastai(repo_id) | |
def segment_image(img): | |
pred, _, _ = learn.predict(img) | |
return pred | |
interface = gr.Interface( | |
fn=segment_image, | |
inputs=gr.Image(type="pil"), | |
outputs=gr.Image(type="numpy"), | |
title="Segmentaci贸n Sem谩ntica con FastAI", | |
) | |
interface.launch() |