Instructions to use zeromodels/maskformer-swin-tiny-coco with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasFormers
How to use zeromodels/maskformer-swin-tiny-coco with KerasFormers:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Keras
How to use zeromodels/maskformer-swin-tiny-coco with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://zeromodels/maskformer-swin-tiny-coco") - Notebooks
- Google Colab
- Kaggle
fix readme.md
Browse files
README.md
CHANGED
|
@@ -25,7 +25,8 @@ tags:
|
|
| 25 |
|
| 26 |
Paper: [Per-Pixel Classification is Not All You Need for Semantic Segmentation (arXiv:2107.06278)](https://arxiv.org/abs/2107.06278) 路 [HF Papers](https://huggingface.co/papers/2107.06278)
|
| 27 |
|
| 28 |
-
MaskFormer reframes segmentation as mask classification: a backbone and pixel decoder feed a transformer decoder whose queries each predict a binary mask and a class. One architecture covers semantic, instance, and panoptic outputs via post-processing.
|
|
|
|
| 29 |
For more details on the model, please go to the upstream [model card](https://huggingface.co/facebook/maskformer-swin-tiny-coco).
|
| 30 |
|
| 31 |
Pure-**Keras 3** conversion of [`facebook/maskformer-swin-tiny-coco`](https://huggingface.co/facebook/maskformer-swin-tiny-coco) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
|
|
@@ -39,10 +40,10 @@ import os
|
|
| 39 |
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
|
| 40 |
|
| 41 |
from PIL import Image
|
| 42 |
-
from
|
| 43 |
|
| 44 |
-
model =
|
| 45 |
-
processor =
|
| 46 |
|
| 47 |
image = Image.open("your_image.jpg").convert("RGB")
|
| 48 |
output = model(processor(image)["pixel_values"], training=False)
|
|
|
|
| 25 |
|
| 26 |
Paper: [Per-Pixel Classification is Not All You Need for Semantic Segmentation (arXiv:2107.06278)](https://arxiv.org/abs/2107.06278) 路 [HF Papers](https://huggingface.co/papers/2107.06278)
|
| 27 |
|
| 28 |
+
MaskFormer reframes segmentation as mask classification: a backbone and pixel decoder feed a transformer decoder whose queries each predict a binary mask and a class. One architecture covers semantic, instance, and panoptic outputs via post-processing.
|
| 29 |
+
|
| 30 |
For more details on the model, please go to the upstream [model card](https://huggingface.co/facebook/maskformer-swin-tiny-coco).
|
| 31 |
|
| 32 |
Pure-**Keras 3** conversion of [`facebook/maskformer-swin-tiny-coco`](https://huggingface.co/facebook/maskformer-swin-tiny-coco) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
|
|
|
|
| 40 |
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
|
| 41 |
|
| 42 |
from PIL import Image
|
| 43 |
+
from kerasformers.models.maskformer import MaskFormerUniversalSegment, MaskFormerImageProcessor
|
| 44 |
|
| 45 |
+
model = MaskFormerUniversalSegment.from_weights("kerasformers/maskformer-swin-tiny-coco")
|
| 46 |
+
processor = MaskFormerImageProcessor.from_weights("kerasformers/maskformer-swin-tiny-coco")
|
| 47 |
|
| 48 |
image = Image.open("your_image.jpg").convert("RGB")
|
| 49 |
output = model(processor(image)["pixel_values"], training=False)
|