sayeed99 commited on
Commit
3b8af87
1 Parent(s): 8653698

update readme

Browse files
Files changed (1) hide show
  1. README.md +94 -0
README.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/human_parsing_fashion_dataset
16
+ model-index:
17
+ - name: segformer-b2-human
18
+ results: []
19
+ pipeline_tag: image-segmentation
20
+ ---
21
+
22
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
23
+ should probably proofread and complete it, then remove this comment. -->
24
+
25
+ # segformer-b2-fashion
26
+
27
+ This model is a fine-tuned version of [nvidia/mit-b2](https://huggingface.co/nvidia/mit-b2) on the sayeed99/human_parsing_fashion_dataset dataset.
28
+
29
+
30
+ ```python
31
+ from transformers import SegformerImageProcessor, AutoModelForSemanticSegmentation
32
+ from PIL import Image
33
+ import requests
34
+ import matplotlib.pyplot as plt
35
+ import torch.nn as nn
36
+
37
+ processor = SegformerImageProcessor.from_pretrained("sayeed99/segformer-b2-human")
38
+ model = AutoModelForSemanticSegmentation.from_pretrained("sayeed99/segformer-b2-human")
39
+
40
+ url = "https://plus.unsplash.com/premium_photo-1673210886161-bfcc40f54d1f?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxzZWFyY2h8MXx8cGVyc29uJTIwc3RhbmRpbmd8ZW58MHx8MHx8&w=1000&q=80"
41
+
42
+ image = Image.open(requests.get(url, stream=True).raw)
43
+ inputs = processor(images=image, return_tensors="pt")
44
+
45
+ outputs = model(**inputs)
46
+ logits = outputs.logits.cpu()
47
+
48
+ upsampled_logits = nn.functional.interpolate(
49
+ logits,
50
+ size=image.size[::-1],
51
+ mode="bilinear",
52
+ align_corners=False,
53
+ )
54
+
55
+ pred_seg = upsampled_logits.argmax(dim=1)[0]
56
+ plt.imshow(pred_seg)
57
+ ```
58
+
59
+ Labels : {"0":"Background","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","47":"Hair","48":"Sunglasses","49":"Upper-clothes","50":"Left-shoe","51":"Right-shoe","52":"Face","53":"Left-leg","54":"Right-leg","55":"Left-arm","56":"Right-arm"}
60
+
61
+ ### Framework versions
62
+
63
+ - Transformers 4.30.0
64
+ - Pytorch 2.2.2+cu121
65
+ - Datasets 2.18.0
66
+ - Tokenizers 0.13.3
67
+
68
+
69
+ ### License
70
+
71
+ The license for this model can be found [here](https://github.com/NVlabs/SegFormer/blob/master/LICENSE).
72
+
73
+ ### BibTeX entry and citation info
74
+
75
+ ```bibtex
76
+ @article{DBLP:journals/corr/abs-2105-15203,
77
+ author = {Enze Xie and
78
+ Wenhai Wang and
79
+ Zhiding Yu and
80
+ Anima Anandkumar and
81
+ Jose M. Alvarez and
82
+ Ping Luo},
83
+ title = {SegFormer: Simple and Efficient Design for Semantic Segmentation with
84
+ Transformers},
85
+ journal = {CoRR},
86
+ volume = {abs/2105.15203},
87
+ year = {2021},
88
+ url = {https://arxiv.org/abs/2105.15203},
89
+ eprinttype = {arXiv},
90
+ eprint = {2105.15203},
91
+ timestamp = {Wed, 02 Jun 2021 11:46:42 +0200},
92
+ biburl = {https://dblp.org/rec/journals/corr/abs-2105-15203.bib},
93
+ bibsource = {dblp computer science bibliography, https://dblp.org}
94
+ }