File size: 399 Bytes
6efc86b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os
os.system("hub install deoldify==1.0.1")
import gradio as gr
import paddlehub as hub
from pathlib import Path


model = hub.Module(name='deoldify')

def inference(image):
    model.predict(image.name)
    return './output/DeOldify/'+Path(image.name).stem+".png"

iface = gr.Interface(inference, inputs=gradio.inputs.Image(type="file"), outputs=gr.outputs.Image(type="file"))
iface.launch()