Spaces:
Sleeping
Sleeping
Commit
·
ae1b4f7
1
Parent(s):
dbdf3a2
first commit
Browse files- README.md +3 -77
- app.py +242 -0
- config.json +0 -372
- labels.txt +19 -0
- preprocessor_config.json +0 -18
- pytorch_model.bin +0 -3
- requirements.txt +6 -0
- tf_model.h5 +0 -3
- /354/212/244/355/201/254/353/246/260/354/203/267(247).png +0 -0
README.md
CHANGED
|
@@ -1,86 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
tags:
|
| 4 |
-
- vision
|
| 5 |
-
- image-segmentation
|
| 6 |
-
datasets:
|
| 7 |
-
- scene_parse_150
|
| 8 |
-
widget:
|
| 9 |
-
- src: https://huggingface.co/datasets/hf-internal-testing/fixtures_ade20k/resolve/main/ADE_val_00000001.jpg
|
| 10 |
-
example_title: House
|
| 11 |
-
- src: https://huggingface.co/datasets/hf-internal-testing/fixtures_ade20k/resolve/main/ADE_val_00000002.jpg
|
| 12 |
-
example_title: Castle
|
| 13 |
-
title: My_model
|
| 14 |
emoji: 👀
|
| 15 |
colorFrom: red
|
| 16 |
colorTo: blue
|
| 17 |
sdk: gradio
|
| 18 |
sdk_version: 3.44.4
|
| 19 |
-
app_file:
|
| 20 |
pinned: false
|
| 21 |
-
|
| 22 |
---
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
SegFormer model fine-tuned on ADE20k at resolution 512x512. It was introduced in the paper [SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers](https://arxiv.org/abs/2105.15203) by Xie et al. and first released in [this repository](https://github.com/NVlabs/SegFormer).
|
| 27 |
-
|
| 28 |
-
Disclaimer: The team releasing SegFormer did not write a model card for this model so this model card has been written by the Hugging Face team.
|
| 29 |
-
|
| 30 |
-
## Model description
|
| 31 |
-
|
| 32 |
-
SegFormer consists of a hierarchical Transformer encoder and a lightweight all-MLP decode head to achieve great results on semantic segmentation benchmarks such as ADE20K and Cityscapes. The hierarchical Transformer is first pre-trained on ImageNet-1k, after which a decode head is added and fine-tuned altogether on a downstream dataset.
|
| 33 |
-
|
| 34 |
-
## Intended uses & limitations
|
| 35 |
-
|
| 36 |
-
You can use the raw model for semantic segmentation. See the [model hub](https://huggingface.co/models?other=segformer) to look for fine-tuned versions on a task that interests you.
|
| 37 |
-
|
| 38 |
-
### How to use
|
| 39 |
-
|
| 40 |
-
Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
|
| 41 |
-
|
| 42 |
-
```python
|
| 43 |
-
from transformers import SegformerImageProcessor, SegformerForSemanticSegmentation
|
| 44 |
-
from PIL import Image
|
| 45 |
-
import requests
|
| 46 |
-
|
| 47 |
-
processor = SegformerImageProcessor.from_pretrained("nvidia/segformer-b0-finetuned-ade-512-512")
|
| 48 |
-
model = SegformerForSemanticSegmentation.from_pretrained("nvidia/segformer-b0-finetuned-ade-512-512")
|
| 49 |
-
|
| 50 |
-
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
| 51 |
-
image = Image.open(requests.get(url, stream=True).raw)
|
| 52 |
-
|
| 53 |
-
inputs = feature_extractor(images=image, return_tensors="pt")
|
| 54 |
-
outputs = model(**inputs)
|
| 55 |
-
logits = outputs.logits # shape (batch_size, num_labels, height/4, width/4)
|
| 56 |
-
```
|
| 57 |
-
|
| 58 |
-
For more code examples, we refer to the [documentation](https://huggingface.co/transformers/model_doc/segformer.html#).
|
| 59 |
-
|
| 60 |
-
### License
|
| 61 |
-
|
| 62 |
-
The license for this model can be found [here](https://github.com/NVlabs/SegFormer/blob/master/LICENSE).
|
| 63 |
-
|
| 64 |
-
### BibTeX entry and citation info
|
| 65 |
-
|
| 66 |
-
```bibtex
|
| 67 |
-
@article{DBLP:journals/corr/abs-2105-15203,
|
| 68 |
-
author = {Enze Xie and
|
| 69 |
-
Wenhai Wang and
|
| 70 |
-
Zhiding Yu and
|
| 71 |
-
Anima Anandkumar and
|
| 72 |
-
Jose M. Alvarez and
|
| 73 |
-
Ping Luo},
|
| 74 |
-
title = {SegFormer: Simple and Efficient Design for Semantic Segmentation with
|
| 75 |
-
Transformers},
|
| 76 |
-
journal = {CoRR},
|
| 77 |
-
volume = {abs/2105.15203},
|
| 78 |
-
year = {2021},
|
| 79 |
-
url = {https://arxiv.org/abs/2105.15203},
|
| 80 |
-
eprinttype = {arXiv},
|
| 81 |
-
eprint = {2105.15203},
|
| 82 |
-
timestamp = {Wed, 02 Jun 2021 11:46:42 +0200},
|
| 83 |
-
biburl = {https://dblp.org/rec/journals/corr/abs-2105-15203.bib},
|
| 84 |
-
bibsource = {dblp computer science bibliography, https://dblp.org}
|
| 85 |
-
}
|
| 86 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Segmentation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
emoji: 👀
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 3.44.4
|
| 8 |
+
app_file: app.py
|
| 9 |
pinned: false
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
from matplotlib import gridspec
|
| 4 |
+
import matplotlib.pyplot as plt
|
| 5 |
+
import numpy as np
|
| 6 |
+
from PIL import Image
|
| 7 |
+
import tensorflow as tf
|
| 8 |
+
from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
|
| 9 |
+
|
| 10 |
+
feature_extractor = SegformerFeatureExtractor.from_pretrained(
|
| 11 |
+
"nvidia/segformer-b3-finetuned-cityscapes-1024-1024"
|
| 12 |
+
)
|
| 13 |
+
model = TFSegformerForSemanticSegmentation.from_pretrained(
|
| 14 |
+
"nvidia/segformer-b3-finetuned-cityscapes-1024-1024"
|
| 15 |
+
)
|
| 16 |
+
|
| 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 |
+
[156, 200, 56],
|
| 39 |
+
[32, 90, 210],
|
| 40 |
+
[56, 123, 67],
|
| 41 |
+
[180, 56, 123],
|
| 42 |
+
[123, 67, 45],
|
| 43 |
+
[45, 134, 200],
|
| 44 |
+
[67, 56, 123],
|
| 45 |
+
[78, 123, 67],
|
| 46 |
+
[32, 210, 90],
|
| 47 |
+
[45, 56, 189],
|
| 48 |
+
[123, 56, 123],
|
| 49 |
+
[56, 156, 200],
|
| 50 |
+
[189, 56, 45],
|
| 51 |
+
[112, 200, 56],
|
| 52 |
+
[56, 123, 45],
|
| 53 |
+
[200, 32, 90],
|
| 54 |
+
[123, 45, 78],
|
| 55 |
+
[200, 156, 56],
|
| 56 |
+
[45, 67, 123],
|
| 57 |
+
[56, 45, 78],
|
| 58 |
+
[45, 56, 123],
|
| 59 |
+
[123, 67, 56],
|
| 60 |
+
[56, 78, 123],
|
| 61 |
+
[210, 90, 32],
|
| 62 |
+
[123, 56, 189],
|
| 63 |
+
[45, 200, 134],
|
| 64 |
+
[67, 123, 56],
|
| 65 |
+
[123, 45, 67],
|
| 66 |
+
[90, 32, 210],
|
| 67 |
+
[200, 45, 78],
|
| 68 |
+
[32, 210, 90],
|
| 69 |
+
[45, 123, 67],
|
| 70 |
+
[165, 42, 87],
|
| 71 |
+
[72, 145, 167],
|
| 72 |
+
[15, 158, 75],
|
| 73 |
+
[209, 89, 40],
|
| 74 |
+
[32, 21, 121],
|
| 75 |
+
[184, 20, 100],
|
| 76 |
+
[56, 135, 15],
|
| 77 |
+
[128, 92, 176],
|
| 78 |
+
[1, 119, 140],
|
| 79 |
+
[220, 151, 43],
|
| 80 |
+
[41, 97, 72],
|
| 81 |
+
[148, 38, 27],
|
| 82 |
+
[107, 86, 176],
|
| 83 |
+
[21, 26, 136],
|
| 84 |
+
[174, 27, 90],
|
| 85 |
+
[91, 96, 204],
|
| 86 |
+
[108, 50, 107],
|
| 87 |
+
[27, 45, 136],
|
| 88 |
+
[168, 200, 52],
|
| 89 |
+
[7, 102, 27],
|
| 90 |
+
[42, 93, 56],
|
| 91 |
+
[140, 52, 112],
|
| 92 |
+
[92, 107, 168],
|
| 93 |
+
[17, 118, 176],
|
| 94 |
+
[59, 50, 174],
|
| 95 |
+
[206, 40, 143],
|
| 96 |
+
[44, 19, 142],
|
| 97 |
+
[23, 168, 75],
|
| 98 |
+
[54, 57, 189],
|
| 99 |
+
[144, 21, 15],
|
| 100 |
+
[15, 176, 35],
|
| 101 |
+
[107, 19, 79],
|
| 102 |
+
[204, 52, 114],
|
| 103 |
+
[48, 173, 83],
|
| 104 |
+
[11, 120, 53],
|
| 105 |
+
[206, 104, 28],
|
| 106 |
+
[20, 31, 153],
|
| 107 |
+
[27, 21, 93],
|
| 108 |
+
[11, 206, 138],
|
| 109 |
+
[112, 30, 83],
|
| 110 |
+
[68, 91, 152],
|
| 111 |
+
[153, 13, 43],
|
| 112 |
+
[25, 114, 54],
|
| 113 |
+
[92, 27, 150],
|
| 114 |
+
[108, 42, 59],
|
| 115 |
+
[194, 77, 5],
|
| 116 |
+
[145, 48, 83],
|
| 117 |
+
[7, 113, 19],
|
| 118 |
+
[25, 92, 113],
|
| 119 |
+
[60, 168, 79],
|
| 120 |
+
[78, 33, 120],
|
| 121 |
+
[89, 176, 205],
|
| 122 |
+
[27, 200, 94],
|
| 123 |
+
[210, 67, 23],
|
| 124 |
+
[123, 89, 189],
|
| 125 |
+
[225, 56, 112],
|
| 126 |
+
[75, 156, 45],
|
| 127 |
+
[172, 104, 200],
|
| 128 |
+
[15, 170, 197],
|
| 129 |
+
[240, 133, 65],
|
| 130 |
+
[89, 156, 112],
|
| 131 |
+
[214, 88, 57],
|
| 132 |
+
[156, 134, 200],
|
| 133 |
+
[78, 57, 189],
|
| 134 |
+
[200, 78, 123],
|
| 135 |
+
[106, 120, 210],
|
| 136 |
+
[145, 56, 112],
|
| 137 |
+
[89, 120, 189],
|
| 138 |
+
[185, 206, 56],
|
| 139 |
+
[47, 99, 28],
|
| 140 |
+
[112, 189, 78],
|
| 141 |
+
[200, 112, 89],
|
| 142 |
+
[89, 145, 112],
|
| 143 |
+
[78, 106, 189],
|
| 144 |
+
[112, 78, 189],
|
| 145 |
+
[156, 112, 78],
|
| 146 |
+
[28, 210, 99],
|
| 147 |
+
[78, 89, 189],
|
| 148 |
+
[189, 78, 57],
|
| 149 |
+
[112, 200, 78],
|
| 150 |
+
[189, 47, 78],
|
| 151 |
+
[205, 112, 57],
|
| 152 |
+
[78, 145, 57],
|
| 153 |
+
[200, 78, 112],
|
| 154 |
+
[99, 89, 145],
|
| 155 |
+
[200, 156, 78],
|
| 156 |
+
[57, 78, 145],
|
| 157 |
+
[78, 57, 99],
|
| 158 |
+
[57, 78, 145],
|
| 159 |
+
[145, 112, 78],
|
| 160 |
+
[78, 89, 145],
|
| 161 |
+
[210, 99, 28],
|
| 162 |
+
[145, 78, 189],
|
| 163 |
+
[57, 200, 136],
|
| 164 |
+
[89, 156, 78],
|
| 165 |
+
[145, 78, 99],
|
| 166 |
+
[99, 28, 210],
|
| 167 |
+
[189, 78, 47],
|
| 168 |
+
[28, 210, 99],
|
| 169 |
+
[78, 145, 57],
|
| 170 |
+
]
|
| 171 |
+
|
| 172 |
+
labels_list = []
|
| 173 |
+
|
| 174 |
+
with open(r'labels.txt', 'r') as fp:
|
| 175 |
+
for line in fp:
|
| 176 |
+
labels_list.append(line[:-1])
|
| 177 |
+
|
| 178 |
+
colormap = np.asarray(ade_palette())
|
| 179 |
+
|
| 180 |
+
def label_to_color_image(label):
|
| 181 |
+
if label.ndim != 2:
|
| 182 |
+
raise ValueError("Expect 2-D input label")
|
| 183 |
+
|
| 184 |
+
if np.max(label) >= len(colormap):
|
| 185 |
+
raise ValueError("label value too large.")
|
| 186 |
+
return colormap[label]
|
| 187 |
+
|
| 188 |
+
def draw_plot(pred_img, seg):
|
| 189 |
+
fig = plt.figure(figsize=(20, 15))
|
| 190 |
+
|
| 191 |
+
grid_spec = gridspec.GridSpec(1, 2, width_ratios=[6, 1])
|
| 192 |
+
|
| 193 |
+
plt.subplot(grid_spec[0])
|
| 194 |
+
plt.imshow(pred_img)
|
| 195 |
+
plt.axis('off')
|
| 196 |
+
LABEL_NAMES = np.asarray(labels_list)
|
| 197 |
+
FULL_LABEL_MAP = np.arange(len(LABEL_NAMES)).reshape(len(LABEL_NAMES), 1)
|
| 198 |
+
FULL_COLOR_MAP = label_to_color_image(FULL_LABEL_MAP)
|
| 199 |
+
|
| 200 |
+
unique_labels = np.unique(seg.numpy().astype("uint8"))
|
| 201 |
+
ax = plt.subplot(grid_spec[1])
|
| 202 |
+
plt.imshow(FULL_COLOR_MAP[unique_labels].astype(np.uint8), interpolation="nearest")
|
| 203 |
+
ax.yaxis.tick_right()
|
| 204 |
+
plt.yticks(range(len(unique_labels)), LABEL_NAMES[unique_labels])
|
| 205 |
+
plt.xticks([], [])
|
| 206 |
+
ax.tick_params(width=0.0, labelsize=25)
|
| 207 |
+
return fig
|
| 208 |
+
|
| 209 |
+
def sepia(input_img):
|
| 210 |
+
input_img = Image.fromarray(input_img)
|
| 211 |
+
|
| 212 |
+
inputs = feature_extractor(images=input_img, return_tensors="tf")
|
| 213 |
+
outputs = model(**inputs)
|
| 214 |
+
logits = outputs.logits
|
| 215 |
+
|
| 216 |
+
logits = tf.transpose(logits, [0, 2, 3, 1])
|
| 217 |
+
logits = tf.image.resize(
|
| 218 |
+
logits, input_img.size[::-1]
|
| 219 |
+
) # We reverse the shape of `image` because `image.size` returns width and height.
|
| 220 |
+
seg = tf.math.argmax(logits, axis=-1)[0]
|
| 221 |
+
|
| 222 |
+
color_seg = np.zeros(
|
| 223 |
+
(seg.shape[0], seg.shape[1], 3), dtype=np.uint8
|
| 224 |
+
) # height, width, 3
|
| 225 |
+
for label, color in enumerate(colormap):
|
| 226 |
+
color_seg[seg.numpy() == label, :] = color
|
| 227 |
+
|
| 228 |
+
# Show image + mask
|
| 229 |
+
pred_img = np.array(input_img) * 0.5 + color_seg * 0.5
|
| 230 |
+
pred_img = pred_img.astype(np.uint8)
|
| 231 |
+
|
| 232 |
+
fig = draw_plot(pred_img, seg)
|
| 233 |
+
return fig
|
| 234 |
+
|
| 235 |
+
demo = gr.Interface(fn=sepia,
|
| 236 |
+
inputs=gr.Image(shape=(400, 600)),
|
| 237 |
+
outputs=['plot'],
|
| 238 |
+
examples=["스크린샷(247).png"],
|
| 239 |
+
allow_flagging='never')
|
| 240 |
+
|
| 241 |
+
|
| 242 |
+
demo.launch()
|
config.json
DELETED
|
@@ -1,372 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"architectures": [
|
| 3 |
-
"SegformerForSemanticSegmentation"
|
| 4 |
-
],
|
| 5 |
-
"attention_probs_dropout_prob": 0.0,
|
| 6 |
-
"classifier_dropout_prob": 0.1,
|
| 7 |
-
"decoder_hidden_size": 256,
|
| 8 |
-
"depths": [
|
| 9 |
-
2,
|
| 10 |
-
2,
|
| 11 |
-
2,
|
| 12 |
-
2
|
| 13 |
-
],
|
| 14 |
-
"downsampling_rates": [
|
| 15 |
-
1,
|
| 16 |
-
4,
|
| 17 |
-
8,
|
| 18 |
-
16
|
| 19 |
-
],
|
| 20 |
-
"drop_path_rate": 0.1,
|
| 21 |
-
"hidden_act": "gelu",
|
| 22 |
-
"hidden_dropout_prob": 0.0,
|
| 23 |
-
"hidden_sizes": [
|
| 24 |
-
32,
|
| 25 |
-
64,
|
| 26 |
-
160,
|
| 27 |
-
256
|
| 28 |
-
],
|
| 29 |
-
"id2label": {
|
| 30 |
-
"0": "wall",
|
| 31 |
-
"1": "building",
|
| 32 |
-
"2": "sky",
|
| 33 |
-
"3": "floor",
|
| 34 |
-
"4": "tree",
|
| 35 |
-
"5": "ceiling",
|
| 36 |
-
"6": "road",
|
| 37 |
-
"7": "bed ",
|
| 38 |
-
"8": "windowpane",
|
| 39 |
-
"9": "grass",
|
| 40 |
-
"10": "cabinet",
|
| 41 |
-
"11": "sidewalk",
|
| 42 |
-
"12": "person",
|
| 43 |
-
"13": "earth",
|
| 44 |
-
"14": "door",
|
| 45 |
-
"15": "table",
|
| 46 |
-
"16": "mountain",
|
| 47 |
-
"17": "plant",
|
| 48 |
-
"18": "curtain",
|
| 49 |
-
"19": "chair",
|
| 50 |
-
"20": "car",
|
| 51 |
-
"21": "water",
|
| 52 |
-
"22": "painting",
|
| 53 |
-
"23": "sofa",
|
| 54 |
-
"24": "shelf",
|
| 55 |
-
"25": "house",
|
| 56 |
-
"26": "sea",
|
| 57 |
-
"27": "mirror",
|
| 58 |
-
"28": "rug",
|
| 59 |
-
"29": "field",
|
| 60 |
-
"30": "armchair",
|
| 61 |
-
"31": "seat",
|
| 62 |
-
"32": "fence",
|
| 63 |
-
"33": "desk",
|
| 64 |
-
"34": "rock",
|
| 65 |
-
"35": "wardrobe",
|
| 66 |
-
"36": "lamp",
|
| 67 |
-
"37": "bathtub",
|
| 68 |
-
"38": "railing",
|
| 69 |
-
"39": "cushion",
|
| 70 |
-
"40": "base",
|
| 71 |
-
"41": "box",
|
| 72 |
-
"42": "column",
|
| 73 |
-
"43": "signboard",
|
| 74 |
-
"44": "chest of drawers",
|
| 75 |
-
"45": "counter",
|
| 76 |
-
"46": "sand",
|
| 77 |
-
"47": "sink",
|
| 78 |
-
"48": "skyscraper",
|
| 79 |
-
"49": "fireplace",
|
| 80 |
-
"50": "refrigerator",
|
| 81 |
-
"51": "grandstand",
|
| 82 |
-
"52": "path",
|
| 83 |
-
"53": "stairs",
|
| 84 |
-
"54": "runway",
|
| 85 |
-
"55": "case",
|
| 86 |
-
"56": "pool table",
|
| 87 |
-
"57": "pillow",
|
| 88 |
-
"58": "screen door",
|
| 89 |
-
"59": "stairway",
|
| 90 |
-
"60": "river",
|
| 91 |
-
"61": "bridge",
|
| 92 |
-
"62": "bookcase",
|
| 93 |
-
"63": "blind",
|
| 94 |
-
"64": "coffee table",
|
| 95 |
-
"65": "toilet",
|
| 96 |
-
"66": "flower",
|
| 97 |
-
"67": "book",
|
| 98 |
-
"68": "hill",
|
| 99 |
-
"69": "bench",
|
| 100 |
-
"70": "countertop",
|
| 101 |
-
"71": "stove",
|
| 102 |
-
"72": "palm",
|
| 103 |
-
"73": "kitchen island",
|
| 104 |
-
"74": "computer",
|
| 105 |
-
"75": "swivel chair",
|
| 106 |
-
"76": "boat",
|
| 107 |
-
"77": "bar",
|
| 108 |
-
"78": "arcade machine",
|
| 109 |
-
"79": "hovel",
|
| 110 |
-
"80": "bus",
|
| 111 |
-
"81": "towel",
|
| 112 |
-
"82": "light",
|
| 113 |
-
"83": "truck",
|
| 114 |
-
"84": "tower",
|
| 115 |
-
"85": "chandelier",
|
| 116 |
-
"86": "awning",
|
| 117 |
-
"87": "streetlight",
|
| 118 |
-
"88": "booth",
|
| 119 |
-
"89": "television receiver",
|
| 120 |
-
"90": "airplane",
|
| 121 |
-
"91": "dirt track",
|
| 122 |
-
"92": "apparel",
|
| 123 |
-
"93": "pole",
|
| 124 |
-
"94": "land",
|
| 125 |
-
"95": "bannister",
|
| 126 |
-
"96": "escalator",
|
| 127 |
-
"97": "ottoman",
|
| 128 |
-
"98": "bottle",
|
| 129 |
-
"99": "buffet",
|
| 130 |
-
"100": "poster",
|
| 131 |
-
"101": "stage",
|
| 132 |
-
"102": "van",
|
| 133 |
-
"103": "ship",
|
| 134 |
-
"104": "fountain",
|
| 135 |
-
"105": "conveyer belt",
|
| 136 |
-
"106": "canopy",
|
| 137 |
-
"107": "washer",
|
| 138 |
-
"108": "plaything",
|
| 139 |
-
"109": "swimming pool",
|
| 140 |
-
"110": "stool",
|
| 141 |
-
"111": "barrel",
|
| 142 |
-
"112": "basket",
|
| 143 |
-
"113": "waterfall",
|
| 144 |
-
"114": "tent",
|
| 145 |
-
"115": "bag",
|
| 146 |
-
"116": "minibike",
|
| 147 |
-
"117": "cradle",
|
| 148 |
-
"118": "oven",
|
| 149 |
-
"119": "ball",
|
| 150 |
-
"120": "food",
|
| 151 |
-
"121": "step",
|
| 152 |
-
"122": "tank",
|
| 153 |
-
"123": "trade name",
|
| 154 |
-
"124": "microwave",
|
| 155 |
-
"125": "pot",
|
| 156 |
-
"126": "animal",
|
| 157 |
-
"127": "bicycle",
|
| 158 |
-
"128": "lake",
|
| 159 |
-
"129": "dishwasher",
|
| 160 |
-
"130": "screen",
|
| 161 |
-
"131": "blanket",
|
| 162 |
-
"132": "sculpture",
|
| 163 |
-
"133": "hood",
|
| 164 |
-
"134": "sconce",
|
| 165 |
-
"135": "vase",
|
| 166 |
-
"136": "traffic light",
|
| 167 |
-
"137": "tray",
|
| 168 |
-
"138": "ashcan",
|
| 169 |
-
"139": "fan",
|
| 170 |
-
"140": "pier",
|
| 171 |
-
"141": "crt screen",
|
| 172 |
-
"142": "plate",
|
| 173 |
-
"143": "monitor",
|
| 174 |
-
"144": "bulletin board",
|
| 175 |
-
"145": "shower",
|
| 176 |
-
"146": "radiator",
|
| 177 |
-
"147": "glass",
|
| 178 |
-
"148": "clock",
|
| 179 |
-
"149": "flag"
|
| 180 |
-
},
|
| 181 |
-
"image_size": 224,
|
| 182 |
-
"initializer_range": 0.02,
|
| 183 |
-
"label2id": {
|
| 184 |
-
"airplane": 90,
|
| 185 |
-
"animal": 126,
|
| 186 |
-
"apparel": 92,
|
| 187 |
-
"arcade machine": 78,
|
| 188 |
-
"armchair": 30,
|
| 189 |
-
"ashcan": 138,
|
| 190 |
-
"awning": 86,
|
| 191 |
-
"bag": 115,
|
| 192 |
-
"ball": 119,
|
| 193 |
-
"bannister": 95,
|
| 194 |
-
"bar": 77,
|
| 195 |
-
"barrel": 111,
|
| 196 |
-
"base": 40,
|
| 197 |
-
"basket": 112,
|
| 198 |
-
"bathtub": 37,
|
| 199 |
-
"bed ": 7,
|
| 200 |
-
"bench": 69,
|
| 201 |
-
"bicycle": 127,
|
| 202 |
-
"blanket": 131,
|
| 203 |
-
"blind": 63,
|
| 204 |
-
"boat": 76,
|
| 205 |
-
"book": 67,
|
| 206 |
-
"bookcase": 62,
|
| 207 |
-
"booth": 88,
|
| 208 |
-
"bottle": 98,
|
| 209 |
-
"box": 41,
|
| 210 |
-
"bridge": 61,
|
| 211 |
-
"buffet": 99,
|
| 212 |
-
"building": 1,
|
| 213 |
-
"bulletin board": 144,
|
| 214 |
-
"bus": 80,
|
| 215 |
-
"cabinet": 10,
|
| 216 |
-
"canopy": 106,
|
| 217 |
-
"car": 20,
|
| 218 |
-
"case": 55,
|
| 219 |
-
"ceiling": 5,
|
| 220 |
-
"chair": 19,
|
| 221 |
-
"chandelier": 85,
|
| 222 |
-
"chest of drawers": 44,
|
| 223 |
-
"clock": 148,
|
| 224 |
-
"coffee table": 64,
|
| 225 |
-
"column": 42,
|
| 226 |
-
"computer": 74,
|
| 227 |
-
"conveyer belt": 105,
|
| 228 |
-
"counter": 45,
|
| 229 |
-
"countertop": 70,
|
| 230 |
-
"cradle": 117,
|
| 231 |
-
"crt screen": 141,
|
| 232 |
-
"curtain": 18,
|
| 233 |
-
"cushion": 39,
|
| 234 |
-
"desk": 33,
|
| 235 |
-
"dirt track": 91,
|
| 236 |
-
"dishwasher": 129,
|
| 237 |
-
"door": 14,
|
| 238 |
-
"earth": 13,
|
| 239 |
-
"escalator": 96,
|
| 240 |
-
"fan": 139,
|
| 241 |
-
"fence": 32,
|
| 242 |
-
"field": 29,
|
| 243 |
-
"fireplace": 49,
|
| 244 |
-
"flag": 149,
|
| 245 |
-
"floor": 3,
|
| 246 |
-
"flower": 66,
|
| 247 |
-
"food": 120,
|
| 248 |
-
"fountain": 104,
|
| 249 |
-
"glass": 147,
|
| 250 |
-
"grandstand": 51,
|
| 251 |
-
"grass": 9,
|
| 252 |
-
"hill": 68,
|
| 253 |
-
"hood": 133,
|
| 254 |
-
"house": 25,
|
| 255 |
-
"hovel": 79,
|
| 256 |
-
"kitchen island": 73,
|
| 257 |
-
"lake": 128,
|
| 258 |
-
"lamp": 36,
|
| 259 |
-
"land": 94,
|
| 260 |
-
"light": 82,
|
| 261 |
-
"microwave": 124,
|
| 262 |
-
"minibike": 116,
|
| 263 |
-
"mirror": 27,
|
| 264 |
-
"monitor": 143,
|
| 265 |
-
"mountain": 16,
|
| 266 |
-
"ottoman": 97,
|
| 267 |
-
"oven": 118,
|
| 268 |
-
"painting": 22,
|
| 269 |
-
"palm": 72,
|
| 270 |
-
"path": 52,
|
| 271 |
-
"person": 12,
|
| 272 |
-
"pier": 140,
|
| 273 |
-
"pillow": 57,
|
| 274 |
-
"plant": 17,
|
| 275 |
-
"plate": 142,
|
| 276 |
-
"plaything": 108,
|
| 277 |
-
"pole": 93,
|
| 278 |
-
"pool table": 56,
|
| 279 |
-
"poster": 100,
|
| 280 |
-
"pot": 125,
|
| 281 |
-
"radiator": 146,
|
| 282 |
-
"railing": 38,
|
| 283 |
-
"refrigerator": 50,
|
| 284 |
-
"river": 60,
|
| 285 |
-
"road": 6,
|
| 286 |
-
"rock": 34,
|
| 287 |
-
"rug": 28,
|
| 288 |
-
"runway": 54,
|
| 289 |
-
"sand": 46,
|
| 290 |
-
"sconce": 134,
|
| 291 |
-
"screen": 130,
|
| 292 |
-
"screen door": 58,
|
| 293 |
-
"sculpture": 132,
|
| 294 |
-
"sea": 26,
|
| 295 |
-
"seat": 31,
|
| 296 |
-
"shelf": 24,
|
| 297 |
-
"ship": 103,
|
| 298 |
-
"shower": 145,
|
| 299 |
-
"sidewalk": 11,
|
| 300 |
-
"signboard": 43,
|
| 301 |
-
"sink": 47,
|
| 302 |
-
"sky": 2,
|
| 303 |
-
"skyscraper": 48,
|
| 304 |
-
"sofa": 23,
|
| 305 |
-
"stage": 101,
|
| 306 |
-
"stairs": 53,
|
| 307 |
-
"stairway": 59,
|
| 308 |
-
"step": 121,
|
| 309 |
-
"stool": 110,
|
| 310 |
-
"stove": 71,
|
| 311 |
-
"streetlight": 87,
|
| 312 |
-
"swimming pool": 109,
|
| 313 |
-
"swivel chair": 75,
|
| 314 |
-
"table": 15,
|
| 315 |
-
"tank": 122,
|
| 316 |
-
"television receiver": 89,
|
| 317 |
-
"tent": 114,
|
| 318 |
-
"toilet": 65,
|
| 319 |
-
"towel": 81,
|
| 320 |
-
"tower": 84,
|
| 321 |
-
"trade name": 123,
|
| 322 |
-
"traffic light": 136,
|
| 323 |
-
"tray": 137,
|
| 324 |
-
"tree": 4,
|
| 325 |
-
"truck": 83,
|
| 326 |
-
"van": 102,
|
| 327 |
-
"vase": 135,
|
| 328 |
-
"wall": 0,
|
| 329 |
-
"wardrobe": 35,
|
| 330 |
-
"washer": 107,
|
| 331 |
-
"water": 21,
|
| 332 |
-
"waterfall": 113,
|
| 333 |
-
"windowpane": 8
|
| 334 |
-
},
|
| 335 |
-
"layer_norm_eps": 1e-06,
|
| 336 |
-
"mlp_ratios": [
|
| 337 |
-
4,
|
| 338 |
-
4,
|
| 339 |
-
4,
|
| 340 |
-
4
|
| 341 |
-
],
|
| 342 |
-
"model_type": "segformer",
|
| 343 |
-
"num_attention_heads": [
|
| 344 |
-
1,
|
| 345 |
-
2,
|
| 346 |
-
5,
|
| 347 |
-
8
|
| 348 |
-
],
|
| 349 |
-
"num_channels": 3,
|
| 350 |
-
"num_encoder_blocks": 4,
|
| 351 |
-
"patch_sizes": [
|
| 352 |
-
7,
|
| 353 |
-
3,
|
| 354 |
-
3,
|
| 355 |
-
3
|
| 356 |
-
],
|
| 357 |
-
"reshape_last_stage": true,
|
| 358 |
-
"sr_ratios": [
|
| 359 |
-
8,
|
| 360 |
-
4,
|
| 361 |
-
2,
|
| 362 |
-
1
|
| 363 |
-
],
|
| 364 |
-
"strides": [
|
| 365 |
-
4,
|
| 366 |
-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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
labels.txt
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
preprocessor_config.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"do_normalize": true,
|
| 3 |
-
"do_resize": true,
|
| 4 |
-
"feature_extractor_type": "SegformerFeatureExtractor",
|
| 5 |
-
"image_mean": [
|
| 6 |
-
0.485,
|
| 7 |
-
0.456,
|
| 8 |
-
0.406
|
| 9 |
-
],
|
| 10 |
-
"image_std": [
|
| 11 |
-
0.229,
|
| 12 |
-
0.224,
|
| 13 |
-
0.225
|
| 14 |
-
],
|
| 15 |
-
"reduce_labels": true,
|
| 16 |
-
"resample": 2,
|
| 17 |
-
"size": 512
|
| 18 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pytorch_model.bin
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:0f4df97633cbedd558ecffa3ad228ace5af37e082678390b45a9d22745787c61
|
| 3 |
-
size 15092257
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
torch
|
| 2 |
+
transformers
|
| 3 |
+
tensorflow
|
| 4 |
+
numpy
|
| 5 |
+
Image
|
| 6 |
+
matplotlib
|
tf_model.h5
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:d38f99e2a8e73bbdb4635669be5bfcbbfc85b4b5c1ac75d36b47312c7fc5d06e
|
| 3 |
-
size 15285696
|
|
|
|
|
|
|
|
|
|
|
|
/354/212/244/355/201/254/353/246/260/354/203/267(247).png
ADDED
|