Update app.py
Browse files
app.py
CHANGED
|
@@ -41,8 +41,8 @@ def inference(input_image):
|
|
| 41 |
# plot the semantic segmentation predictions of 21 classes in each color
|
| 42 |
r = Image.fromarray(output_predictions.byte().cpu().numpy()).resize(input_image.size)
|
| 43 |
r.putpalette(colors)
|
| 44 |
-
plt.
|
| 45 |
-
return
|
| 46 |
|
| 47 |
|
| 48 |
title = "FCN-RESNET101"
|
|
@@ -52,7 +52,7 @@ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/1605.062
|
|
| 52 |
gr.Interface(
|
| 53 |
inference,
|
| 54 |
gr.inputs.Image(type="pil", label="Input"),
|
| 55 |
-
gr.outputs.Image(type="
|
| 56 |
title=title,
|
| 57 |
description=description,
|
| 58 |
article=article,
|
|
|
|
| 41 |
# plot the semantic segmentation predictions of 21 classes in each color
|
| 42 |
r = Image.fromarray(output_predictions.byte().cpu().numpy()).resize(input_image.size)
|
| 43 |
r.putpalette(colors)
|
| 44 |
+
plt.savefig('out.png')
|
| 45 |
+
return 'out.png'
|
| 46 |
|
| 47 |
|
| 48 |
title = "FCN-RESNET101"
|
|
|
|
| 52 |
gr.Interface(
|
| 53 |
inference,
|
| 54 |
gr.inputs.Image(type="pil", label="Input"),
|
| 55 |
+
gr.outputs.Image(type="file", label="Output"),
|
| 56 |
title=title,
|
| 57 |
description=description,
|
| 58 |
article=article,
|