Daoneeee commited on
Commit
906ab4f
·
1 Parent(s): 1e59032

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -5,7 +5,6 @@ import matplotlib.pyplot as plt
5
  import numpy as np
6
  from PIL import Image
7
  import tensorflow as tf
8
- tf.config.run_functions_eagerly(True)
9
  from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
10
 
11
  feature_extractor = SegformerFeatureExtractor.from_pretrained(
@@ -29,11 +28,11 @@ def ade_palette():
29
  [66, 39, 0],
30
  [240, 100, 39],
31
  [256, 236, 197],
32
- [242, 100, 60],
33
- [116, 116, 116],
34
- [99, 58, 0],
35
- [245, 100, 26],
36
- [66, 56, 0],
37
  [51, 51, 51],
38
  [206, 114, 61],
39
  ]
@@ -102,10 +101,10 @@ def sepia(input_img):
102
  return fig
103
 
104
  demo = gr.Interface(fn=sepia,
105
- inputs = gr.Image(type='pil', source='upload', label='Input Image', shape=(400, 600))
106
  outputs=['plot'],
107
  examples=["person-1.jpg", "person-2.jpg", "person-3.jpg", "person-4.jpg", "person-5.jpg"],
108
  allow_flagging='never')
109
 
110
 
111
- demo.launch()
 
5
  import numpy as np
6
  from PIL import Image
7
  import tensorflow as tf
 
8
  from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
9
 
10
  feature_extractor = SegformerFeatureExtractor.from_pretrained(
 
28
  [66, 39, 0],
29
  [240, 100, 39],
30
  [256, 236, 197],
31
+ [256, 236, 197],
32
+ [256, 236, 197],
33
+ [256, 236, 197],
34
+ [256, 236, 197],
35
+ [256, 236, 197],
36
  [51, 51, 51],
37
  [206, 114, 61],
38
  ]
 
101
  return fig
102
 
103
  demo = gr.Interface(fn=sepia,
104
+ inputs=gr.Image(shape=(400, 600)),
105
  outputs=['plot'],
106
  examples=["person-1.jpg", "person-2.jpg", "person-3.jpg", "person-4.jpg", "person-5.jpg"],
107
  allow_flagging='never')
108
 
109
 
110
+ demo.launch()