Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
CHANGED
@@ -38,8 +38,9 @@ def inference(input_image):
|
|
38 |
# plot the semantic segmentation predictions of 21 classes in each color
|
39 |
r = Image.fromarray(output_predictions.byte().cpu().numpy()).resize(input_image.size)
|
40 |
r.putpalette(colors)
|
41 |
-
|
42 |
-
|
|
|
43 |
|
44 |
title = "DEEPLABV3-RESNET101"
|
45 |
description = "demo for DEEPLABV3-RESNET101, DeepLabV3 model with a ResNet-101 backbone. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
|
@@ -48,7 +49,8 @@ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/1706.055
|
|
48 |
gr.Interface(
|
49 |
inference,
|
50 |
gr.inputs.Image(type="pil", label="Input"),
|
51 |
-
gr.outputs.Image(type="
|
|
|
52 |
title=title,
|
53 |
description=description,
|
54 |
article=article,
|
|
|
38 |
# plot the semantic segmentation predictions of 21 classes in each color
|
39 |
r = Image.fromarray(output_predictions.byte().cpu().numpy()).resize(input_image.size)
|
40 |
r.putpalette(colors)
|
41 |
+
return r
|
42 |
+
# plt.imshow(r)
|
43 |
+
# return plt
|
44 |
|
45 |
title = "DEEPLABV3-RESNET101"
|
46 |
description = "demo for DEEPLABV3-RESNET101, DeepLabV3 model with a ResNet-101 backbone. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
|
|
|
49 |
gr.Interface(
|
50 |
inference,
|
51 |
gr.inputs.Image(type="pil", label="Input"),
|
52 |
+
gr.outputs.Image(type="pil", label="Output"),
|
53 |
+
# gr.outputs.Image(type="plot", label="Output"),
|
54 |
title=title,
|
55 |
description=description,
|
56 |
article=article,
|