Ahsen Khaliq commited on
Commit
6efc86b
1 Parent(s): ec2f881

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ os.system("hub install deoldify==1.0.1")
3
+ import gradio as gr
4
+ import paddlehub as hub
5
+ from pathlib import Path
6
+
7
+
8
+ model = hub.Module(name='deoldify')
9
+
10
+ def inference(image):
11
+ model.predict(image.name)
12
+ return './output/DeOldify/'+Path(image.name).stem+".png"
13
+
14
+ iface = gr.Interface(inference, inputs=gradio.inputs.Image(type="file"), outputs=gr.outputs.Image(type="file"))
15
+ iface.launch()