File size: 462 Bytes
cef3c44
 
6b82a67
1b59f08
cef3c44
1b59f08
 
cef3c44
6b82a67
cef3c44
 
1bd9c6a
 
cef3c44
 
 
 
 
 
 
6b82a67
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)