edit detail
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ processor = AutoImageProcessor.from_pretrained(MODEL_ID)
|
|
| 11 |
model = AutoModelForSemanticSegmentation.from_pretrained(MODEL_ID)
|
| 12 |
|
| 13 |
|
| 14 |
-
def
|
| 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(
|
| 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 |
"""
|