shyamgupta196 commited on
Commit
41a89a9
1 Parent(s): 725aae1
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  from transformers import AutoFeatureExtractor, SegformerForSemanticSegmentation
2
  from torch import nn
3
  import numpy as np
 
4
  from palette import ade_palette
5
 
6
  import gradio as gr
@@ -36,7 +37,8 @@ def seg(image):
36
  img = np.array(image) * 0.5 + color_seg * 0.5
37
  img = img.astype(np.uint8)
38
 
39
- return img
 
40
 
41
  iface = gr.Interface(fn=seg, inputs=gr.inputs.Image(type='pil'), outputs=gr.outputs.Image('numpy',True))
42
  iface.launch()
 
1
  from transformers import AutoFeatureExtractor, SegformerForSemanticSegmentation
2
  from torch import nn
3
  import numpy as np
4
+ import matplotlib.pyplot as plt
5
  from palette import ade_palette
6
 
7
  import gradio as gr
 
37
  img = np.array(image) * 0.5 + color_seg * 0.5
38
  img = img.astype(np.uint8)
39
 
40
+ return plt.imshow(img)
41
+
42
 
43
  iface = gr.Interface(fn=seg, inputs=gr.inputs.Image(type='pil'), outputs=gr.outputs.Image('numpy',True))
44
  iface.launch()