awacke1 commited on
Commit
8797ea9
1 Parent(s): c7b68a4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -99,7 +99,7 @@ def predict(input_img, ver):
99
 
100
  drawing = 0
101
  with torch.no_grad():
102
- if ver == 'style 2':
103
  drawing = model2(input_img)[0].detach()
104
  else:
105
  drawing = model1(input_img)[0].detach()
@@ -108,13 +108,18 @@ def predict(input_img, ver):
108
  return drawing
109
 
110
  title="informative-drawings"
111
- description="Gradio Demo for line drawing generation. "
112
- # article = "<p style='text-align: center'><a href='TODO' target='_blank'>Project Page</a> | <a href='codelink' target='_blank'>Github</a></p>"
113
- examples=[['cat.png', 'style 1'], ['bridge.png', 'style 1'], ['lizard.png', 'style 2'],]
 
 
 
 
 
114
 
115
 
116
  iface = gr.Interface(predict, [gr.inputs.Image(type='filepath'),
117
- gr.inputs.Radio(['style 1','style 2'], type="value", default='style 1', label='version')],
118
  gr.outputs.Image(type="pil"), title=title,description=description,examples=examples)
119
 
120
  iface.launch()
 
99
 
100
  drawing = 0
101
  with torch.no_grad():
102
+ if ver == 'Simple Lines':
103
  drawing = model2(input_img)[0].detach()
104
  else:
105
  drawing = model1(input_img)[0].detach()
 
108
  return drawing
109
 
110
  title="informative-drawings"
111
+ description="Image to Line Drawing"
112
+ # article = "<p style='text-align: center'></p>"
113
+ examples=[
114
+ ['01.png', 'Simple Lines'], ['02.png', 'Simple Lines'], ['03.png', 'Simple Lines'],
115
+ ['04.png', 'Simple Lines'], ['05.png', 'Simple Lines'], ['06.png', 'Simple Lines'],
116
+ ['01.png', 'Complex Lines'], ['02.png', 'Complex Lines'], ['03.png', 'Complex Lines'],
117
+ ['04.png', 'Complex Lines'], ['05.png', 'Complex Lines'], ['06.png', 'Complex Lines']
118
+ ]
119
 
120
 
121
  iface = gr.Interface(predict, [gr.inputs.Image(type='filepath'),
122
+ gr.inputs.Radio(['Complex Lines','Simple Lines'], type="value", default='Simple Lines', label='version')],
123
  gr.outputs.Image(type="pil"), title=title,description=description,examples=examples)
124
 
125
  iface.launch()