ockkjs commited on
Commit
487ebdb
ยท
1 Parent(s): 7eac13f

edit detail

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -11,7 +11,7 @@ processor = AutoImageProcessor.from_pretrained(MODEL_ID)
11
  model = AutoModelForSemanticSegmentation.from_pretrained(MODEL_ID)
12
 
13
 
14
- def ade_palette():
15
  return [
16
  [128, 64, 128], [244, 35, 232], [70, 70, 70], [102, 102, 156], [190, 153, 153],
17
  [153, 153, 153], [250, 170, 30], [220, 220, 0], [107, 142, 35], [152, 251, 152],
@@ -25,7 +25,7 @@ with open("labels.txt", "r", encoding="utf-8") as fp:
25
  for line in fp:
26
  labels_list.append(line.rstrip("\n"))
27
 
28
- colormap = np.asarray(ade_palette(), dtype=np.uint8)
29
 
30
 
31
  def label_to_color_image(label):
@@ -85,7 +85,6 @@ def run_inference(input_img):
85
  return fig
86
 
87
 
88
- # ===== ๊ฐœ์„ ๋œ ์ธํ„ฐํŽ˜์ด์Šค (Blocks ์‚ฌ์šฉ) =====
89
  with gr.Blocks(theme=gr.themes.Soft(), title="๋„์‹œ ์žฅ๋ฉด ๋ถ„ํ• ") as demo:
90
  gr.Markdown(
91
  """
 
11
  model = AutoModelForSemanticSegmentation.from_pretrained(MODEL_ID)
12
 
13
 
14
+ def city_palette():
15
  return [
16
  [128, 64, 128], [244, 35, 232], [70, 70, 70], [102, 102, 156], [190, 153, 153],
17
  [153, 153, 153], [250, 170, 30], [220, 220, 0], [107, 142, 35], [152, 251, 152],
 
25
  for line in fp:
26
  labels_list.append(line.rstrip("\n"))
27
 
28
+ colormap = np.asarray(city_palette(), dtype=np.uint8)
29
 
30
 
31
  def label_to_color_image(label):
 
85
  return fig
86
 
87
 
 
88
  with gr.Blocks(theme=gr.themes.Soft(), title="๋„์‹œ ์žฅ๋ฉด ๋ถ„ํ• ") as demo:
89
  gr.Markdown(
90
  """