Karin0616 commited on
Commit
f5feee4
1 Parent(s): 6eb7add
Files changed (2) hide show
  1. app.py +20 -21
  2. labels.txt +18 -18
app.py CHANGED
@@ -17,25 +17,24 @@ model = TFSegformerForSemanticSegmentation.from_pretrained(
17
  def ade_palette():
18
  """ADE20K palette that maps each class to RGB values."""
19
  return [
20
- [204, 87, 92], # background (Reddish)
21
- [112, 185, 212], # hat (Blue)
22
- [196, 160, 122], # hair (Brown)
23
- [106, 135, 242], # sunglasses (Light Blue)
24
- [91, 192, 222], # upper-clothes (Turquoise)
25
- [255, 192, 203], # skirt (Pink)
26
- [176, 224, 230], # pants (Light Blue)
27
- [222, 49, 99], # dress (Red)
28
- [139, 69, 19], # belt (Brown)
29
- [255, 0, 0], # left-shoe (Red)
30
- [0, 0, 255], # right-shoe (Blue)
31
- [255, 228, 181], # face (Peach)
32
- [128, 0, 0], # left-leg (Maroon)
33
- [0, 128, 0], # right-leg (Green)
34
- [255, 99, 71], # left-arm (Tomato)
35
- [0, 255, 0], # right-arm (Lime)
36
- [128, 0, 128], # bag (Purple)
37
- [255, 255, 0] # scarf (Yellow)
38
-
39
  ]
40
 
41
  labels_list = []
@@ -102,10 +101,10 @@ def sepia(input_img):
102
  return fig
103
 
104
  demo = gr.Interface(fn=sepia,
105
- inputs=gr.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()
 
17
  def ade_palette():
18
  """ADE20K palette that maps each class to RGB values."""
19
  return [
20
+ [204, 87, 92],
21
+ [112, 185, 212],
22
+ [45, 189, 106],
23
+ [234, 123, 67],
24
+ [78, 56, 123],
25
+ [210, 32, 89],
26
+ [90, 180, 56],
27
+ [155, 102, 200],
28
+ [33, 147, 176],
29
+ [255, 183, 76],
30
+ [67, 123, 89],
31
+ [190, 60, 45],
32
+ [134, 112, 200],
33
+ [56, 45, 189],
34
+ [200, 56, 123],
35
+ [87, 92, 204],
36
+ [120, 56, 123],
37
+ [45, 78, 123]
 
38
  ]
39
 
40
  labels_list = []
 
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()
labels.txt CHANGED
@@ -1,18 +1,18 @@
1
- background
2
- hat
3
- hair
4
- sunglasses
5
- upper-clothes
6
- skirt
7
- pants
8
- dress
9
- belt
10
- left-shoe
11
- right-shoe
12
- face
13
- left-leg
14
- right-leg
15
- left-arm
16
- right-arm
17
- bag
18
- scarf
 
1
+ Background
2
+ Hat
3
+ Hair
4
+ Sunglasses
5
+ Upper-clothes
6
+ Skirt
7
+ Pants
8
+ Dress
9
+ Belt
10
+ Left-shoe
11
+ Right-shoe
12
+ Face
13
+ Left-leg
14
+ Right-leg
15
+ Left-arm
16
+ Right-arm
17
+ Bag
18
+ Scarf