IMvision12 commited on
Commit
1ca6f58
verified
1 Parent(s): d1c3c85

fix readme.md

Browse files
Files changed (1) hide show
  1. README.md +5 -4
README.md CHANGED
@@ -25,7 +25,8 @@ tags:
25
 
26
  Paper: [Masked-attention Mask Transformer for Universal Image Segmentation (arXiv:2112.01527)](https://arxiv.org/abs/2112.01527) 路 [HF Papers](https://huggingface.co/papers/2112.01527)
27
 
28
- Mask2Former improves MaskFormer with masked attention in the transformer decoder, restricting cross-attention to predicted mask regions for sharper boundaries and stronger universal segmentation.\n
 
29
  For more details on the model, please go to the upstream [model card](https://huggingface.co/facebook/mask2former-swin-tiny-coco-panoptic).
30
 
31
  Pure-**Keras 3** conversion of [`facebook/mask2former-swin-tiny-coco-panoptic`](https://huggingface.co/facebook/mask2former-swin-tiny-coco-panoptic) 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 {meta['import_path']} import {meta['load_cls']}, {meta['proc_cls']}
43
 
44
- model = {meta["load_cls"]}.from_weights("kerasformers/{variant}")
45
- processor = {meta['proc_cls']}()
46
 
47
  image = Image.open("your_image.jpg").convert("RGB")
48
  output = model(processor(image)["pixel_values"], training=False)
 
25
 
26
  Paper: [Masked-attention Mask Transformer for Universal Image Segmentation (arXiv:2112.01527)](https://arxiv.org/abs/2112.01527) 路 [HF Papers](https://huggingface.co/papers/2112.01527)
27
 
28
+ Mask2Former improves MaskFormer with masked attention in the transformer decoder, restricting cross-attention to predicted mask regions for sharper boundaries and stronger universal segmentation.
29
+
30
  For more details on the model, please go to the upstream [model card](https://huggingface.co/facebook/mask2former-swin-tiny-coco-panoptic).
31
 
32
  Pure-**Keras 3** conversion of [`facebook/mask2former-swin-tiny-coco-panoptic`](https://huggingface.co/facebook/mask2former-swin-tiny-coco-panoptic) 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.mask2former import Mask2FormerUniversalSegment, Mask2FormerImageProcessor
44
 
45
+ model = Mask2FormerUniversalSegment.from_weights("kerasformers/mask2former-swin-tiny-coco-panoptic")
46
+ processor = Mask2FormerImageProcessor()
47
 
48
  image = Image.open("your_image.jpg").convert("RGB")
49
  output = model(processor(image)["pixel_values"], training=False)