Update README.md (#1)
Browse files- Update README.md (f77f179fc62b98f6734481ebbef5bceeb1e7f10b)
- Update README.md (810b5a1b4661b9ee6f4e8ba1e4e752fa8dd836be)
- Update preprocessor_config.json (e31996f7b8e731b0131a4ae13d5a2f283480d458)
Co-authored-by: Shivalika Singh <[email protected]>
- 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,
|