IMvision12 commited on
Commit
3e257fb
·
verified ·
1 Parent(s): fadfeef

fix readme.md

Browse files
Files changed (1) hide show
  1. README.md +61 -6
README.md CHANGED
@@ -1,21 +1,76 @@
1
  ---
2
  pipeline_tag: image-segmentation
3
  license: mit
 
4
  library_name: kerasformers
5
  tags:
6
  - keras
7
  - kerasformers
8
  - eomt
9
- - tf
10
- - jax
 
11
  - pytorch
 
 
12
  ---
13
 
14
- # eomt_large_coco_instance_640 (Keras 3)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
- Pure-Keras 3 weights for [kerasformers](https://github.com/IMvision12/KerasFormers), mirrored from the source. License: `mit`.
17
 
18
  ```python
19
- from kerasformers.models.eomt import EoMTUniversalSegment
20
- model = EoMTUniversalSegment.from_weights("eomt_large_coco_instance_640")
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  pipeline_tag: image-segmentation
3
  license: mit
4
+ base_model: tue-mps/coco_instance_eomt_large_640
5
  library_name: kerasformers
6
  tags:
7
  - keras
8
  - kerasformers
9
  - eomt
10
+ - instance-segmentation
11
+ - image-segmentation
12
+ - arxiv:2503.19108
13
  - pytorch
14
+ - jax
15
+ - tf
16
  ---
17
 
18
+ ## ***See [our collection](https://huggingface.co/collections/kerasformers/eomt-6a6a8e0309f2602fa0b94bb8) for all versions of EoMT.***
19
+
20
+ # Run EoMT with Keras 3: JAX, PyTorch, or TensorFlow
21
+
22
+ [![GitHub](https://img.shields.io/badge/GitHub-KerasFormers-black?logo=github)](https://github.com/IMvision12/KerasFormers) [![Docs](https://img.shields.io/badge/Docs-EoMT-blue)](https://imvision12.github.io/KerasFormers/eomt/) [![Collection](https://img.shields.io/badge/HF-EoMT%20collection-yellow)](https://huggingface.co/collections/kerasformers/eomt-6a6a8e0309f2602fa0b94bb8)
23
+
24
+ # kerasformers/eomt_large_coco_instance_640
25
+
26
+ Paper: [Your ViT is Secretly an Image Segmentation Model (arXiv:2503.19108)](https://arxiv.org/abs/2503.19108) · [HF Papers](https://huggingface.co/papers/2503.19108)
27
+
28
+ EoMT (Encoder-only Mask Transformer) keeps segmentation inside a plain ViT: learned query tokens are concatenated with patch tokens and run through the same ViT blocks. No pixel decoder, no deformable attention decoder.\n
29
+ For more details on the model, please go to the upstream [model card](https://huggingface.co/tue-mps/coco_instance_eomt_large_640).
30
+
31
+ Pure-**Keras 3** conversion of [`tue-mps/coco_instance_eomt_large_640`](https://huggingface.co/tue-mps/coco_instance_eomt_large_640) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
32
+
33
+ This is a **instance** checkpoint (`EoMTUniversalSegment`).
34
 
35
+ ## Quick start
36
 
37
  ```python
38
+ 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)
49
+ result = processor.post_process_instance_segmentation(
50
+ output, target_size=(image.height, image.width)
51
+ )
52
+ print(result.keys())
53
  ```
54
+
55
+ Load any EoMT variant the same way with `from_weights("kerasformers/<variant>")`:
56
+
57
+ | Variant | Hub | Task |
58
+ |---|---|---|
59
+ | `eomt_small_coco_panoptic_640` | [`kerasformers/eomt_small_coco_panoptic_640`](https://huggingface.co/kerasformers/eomt_small_coco_panoptic_640) | panoptic |
60
+ | `eomt_base_coco_panoptic_640` | [`kerasformers/eomt_base_coco_panoptic_640`](https://huggingface.co/kerasformers/eomt_base_coco_panoptic_640) | panoptic |
61
+ | `eomt_large_coco_panoptic_640` | [`kerasformers/eomt_large_coco_panoptic_640`](https://huggingface.co/kerasformers/eomt_large_coco_panoptic_640) | panoptic |
62
+ | `eomt_large_coco_instance_640` | [`kerasformers/eomt_large_coco_instance_640`](https://huggingface.co/kerasformers/eomt_large_coco_instance_640) | instance |
63
+ | `eomt_large_ade20k_semantic_512` | [`kerasformers/eomt_large_ade20k_semantic_512`](https://huggingface.co/kerasformers/eomt_large_ade20k_semantic_512) | semantic |
64
+
65
+ ## Tips
66
+
67
+ - Set `KERAS_BACKEND` **before** importing Keras / kerasformers.
68
+ - Use the post-processor that matches the checkpoint task (panoptic / instance / semantic).
69
+ - See [EoMT docs]({DOCS_URL}) and [Loading Weights](https://imvision12.github.io/KerasFormers/loading_weights/).
70
+ - Community / upstream weights: `EoMTUniversalSegment.from_weights("hf:tue-mps/coco_instance_eomt_large_640")`.
71
+
72
+ ## Special Thanks
73
+
74
+ A huge thank you to the TU/e MPS EoMT authors for creating and releasing these models.
75
+
76
+ License: MIT.