Andreas-w's picture
Update app.py
231e570
import numpy as np
import gradio as gr
#import torch as torch
#import torchvision
#from . import metode
#import metode
from metode import load_model
def funksjon(input_img):
#Må inporterer modellen fra API på huggingface.co
#imgPred = model.fit(input_img)
model = load_model('stage-1.pth')
#model = torch.load('stage-1.pth')
predictions = model.predict(input_img)
#imgPred = input_img
pil_image = Image.fromarray(predictions)
# Return the image
return pil_image
demo = gr.Interface(funksjon, gr.Image(), "image")
#demo.launch(share=True)
demo.launch()