jrossi6 commited on
Commit
e9bf955
·
1 Parent(s): 299f002

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
  import sys
4
  os.system("pip install gradio==2.4.6")
5
 
6
- os.system("git clone https://github.com/jrossi6/PAMA.git")
7
 
8
  os.chdir('PAMA')
9
  os.system("wget https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Hoover_Tower_Stanford_January_2013.jpg/800px-Hoover_Tower_Stanford_January_2013.jpg")
@@ -13,8 +13,8 @@ os.mkdir("checkpoints/")
13
 
14
  os.system("unzip -j original_PAMA.zip -d checkpoints/")
15
 
16
- def inference(content,style,alpha):
17
- os.system("python main.py eval --content "+content+" --style "+style+" --alpha " +str(alpha / 100.0))
18
  return "ics.jpg"
19
 
20
  title = "PAMA"
@@ -25,12 +25,11 @@ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2201.022
25
  examples=[['800px-Hoover_Tower_Stanford_January_2013.jpg','1920px-Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg']]
26
  gr.Interface(
27
  inference,
28
- [gr.inputs.Image(type="filepath", label="Content"),gr.inputs.Image(type="filepath", label="Style"),gr.inputs.Slider(0,100)],
29
  gr.outputs.Image(type="file", label="Output"),
30
  title=title,
31
  description=description,
32
  article=article,
33
  examples=examples,
34
- enable_queue=True,
35
- theme="darkdefault"
36
  ).launch()
 
3
  import sys
4
  os.system("pip install gradio==2.4.6")
5
 
6
+ os.system("git clone https://github.com/AK391/PAMA.git")
7
 
8
  os.chdir('PAMA')
9
  os.system("wget https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Hoover_Tower_Stanford_January_2013.jpg/800px-Hoover_Tower_Stanford_January_2013.jpg")
 
13
 
14
  os.system("unzip -j original_PAMA.zip -d checkpoints/")
15
 
16
+ def inference(content,style):
17
+ os.system("python main.py eval --content "+content+" --style "+style)
18
  return "ics.jpg"
19
 
20
  title = "PAMA"
 
25
  examples=[['800px-Hoover_Tower_Stanford_January_2013.jpg','1920px-Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg']]
26
  gr.Interface(
27
  inference,
28
+ [gr.inputs.Image(type="filepath", label="Content"),gr.inputs.Image(type="filepath", label="Style")],
29
  gr.outputs.Image(type="file", label="Output"),
30
  title=title,
31
  description=description,
32
  article=article,
33
  examples=examples,
34
+ enable_queue=True
 
35
  ).launch()