parkchihoon commited on
Commit
9fdee19
1 Parent(s): 667e24b

first commit

Browse files
Files changed (6) hide show
  1. .gitattributes +8 -27
  2. README.md +74 -9
  3. config.json +372 -0
  4. preprocessor_config.json +18 -0
  5. pytorch_model.bin +3 -0
  6. tf_model.h5 +3 -0
.gitattributes CHANGED
@@ -1,35 +1,16 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
  *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
  *.h5 filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
9
  *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
  *.model filter=lfs diff=lfs merge=lfs -text
13
  *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
  *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
  *.pt filter=lfs diff=lfs merge=lfs -text
23
  *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
1
+ *.bin.* filter=lfs diff=lfs merge=lfs -text
2
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
3
  *.bin filter=lfs diff=lfs merge=lfs -text
 
 
 
 
4
  *.h5 filter=lfs diff=lfs merge=lfs -text
5
+ *.tflite filter=lfs diff=lfs merge=lfs -text
6
+ *.tar.gz filter=lfs diff=lfs merge=lfs -text
7
+ *.ot filter=lfs diff=lfs merge=lfs -text
8
+ *.onnx filter=lfs diff=lfs merge=lfs -text
9
+ *.arrow filter=lfs diff=lfs merge=lfs -text
10
+ *.ftz filter=lfs diff=lfs merge=lfs -text
11
  *.joblib filter=lfs diff=lfs merge=lfs -text
 
 
12
  *.model filter=lfs diff=lfs merge=lfs -text
13
  *.msgpack filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
14
  *.pb filter=lfs diff=lfs merge=lfs -text
 
 
15
  *.pt filter=lfs diff=lfs merge=lfs -text
16
  *.pth filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
README.md CHANGED
@@ -1,12 +1,77 @@
1
  ---
2
- title: My Model
3
- emoji: 🦀
4
- colorFrom: yellow
5
- colorTo: green
6
- sdk: gradio
7
- sdk_version: 4.1.2
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: other
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
  ---
14
 
15
+ # SegFormer (b0-sized) model fine-tuned on ADE20k
16
+
17
+ 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).
18
+
19
+ 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.
20
+
21
+ ## Model description
22
+
23
+ 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.
24
+
25
+ ## Intended uses & limitations
26
+
27
+ 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.
28
+
29
+ ### How to use
30
+
31
+ Here is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:
32
+
33
+ ```python
34
+ from transformers import SegformerImageProcessor, SegformerForSemanticSegmentation
35
+ from PIL import Image
36
+ import requests
37
+
38
+ processor = SegformerImageProcessor.from_pretrained("nvidia/segformer-b0-finetuned-ade-512-512")
39
+ model = SegformerForSemanticSegmentation.from_pretrained("nvidia/segformer-b0-finetuned-ade-512-512")
40
+
41
+ url = "http://images.cocodataset.org/val2017/000000039769.jpg"
42
+ image = Image.open(requests.get(url, stream=True).raw)
43
+
44
+ inputs = feature_extractor(images=image, return_tensors="pt")
45
+ outputs = model(**inputs)
46
+ logits = outputs.logits # shape (batch_size, num_labels, height/4, width/4)
47
+ ```
48
+
49
+ For more code examples, we refer to the [documentation](https://huggingface.co/transformers/model_doc/segformer.html#).
50
+
51
+ ### License
52
+
53
+ The license for this model can be found [here](https://github.com/NVlabs/SegFormer/blob/master/LICENSE).
54
+
55
+ ### BibTeX entry and citation info
56
+
57
+ ```bibtex
58
+ @article{DBLP:journals/corr/abs-2105-15203,
59
+ author = {Enze Xie and
60
+ Wenhai Wang and
61
+ Zhiding Yu and
62
+ Anima Anandkumar and
63
+ Jose M. Alvarez and
64
+ Ping Luo},
65
+ title = {SegFormer: Simple and Efficient Design for Semantic Segmentation with
66
+ Transformers},
67
+ journal = {CoRR},
68
+ volume = {abs/2105.15203},
69
+ year = {2021},
70
+ url = {https://arxiv.org/abs/2105.15203},
71
+ eprinttype = {arXiv},
72
+ eprint = {2105.15203},
73
+ timestamp = {Wed, 02 Jun 2021 11:46:42 +0200},
74
+ biburl = {https://dblp.org/rec/journals/corr/abs-2105-15203.bib},
75
+ bibsource = {dblp computer science bibliography, https://dblp.org}
76
+ }
77
+ ```
config.json ADDED
@@ -0,0 +1,372 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ 2,
367
+ 2,
368
+ 2
369
+ ],
370
+ "torch_dtype": "float32",
371
+ "transformers_version": "4.12.0.dev0"
372
+ }
preprocessor_config.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f4df97633cbedd558ecffa3ad228ace5af37e082678390b45a9d22745787c61
3
+ size 15092257
tf_model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d38f99e2a8e73bbdb4635669be5bfcbbfc85b4b5c1ac75d36b47312c7fc5d06e
3
+ size 15285696