mugdha99 commited on
Commit
0fb9208
1 Parent(s): 1bc07c8

Update app.py

Browse files

add download button for output image

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -105,7 +105,7 @@ def predict(input_img, ver):
105
  drawing = model1(input_img)[0].detach()
106
 
107
  drawing = transforms.ToPILImage()(drawing)
108
- return drawing
109
 
110
  title="Image to Line Drawings - Complex and Simple Portraits and Landscapes"
111
  examples=[
@@ -122,6 +122,6 @@ examples=[
122
 
123
  iface = gr.Interface(predict, [gr.inputs.Image(type='filepath'),
124
  gr.inputs.Radio(['Complex Lines','Simple Lines'], type="value", default='Simple Lines', label='version')],
125
- gr.outputs.Image(type="pil"), title=title,examples=examples)
126
 
127
- iface.launch()
 
105
  drawing = model1(input_img)[0].detach()
106
 
107
  drawing = transforms.ToPILImage()(drawing)
108
+ return drawing, drawing
109
 
110
  title="Image to Line Drawings - Complex and Simple Portraits and Landscapes"
111
  examples=[
 
122
 
123
  iface = gr.Interface(predict, [gr.inputs.Image(type='filepath'),
124
  gr.inputs.Radio(['Complex Lines','Simple Lines'], type="value", default='Simple Lines', label='version')],
125
+ [gr.outputs.Image(type="pil"), gr.outputs.DataURI(label="Download Image")], title=title,examples=examples)
126
 
127
+ iface.launch()