chaodu001 commited on
Commit
1c5deaf
1 Parent(s): 3bb6ca7

Upload 8 files

Browse files
segformer-b3-fashion/.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
segformer-b3-fashion/.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ checkpoint-*/
segformer-b3-fashion/README.md ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ tags:
4
+ - vision
5
+ - image-segmentation
6
+ - generated_from_trainer
7
+ widget:
8
+ - src: >-
9
+ https://media.istockphoto.com/id/515788534/photo/cheerful-and-confidant.jpg?s=612x612&w=0&k=20&c=T0Z4DfameRpyGhzevPomrm-wjZp7wmGjpAyjGcTzpkA=
10
+ example_title: Person
11
+ - src: >-
12
+ https://storage.googleapis.com/pai-images/1484fd9ea9d746eb9f1de0d6778dbea2.jpeg
13
+ example_title: Person
14
+ datasets:
15
+ - sayeed99/fashion_segmentation
16
+ model-index:
17
+ - name: segformer-b3-fashion
18
+ results: []
19
+ pipeline_tag: image-segmentation
20
+ ---
21
+
22
+
23
+ # segformer-b3-fashion
24
+
25
+ This model is a fine-tuned version of [nvidia/mit-b3](https://huggingface.co/nvidia/mit-b3) on the sayeed99/fashion_segmentation dataset using original image sizes without resizing.
26
+
27
+
28
+ ```python
29
+ from transformers import SegformerImageProcessor, AutoModelForSemanticSegmentation
30
+ from PIL import Image
31
+ import requests
32
+ import matplotlib.pyplot as plt
33
+ import torch.nn as nn
34
+
35
+ processor = SegformerImageProcessor.from_pretrained("sayeed99/segformer-b3-fashion")
36
+ model = AutoModelForSemanticSegmentation.from_pretrained("sayeed99/segformer-b3-fashion")
37
+
38
+ url = "https://plus.unsplash.com/premium_photo-1673210886161-bfcc40f54d1f?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8cGVyc29uJTIwc3RhbmRpbmd8ZW58MHx8MHx8&w=1000&q=80"
39
+
40
+ image = Image.open(requests.get(url, stream=True).raw)
41
+ inputs = processor(images=image, return_tensors="pt")
42
+
43
+ outputs = model(**inputs)
44
+ logits = outputs.logits.cpu()
45
+
46
+ upsampled_logits = nn.functional.interpolate(
47
+ logits,
48
+ size=image.size[::-1],
49
+ mode="bilinear",
50
+ align_corners=False,
51
+ )
52
+
53
+ pred_seg = upsampled_logits.argmax(dim=1)[0]
54
+ plt.imshow(pred_seg)
55
+ ```
56
+
57
+ Labels : {"0":"Unlabelled", "1": "shirt, blouse", "2": "top, t-shirt, sweatshirt", "3": "sweater", "4": "cardigan", "5": "jacket", "6": "vest", "7": "pants", "8": "shorts", "9": "skirt", "10": "coat", "11": "dress", "12": "jumpsuit", "13": "cape", "14": "glasses", "15": "hat", "16": "headband, head covering, hair accessory", "17": "tie", "18": "glove", "19": "watch", "20": "belt", "21": "leg warmer", "22": "tights, stockings", "23": "sock", "24": "shoe", "25": "bag, wallet", "26": "scarf", "27": "umbrella", "28": "hood", "29": "collar", "30": "lapel", "31": "epaulette", "32": "sleeve", "33": "pocket", "34": "neckline", "35": "buckle", "36": "zipper", "37": "applique", "38": "bead", "39": "bow", "40": "flower", "41": "fringe", "42": "ribbon", "43": "rivet", "44": "ruffle", "45": "sequin", "46": "tassel"}
58
+
59
+ ### Framework versions
60
+
61
+ - Transformers 4.30.0
62
+ - Pytorch 2.2.2+cu121
63
+ - Datasets 2.18.0
64
+ - Tokenizers 0.13.3
65
+
66
+
67
+ ### License
68
+
69
+ The license for this model can be found [here](https://github.com/NVlabs/SegFormer/blob/master/LICENSE).
70
+
71
+ ### BibTeX entry and citation info
72
+
73
+ ```bibtex
74
+ @article{DBLP:journals/corr/abs-2105-15203,
75
+ author = {Enze Xie and
76
+ Wenhai Wang and
77
+ Zhiding Yu and
78
+ Anima Anandkumar and
79
+ Jose M. Alvarez and
80
+ Ping Luo},
81
+ title = {SegFormer: Simple and Efficient Design for Semantic Segmentation with
82
+ Transformers},
83
+ journal = {CoRR},
84
+ volume = {abs/2105.15203},
85
+ year = {2021},
86
+ url = {https://arxiv.org/abs/2105.15203},
87
+ eprinttype = {arXiv},
88
+ eprint = {2105.15203},
89
+ timestamp = {Wed, 02 Jun 2021 11:46:42 +0200},
90
+ biburl = {https://dblp.org/rec/journals/corr/abs-2105-15203.bib},
91
+ bibsource = {dblp computer science bibliography, https://dblp.org}
92
+ }
segformer-b3-fashion/config.json ADDED
@@ -0,0 +1,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "nvidia/mit-b3",
3
+ "architectures": [
4
+ "SegformerForSemanticSegmentation"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.0,
7
+ "classifier_dropout_prob": 0.1,
8
+ "decoder_hidden_size": 768,
9
+ "depths": [
10
+ 3,
11
+ 4,
12
+ 18,
13
+ 3
14
+ ],
15
+ "downsampling_rates": [
16
+ 1,
17
+ 4,
18
+ 8,
19
+ 16
20
+ ],
21
+ "drop_path_rate": 0.1,
22
+ "hidden_act": "gelu",
23
+ "hidden_dropout_prob": 0.0,
24
+ "hidden_sizes": [
25
+ 64,
26
+ 128,
27
+ 320,
28
+ 512
29
+ ],
30
+ "id2label": {
31
+ "0": "unlabelled",
32
+ "1": "shirt, blouse",
33
+ "2": "top, t-shirt, sweatshirt",
34
+ "3": "sweater",
35
+ "4": "cardigan",
36
+ "5": "jacket",
37
+ "6": "vest",
38
+ "7": "pants",
39
+ "8": "shorts",
40
+ "9": "skirt",
41
+ "10": "coat",
42
+ "11": "dress",
43
+ "12": "jumpsuit",
44
+ "13": "cape",
45
+ "14": "glasses",
46
+ "15": "hat",
47
+ "16": "headband, head covering, hair accessory",
48
+ "17": "tie",
49
+ "18": "glove",
50
+ "19": "watch",
51
+ "20": "belt",
52
+ "21": "leg warmer",
53
+ "22": "tights, stockings",
54
+ "23": "sock",
55
+ "24": "shoe",
56
+ "25": "bag, wallet",
57
+ "26": "scarf",
58
+ "27": "umbrella",
59
+ "28": "hood",
60
+ "29": "collar",
61
+ "30": "lapel",
62
+ "31": "epaulette",
63
+ "32": "sleeve",
64
+ "33": "pocket",
65
+ "34": "neckline",
66
+ "35": "buckle",
67
+ "36": "zipper",
68
+ "37": "applique",
69
+ "38": "bead",
70
+ "39": "bow",
71
+ "40": "flower",
72
+ "41": "fringe",
73
+ "42": "ribbon",
74
+ "43": "rivet",
75
+ "44": "ruffle",
76
+ "45": "sequin",
77
+ "46": "tassel"
78
+ },
79
+ "image_size": 224,
80
+ "initializer_range": 0.02,
81
+ "label2id": {
82
+ "applique": 37,
83
+ "bag, wallet": 25,
84
+ "bead": 38,
85
+ "belt": 20,
86
+ "bow": 39,
87
+ "buckle": 35,
88
+ "cape": 13,
89
+ "cardigan": 4,
90
+ "coat": 10,
91
+ "collar": 29,
92
+ "dress": 11,
93
+ "epaulette": 31,
94
+ "flower": 40,
95
+ "fringe": 41,
96
+ "glasses": 14,
97
+ "glove": 18,
98
+ "hat": 15,
99
+ "headband, head covering, hair accessory": 16,
100
+ "hood": 28,
101
+ "jacket": 5,
102
+ "jumpsuit": 12,
103
+ "lapel": 30,
104
+ "leg warmer": 21,
105
+ "neckline": 34,
106
+ "pants": 7,
107
+ "pocket": 33,
108
+ "ribbon": 42,
109
+ "rivet": 43,
110
+ "ruffle": 44,
111
+ "scarf": 26,
112
+ "sequin": 45,
113
+ "shirt, blouse": 1,
114
+ "shoe": 24,
115
+ "shorts": 8,
116
+ "skirt": 9,
117
+ "sleeve": 32,
118
+ "sock": 23,
119
+ "sweater": 3,
120
+ "tassel": 46,
121
+ "tie": 17,
122
+ "tights, stockings": 22,
123
+ "top, t-shirt, sweatshirt": 2,
124
+ "umbrella": 27,
125
+ "unlabelled": 0,
126
+ "vest": 6,
127
+ "watch": 19,
128
+ "zipper": 36
129
+ },
130
+ "layer_norm_eps": 1e-06,
131
+ "mlp_ratios": [
132
+ 4,
133
+ 4,
134
+ 4,
135
+ 4
136
+ ],
137
+ "model_type": "segformer",
138
+ "num_attention_heads": [
139
+ 1,
140
+ 2,
141
+ 5,
142
+ 8
143
+ ],
144
+ "num_channels": 3,
145
+ "num_encoder_blocks": 4,
146
+ "patch_sizes": [
147
+ 7,
148
+ 3,
149
+ 3,
150
+ 3
151
+ ],
152
+ "reshape_last_stage": true,
153
+ "semantic_loss_ignore_index": 255,
154
+ "sr_ratios": [
155
+ 8,
156
+ 4,
157
+ 2,
158
+ 1
159
+ ],
160
+ "strides": [
161
+ 4,
162
+ 2,
163
+ 2,
164
+ 2
165
+ ],
166
+ "torch_dtype": "float32",
167
+ "transformers_version": "4.30.0"
168
+ }
segformer-b3-fashion/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3f5b30179f1480d329224d089f6d286580142c2b12846d08de814a48a81f42f
3
+ size 189118204
segformer-b3-fashion/preprocessor_config.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": true,
3
+ "do_reduce_labels": false,
4
+ "do_rescale": true,
5
+ "do_resize": true,
6
+ "image_mean": [
7
+ 0.485,
8
+ 0.456,
9
+ 0.406
10
+ ],
11
+ "image_processor_type": "SegformerImageProcessor",
12
+ "image_std": [
13
+ 0.229,
14
+ 0.224,
15
+ 0.225
16
+ ],
17
+ "resample": 2,
18
+ "rescale_factor": 0.00392156862745098,
19
+ "size": {
20
+ "height": 512,
21
+ "width": 512
22
+ }
23
+ }
segformer-b3-fashion/pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec5749e86e5efad5d9dbbf7c2e4b996d675548dc22f26b06c0f1b6fc2e8bc1e2
3
+ size 189264154
segformer-b3-fashion/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f871f7bdbc3af72746e7b76beb628f6365db08040b58b3071238dca986de97ca
3
+ size 4408