Karin0616 commited on
Commit
6c3a687
1 Parent(s): 115e7ad
Files changed (3) hide show
  1. app.py +4 -4
  2. city4.jpg +0 -0
  3. city5.jpg +0 -0
app.py CHANGED
@@ -15,7 +15,7 @@ model = TFSegformerForSemanticSegmentation.from_pretrained(
15
  "nvidia/segformer-b5-finetuned-cityscapes-1024-1024"
16
  )
17
 
18
- def ade_palette():
19
 
20
  return [
21
  [204, 87, 92], # road (Reddish)
@@ -46,7 +46,7 @@ with open(r'labels.txt', 'r') as fp:
46
  for line in fp:
47
  labels_list.append(line[:-1])
48
 
49
- colormap = np.asarray(ade_palette())
50
 
51
  def label_to_color_image(label):
52
  if label.ndim != 2:
@@ -110,11 +110,11 @@ demo = gr.Interface(fn=sepia,
110
  inputs=gr.Image(shape=(564,846)),
111
  outputs=['plot'],
112
  live=True,
113
- examples=["city1.jpg","city2.jpg","city3.jpg"],
114
  allow_flagging='never',
115
  title="City Image Segmentation Model",
116
  theme="huggingfacedark",
117
- description="This model is a high-performance city image segmentation model based on the Segformer architecture provided by NVIDIA. Specifically, the 'segformer-b5' model, trained on the Cityscapes dataset, excels at performing intricate segmentation on high-resolution images of 1024x1024 pixels. It accurately identifies various urban elements such as roads, buildings, pedestrians, providing visually rich segmentation results.\nThis is a machine learning activity project at Kyunggi University.",
118
 
119
  )
120
 
 
15
  "nvidia/segformer-b5-finetuned-cityscapes-1024-1024"
16
  )
17
 
18
+ def palette():
19
 
20
  return [
21
  [204, 87, 92], # road (Reddish)
 
46
  for line in fp:
47
  labels_list.append(line[:-1])
48
 
49
+ colormap = np.asarray(palette())
50
 
51
  def label_to_color_image(label):
52
  if label.ndim != 2:
 
110
  inputs=gr.Image(shape=(564,846)),
111
  outputs=['plot'],
112
  live=True,
113
+ examples=["city1.jpg","city2.jpg","city3.jpg","city4.jpg","city5.jpg"],
114
  allow_flagging='never',
115
  title="City Image Segmentation Model",
116
  theme="huggingfacedark",
117
+ description="This model is a high-performance city image segmentation model based on the Segformer architecture provided by NVIDIA. Specifically, the 'segformer-b5' model, trained on the Cityscapes dataset, excels at performing intricate segmentation on high-resolution images of 1024x1024 pixels. It accurately identifies various urban elements such as roads, buildings, pedestrians, providing visually rich segmentation results.This is a machine learning activity project at Kyunggi University.",
118
 
119
  )
120
 
city4.jpg ADDED
city5.jpg ADDED