brianmg commited on
Commit
0809e55
1 Parent(s): 0405185
Files changed (4) hide show
  1. 22.jpg +0 -0
  2. 33.jpg +0 -0
  3. app.py +4 -3
  4. labels.txt +19 -18
22.jpg ADDED
33.jpg ADDED
app.py CHANGED
@@ -8,10 +8,10 @@ import tensorflow as tf
8
  from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
9
 
10
  feature_extractor = SegformerFeatureExtractor.from_pretrained(
11
- "mattmdjaga/segformer_b2_clothes"
12
  )
13
  model = TFSegformerForSemanticSegmentation.from_pretrained(
14
- "mattmdjaga/segformer_b2_clothes"
15
  )
16
 
17
  def ade_palette():
@@ -35,6 +35,7 @@ def ade_palette():
35
  [64, 64, 0], # Class 15
36
  [64, 0, 64], # Class 16
37
  [0, 64, 64], # Class 17
 
38
 
39
  ]
40
 
@@ -104,7 +105,7 @@ def sepia(input_img):
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
 
 
8
  from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
9
 
10
  feature_extractor = SegformerFeatureExtractor.from_pretrained(
11
+ "nvidia/segformer-b1-finetuned-cityscapes-1024-1024"
12
  )
13
  model = TFSegformerForSemanticSegmentation.from_pretrained(
14
+ "nvidia/segformer-b1-finetuned-cityscapes-1024-1024"
15
  )
16
 
17
  def ade_palette():
 
35
  [64, 64, 0], # Class 15
36
  [64, 0, 64], # Class 16
37
  [0, 64, 64], # Class 17
38
+ [64, 64, 64],
39
 
40
  ]
41
 
 
105
  demo = gr.Interface(fn=sepia,
106
  inputs=gr.Image(shape=(400, 600)),
107
  outputs=['plot'],
108
+ examples=["22.jpg", "33.jpg"],
109
  allow_flagging='never')
110
 
111
 
labels.txt CHANGED
@@ -1,18 +1,19 @@
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
+ road
2
+ sidewalk
3
+ building
4
+ wall
5
+ fence
6
+ pole
7
+ traffic light
8
+ traffic sign
9
+ vegetation
10
+ terrain
11
+ sky
12
+ person
13
+ rider
14
+ car
15
+ truck
16
+ bus
17
+ train
18
+ motorcycle
19
+ bicycle