Ahsen Khaliq commited on
Commit
2543307
·
1 Parent(s): 5869b5b

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -0
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import gradio as gr
3
+
4
+ os.system("git clone https://github.com/AK391/PAMA.git")
5
+
6
+ os.chdir("PAMA")
7
+
8
+ os.system("gdown https://drive.google.com/uc?id=1rPB_qnelVVSad6CtadmhRFi0PMI_RKdy")
9
+ os.mkdir("checkpoints")
10
+
11
+ os.system("unzip -j original_PAMA.zip -d checkpoints/")
12
+
13
+ def inference(content,style):
14
+ os.system("python main.py eval --content "+content+" --style "+style)
15
+ return "ics.jpg"
16
+
17
+ title = "Anime2Sketch"
18
+ description = "demo for Anime2Sketch. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
19
+ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2104.05703'>Adversarial Open Domain Adaption for Sketch-to-Photo Synthesis</a> | <a href='https://github.com/Mukosame/Anime2Sketch'>Github Repo</a></p>"
20
+
21
+ gr.Interface(
22
+ inference,
23
+ gr.inputs.Image(type="filepath", label="Input"),
24
+ gr.outputs.Image(type="file", label="Output"),
25
+ title=title,
26
+ description=description,
27
+ article=article,
28
+ ).launch()