Update README.md (#2)
Browse files- Update README.md (17688508197fe53bb8676f505cb738cdaeef9565)
- Update README.md (d0921de2c9836967450ccc816cd52e14f245fe46)
- Update preprocessor_config.json (cb3541211bc8a1b428f1a7cb3e6564196c619e62)
Co-authored-by: Shivalika Singh <shivi@users.noreply.huggingface.co>
- README.md +1 -2
- preprocessor_config.json +1 -1
README.md
CHANGED
@@ -60,9 +60,8 @@ class_queries_logits = outputs.class_queries_logits
|
|
60 |
masks_queries_logits = outputs.masks_queries_logits
|
61 |
|
62 |
# you can pass them to processor for postprocessing
|
63 |
-
|
64 |
# we refer to the demo notebooks for visualization (see "Resources" section in the Mask2Former docs)
|
65 |
-
predicted_semantic_map = result["segmentation"]
|
66 |
```
|
67 |
|
68 |
For more code examples, we refer to the [documentation](https://huggingface.co/docs/transformers/master/en/model_doc/mask2former).
|
|
|
60 |
masks_queries_logits = outputs.masks_queries_logits
|
61 |
|
62 |
# you can pass them to processor for postprocessing
|
63 |
+
predicted_semantic_map = processor.post_process_semantic_segmentation(outputs, target_sizes=[image.size[::-1]])[0]
|
64 |
# we refer to the demo notebooks for visualization (see "Resources" section in the Mask2Former docs)
|
|
|
65 |
```
|
66 |
|
67 |
For more code examples, we refer to the [documentation](https://huggingface.co/docs/transformers/master/en/model_doc/mask2former).
|
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,
|