Update README.md
#1
by
shivalikasingh
- opened
- README.md +2 -2
- preprocessor_config.json +1 -1
README.md
CHANGED
|
@@ -40,12 +40,12 @@ Here is how to use this model:
|
|
| 40 |
import requests
|
| 41 |
import torch
|
| 42 |
from PIL import Image
|
| 43 |
-
from transformers import
|
| 44 |
|
| 45 |
|
| 46 |
# load Mask2Former fine-tuned on COCO instance segmentation
|
| 47 |
processor = AutoImageProcessor.from_pretrained("facebook/mask2former-swin-small-coco-instance")
|
| 48 |
-
model =
|
| 49 |
|
| 50 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
| 51 |
image = Image.open(requests.get(url, stream=True).raw)
|
|
|
|
| 40 |
import requests
|
| 41 |
import torch
|
| 42 |
from PIL import Image
|
| 43 |
+
from transformers import AutoImageProcessor, Mask2FormerForUniversalSegmentation
|
| 44 |
|
| 45 |
|
| 46 |
# load Mask2Former fine-tuned on COCO instance segmentation
|
| 47 |
processor = AutoImageProcessor.from_pretrained("facebook/mask2former-swin-small-coco-instance")
|
| 48 |
+
model = Mask2FormerForUniversalSegmentation.from_pretrained("facebook/mask2former-swin-small-coco-instance")
|
| 49 |
|
| 50 |
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
| 51 |
image = Image.open(requests.get(url, stream=True).raw)
|
preprocessor_config.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
| 9 |
0.4560000002384186,
|
| 10 |
0.4059999883174896
|
| 11 |
],
|
| 12 |
-
"image_processor_type": "
|
| 13 |
"image_std": [
|
| 14 |
0.2290000021457672,
|
| 15 |
0.2239999920129776,
|
|
|
|
| 9 |
0.4560000002384186,
|
| 10 |
0.4059999883174896
|
| 11 |
],
|
| 12 |
+
"image_processor_type": "Mask2FormerImageProcessor",
|
| 13 |
"image_std": [
|
| 14 |
0.2290000021457672,
|
| 15 |
0.2239999920129776,
|