akhaliq HF staff commited on
Commit
e8b1f46
1 Parent(s): 213b460

Update app.py

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