Instructions to use zeromodels/tipsv2-so400m14 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use zeromodels/tipsv2-so400m14 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/tipsv2-so400m14") - Notebooks
- Google Colab
- Kaggle
Migrate to zeromodels (rename kf_*.json -> zm_*.json, fix refs in config + README, ensure tag + badge)
Browse files- README.md +18 -18
- kf_config.json → zm_config.json +3 -3
- kf_preprocessor.json → zm_preprocessor.json +3 -3
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:
|
| 6 |
tags:
|
| 7 |
- keras
|
| 8 |
-
-
|
| 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/
|
| 19 |
|
| 20 |
# Run TIPSv2 with Keras 3: JAX, PyTorch, or TensorFlow
|
| 21 |
|
| 22 |
-
[](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 [
|
| 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
|
| 44 |
|
| 45 |
-
model = Tipsv2Model.from_weights("
|
| 46 |
-
processor = Tipsv2Processor.from_weights("
|
| 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
|
| 60 |
-
vision = Tipsv2VisionModel.from_weights("
|
| 61 |
-
text = Tipsv2TextModel.from_weights("
|
| 62 |
```
|
| 63 |
|
| 64 |
-
All TIPSv2 variants load the same way with `from_weights("
|
| 65 |
|
| 66 |
| Variant | Hub |
|
| 67 |
|---|---|
|
| 68 |
-
| `tipsv2-b14` | [`
|
| 69 |
-
| `tipsv2-l14` | [`
|
| 70 |
-
| `tipsv2-so400m14` | [`
|
| 71 |
-
| `tipsv2-g14` | [`
|
| 72 |
|
| 73 |
## Tips
|
| 74 |
|
| 75 |
-
- Set `KERAS_BACKEND` **before** importing Keras /
|
| 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 |
+
[](https://github.com/IMvision12/ZeroModels) [](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": "
|
| 3 |
-
"
|
| 4 |
-
"model_module": "
|
| 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": "
|
| 3 |
-
"
|
| 4 |
-
"preprocessor_module": "
|
| 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,
|