zuppif commited on
Commit
a1e0c13
1 Parent(s): 7bb0a7e

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +60 -0
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - vision
5
+ - image-segmentatiom
6
+
7
+ datasets:
8
+ - coco
9
+
10
+
11
+
12
+ ---
13
+
14
+ # Mask
15
+
16
+ Mask model trained on coco. It was introduced in the paper [Per-Pixel Classification is Not All You Need for Semantic Segmentation](https://arxiv.org/abs/2107.06278) and first released in [this repository](https://github.com/facebookresearch/MaskFormer/blob/da3e60d85fdeedcb31476b5edd7d328826ce56cc/mask_former/modeling/criterion.py#L169).
17
+
18
+ Disclaimer: The team releasing Mask did not write a model card for this model so this model card has been written by the Hugging Face team.
19
+
20
+ ## Model description
21
+
22
+ MaskFormer addresses semantic segmentation with a mask classification paradigm instead.
23
+
24
+ ![model image](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/maskformer_architecture.png)
25
+
26
+ ## Intended uses & limitations
27
+
28
+ You can use the raw model for image classification. See the [model hub](https://huggingface.co/models?search=maskformer) to look for
29
+ fine-tuned versions on a task that interests you.
30
+
31
+ ### How to use
32
+
33
+ Here is how to use this model:
34
+
35
+ ```python
36
+ >>> from transformers import MaskFormerFeatureExtractor, MaskFormerForInstanceSegmentation
37
+ >>> from PIL import Image
38
+ >>> import requests
39
+
40
+ >>> url = "http://images.cocodataset.org/val2017/000000039769.jpg"
41
+ >>> image = Image.open(requests.get(url, stream=True).raw)
42
+ >>> feature_extractor = MaskFormerFeatureExtractor.from_pretrained("facebook/maskformer-swin-base-ade")
43
+ >>> inputs = feature_extractor(images=image, return_tensors="pt")
44
+
45
+ >>> model = MaskFormerForInstanceSegmentation.from_pretrained("facebook/maskformer-swin-base-ade")
46
+ >>> outputs = model(**inputs)
47
+ >>> # model predicts class_queries_logits of shape `(batch_size, num_queries)`
48
+ >>> # and masks_queries_logits of shape `(batch_size, num_queries, height, width)`
49
+ >>> class_queries_logits = outputs.class_queries_logits
50
+ >>> masks_queries_logits = outputs.masks_queries_logits
51
+
52
+ >>> # you can pass them to feature_extractor for postprocessing
53
+ >>> output = feature_extractor.post_process_segmentation(outputs)
54
+ >>> output = feature_extractor.post_process_semantic_segmentation(outputs)
55
+ >>> output = feature_extractor.post_process_panoptic_segmentation(outputs)
56
+ ```
57
+
58
+
59
+
60
+ For more code examples, we refer to the [documentation](https://huggingface.co/docs/transformers/master/en/model_doc/maskformer).