IMvision12 commited on
Commit
fcfc45b
·
verified ·
1 Parent(s): b67f608

Migrate to zeromodels (rename kf_*.json -> zm_*.json, fix refs in config + README, ensure tag + badge)

Browse files
README.md CHANGED
@@ -2,10 +2,10 @@
2
  pipeline_tag: zero-shot-image-classification
3
  license: apache-2.0
4
  base_model: google/tipsv2-so400m14
5
- library_name: kerasformers
6
  tags:
7
  - keras
8
- - kerasformers
9
  - tipsv2
10
  - zero-shot-image-classification
11
  - vision
@@ -15,13 +15,13 @@ tags:
15
  - tf
16
  ---
17
 
18
- ## ***See [our collection](https://huggingface.co/collections/kerasformers/tipsv2-6a8a3f36af77204954a49fb4) for all versions of TIPSv2.***
19
 
20
  # Run TIPSv2 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) [![Collection](https://img.shields.io/badge/HF-TIPSv2%20collection-yellow)](https://huggingface.co/collections/kerasformers/tipsv2-6a8a3f36af77204954a49fb4)
23
 
24
- # kerasformers/tipsv2-so400m14
25
 
26
  Paper: [TIPSv2: Advancing Vision-Language Pretraining with Enhanced Patch-Text Alignment (arXiv:2604.12012)](https://huggingface.co/papers/2604.12012)
27
 
@@ -29,7 +29,7 @@ TIPSv2 (Google DeepMind) is a CLIP/SigLIP-style dual encoder: a DINOv2-style ViT
29
 
30
  For more details on the model, please go to the upstream [model card](https://huggingface.co/google/tipsv2-so400m14).
31
 
32
- Pure-**Keras 3** conversion of [`google/tipsv2-so400m14`](https://huggingface.co/google/tipsv2-so400m14) for [kerasformers](https://github.com/IMvision12/KerasFormers). One implementation runs unmodified on **TensorFlow / Torch / JAX**. The full model and both towers load from this single repo.
33
 
34
  ## ✨ Quick start (zero-shot)
35
 
@@ -40,10 +40,10 @@ os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
40
  from PIL import Image
41
  import numpy as np
42
  import keras
43
- from kerasformers.models.tipsv2 import Tipsv2Model, Tipsv2Processor
44
 
45
- model = Tipsv2Model.from_weights("kerasformers/tipsv2-so400m14")
46
- processor = Tipsv2Processor.from_weights("kerasformers/tipsv2-so400m14")
47
 
48
  image = Image.open("your_image.jpg").convert("RGB")
49
  texts = ["a photo of a cat", "a photo of a dog", "a photo of a car"]
@@ -56,23 +56,23 @@ print(keras.ops.convert_to_numpy(probs)[0])
56
  Towers only:
57
 
58
  ```python
59
- from kerasformers.models.tipsv2 import Tipsv2VisionModel, Tipsv2TextModel
60
- vision = Tipsv2VisionModel.from_weights("kerasformers/tipsv2-so400m14")
61
- text = Tipsv2TextModel.from_weights("kerasformers/tipsv2-so400m14")
62
  ```
63
 
64
- All TIPSv2 variants load the same way with `from_weights("kerasformers/<variant>")`:
65
 
66
  | Variant | Hub |
67
  |---|---|
68
- | `tipsv2-b14` | [`kerasformers/tipsv2-b14`](https://huggingface.co/kerasformers/tipsv2-b14) |
69
- | `tipsv2-l14` | [`kerasformers/tipsv2-l14`](https://huggingface.co/kerasformers/tipsv2-l14) |
70
- | `tipsv2-so400m14` | [`kerasformers/tipsv2-so400m14`](https://huggingface.co/kerasformers/tipsv2-so400m14) |
71
- | `tipsv2-g14` | [`kerasformers/tipsv2-g14`](https://huggingface.co/kerasformers/tipsv2-g14) |
72
 
73
  ## Tips
74
 
75
- - Set `KERAS_BACKEND` **before** importing Keras / kerasformers.
76
  - The image processor rescales to `[0, 1]` (no mean/std normalization); input resolution is 448.
77
  - Upstream checkpoints: `Tipsv2Model.from_weights("hf:google/tipsv2-so400m14")`.
78
 
 
2
  pipeline_tag: zero-shot-image-classification
3
  license: apache-2.0
4
  base_model: google/tipsv2-so400m14
5
+ library_name: zeromodels
6
  tags:
7
  - keras
8
+ - zeromodels
9
  - tipsv2
10
  - zero-shot-image-classification
11
  - vision
 
15
  - tf
16
  ---
17
 
18
+ ## ***See [our collection](https://huggingface.co/collections/zeromodels/tipsv2-6a8a3f36af77204954a49fb4) for all versions of TIPSv2.***
19
 
20
  # Run TIPSv2 with Keras 3: JAX, PyTorch, or TensorFlow
21
 
22
+ [![GitHub](https://img.shields.io/badge/GitHub-ZeroModels-black?logo=github)](https://github.com/IMvision12/ZeroModels) [![Collection](https://img.shields.io/badge/HF-TIPSv2%20collection-yellow)](https://huggingface.co/collections/zeromodels/tipsv2-6a8a3f36af77204954a49fb4)
23
 
24
+ # zeromodels/tipsv2-so400m14
25
 
26
  Paper: [TIPSv2: Advancing Vision-Language Pretraining with Enhanced Patch-Text Alignment (arXiv:2604.12012)](https://huggingface.co/papers/2604.12012)
27
 
 
29
 
30
  For more details on the model, please go to the upstream [model card](https://huggingface.co/google/tipsv2-so400m14).
31
 
32
+ Pure-**Keras 3** conversion of [`google/tipsv2-so400m14`](https://huggingface.co/google/tipsv2-so400m14) for [zeromodels](https://github.com/IMvision12/ZeroModels). One implementation runs unmodified on **TensorFlow / Torch / JAX**. The full model and both towers load from this single repo.
33
 
34
  ## ✨ Quick start (zero-shot)
35
 
 
40
  from PIL import Image
41
  import numpy as np
42
  import keras
43
+ from zeromodels.models.tipsv2 import Tipsv2Model, Tipsv2Processor
44
 
45
+ model = Tipsv2Model.from_weights("zeromodels/tipsv2-so400m14")
46
+ processor = Tipsv2Processor.from_weights("zeromodels/tipsv2-so400m14")
47
 
48
  image = Image.open("your_image.jpg").convert("RGB")
49
  texts = ["a photo of a cat", "a photo of a dog", "a photo of a car"]
 
56
  Towers only:
57
 
58
  ```python
59
+ from zeromodels.models.tipsv2 import Tipsv2VisionModel, Tipsv2TextModel
60
+ vision = Tipsv2VisionModel.from_weights("zeromodels/tipsv2-so400m14")
61
+ text = Tipsv2TextModel.from_weights("zeromodels/tipsv2-so400m14")
62
  ```
63
 
64
+ All TIPSv2 variants load the same way with `from_weights("zeromodels/<variant>")`:
65
 
66
  | Variant | Hub |
67
  |---|---|
68
+ | `tipsv2-b14` | [`zeromodels/tipsv2-b14`](https://huggingface.co/zeromodels/tipsv2-b14) |
69
+ | `tipsv2-l14` | [`zeromodels/tipsv2-l14`](https://huggingface.co/zeromodels/tipsv2-l14) |
70
+ | `tipsv2-so400m14` | [`zeromodels/tipsv2-so400m14`](https://huggingface.co/zeromodels/tipsv2-so400m14) |
71
+ | `tipsv2-g14` | [`zeromodels/tipsv2-g14`](https://huggingface.co/zeromodels/tipsv2-g14) |
72
 
73
  ## Tips
74
 
75
+ - Set `KERAS_BACKEND` **before** importing Keras / zeromodels.
76
  - The image processor rescales to `[0, 1]` (no mean/std normalization); input resolution is 448.
77
  - Upstream checkpoints: `Tipsv2Model.from_weights("hf:google/tipsv2-so400m14")`.
78
 
kf_config.json → zm_config.json RENAMED
@@ -1,7 +1,7 @@
1
  {
2
- "library_name": "kerasformers",
3
- "kerasformers_version": "1.2.5",
4
- "model_module": "kerasformers.models.tipsv2",
5
  "model_class": "Tipsv2Model",
6
  "variant": "tipsv2-so400m14",
7
  "weights": "model.weights.h5",
 
1
  {
2
+ "library_name": "zeromodels",
3
+ "zeromodels_version": "1.2.5",
4
+ "model_module": "zeromodels.models.tipsv2",
5
  "model_class": "Tipsv2Model",
6
  "variant": "tipsv2-so400m14",
7
  "weights": "model.weights.h5",
kf_preprocessor.json → zm_preprocessor.json RENAMED
@@ -1,7 +1,7 @@
1
  {
2
- "library_name": "kerasformers",
3
- "kerasformers_version": "1.2.5",
4
- "preprocessor_module": "kerasformers.models.tipsv2",
5
  "preprocessor_class": "Tipsv2ImageProcessor",
6
  "variant": "tipsv2-so400m14",
7
  "image_resolution": 448,
 
1
  {
2
+ "library_name": "zeromodels",
3
+ "zeromodels_version": "1.2.5",
4
+ "preprocessor_module": "zeromodels.models.tipsv2",
5
  "preprocessor_class": "Tipsv2ImageProcessor",
6
  "variant": "tipsv2-so400m14",
7
  "image_resolution": 448,