grdiv commited on
Commit
7800104
1 Parent(s): 81b00a4

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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
- plt.imshow(r)
42
- return plt
 
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="plot", label="Output"),
 
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,