Update app.py
Browse files
app.py
CHANGED
|
@@ -99,7 +99,7 @@ def predict(input_img, ver):
|
|
| 99 |
|
| 100 |
drawing = 0
|
| 101 |
with torch.no_grad():
|
| 102 |
-
if ver == '
|
| 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="
|
| 112 |
-
# article = "<p style='text-align: center'
|
| 113 |
-
examples=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
|
| 116 |
iface = gr.Interface(predict, [gr.inputs.Image(type='filepath'),
|
| 117 |
-
gr.inputs.Radio(['
|
| 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()
|