Practica3 / app.py
joortif's picture
Create app.py
5570c58 verified
raw
history blame
397 Bytes
from fastai.vision.all import unet_learner, resnet34, load_learner
learn = load_learner("unet_export.pkl")
def segment_image(img):
pred, _, _ = learn.predict(img)
return pred
# Crear interfaz Gradio
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()