deoldify / app.py
Ahsen Khaliq
Update app.py
05f9041
raw
history blame
No virus
395 Bytes
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=gr.inputs.Image(type="file"), outputs=gr.outputs.Image(type="file"))
iface.launch()