danibalcells's picture
Clean up
1b59f08
raw
history blame
464 Bytes
from pathlib import Path
import gradio as gr
import fastai.vision.all as fv
from iirwi.iirwi import IIRWI
EXTRACTOR_NAME = Path('model/extractor.pt')
STORAGE_NAME = Path('model/storage.pkl')
iirwi = IIRWI.from_filenames(EXTRACTOR_NAME, STORAGE_NAME)
def predict(input_image):
img = fv.PILImage.create(input_image)
return iirwi.process(img)
iface = gr.Interface(
fn=predict,
inputs='image',
outputs='image',
)
iface.launch(debug=True)