File size: 373 Bytes
5570c58 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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
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() |