Instructions to use zeromodels/tipsv2-g14-dpt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/tipsv2-g14-dpt with ZeroModels:
# pip install -U zeromodels # ZeroModels is pure Keras 3, so pick a backend: "jax", "torch" or "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" from zeromodels import AutoZModel # AutoZModel reads the repo's model_type and loads the matching class. # For a task head use the matching loader, e.g. AutoZMImageClassify / AutoZMDetect / # AutoZMSemanticSegment / AutoZMTextGenerate (see zeromodels.auto). model = AutoZModel.from_weights("zeromodels/tipsv2-g14-dpt") - Keras
How to use zeromodels/tipsv2-g14-dpt with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://zeromodels/tipsv2-g14-dpt") - Notebooks
- Google Colab
- Kaggle
Migrate to zeromodels (rename kf_*.json -> zm_*.json, fix refs in config + README, ensure tag + badge)
Browse files- README.md +15 -15
- 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: depth-estimation
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: google/tipsv2-g14-dpt
|
| 5 |
-
library_name:
|
| 6 |
tags:
|
| 7 |
- keras
|
| 8 |
-
-
|
| 9 |
- tipsv2
|
| 10 |
- dpt
|
| 11 |
- depth-estimation
|
|
@@ -16,13 +16,13 @@ tags:
|
|
| 16 |
- tf
|
| 17 |
---
|
| 18 |
|
| 19 |
-
## ***See [our collection](https://huggingface.co/collections/
|
| 20 |
|
| 21 |
# Run TIPSv2-DPT with Keras 3: JAX, PyTorch, or TensorFlow
|
| 22 |
|
| 23 |
-
[](https://huggingface.co/papers/2604.12012)
|
| 28 |
|
|
@@ -30,7 +30,7 @@ TIPSv2-DPT stacks DPT (Dense Prediction Transformer) heads on the TIPSv2 vision
|
|
| 30 |
|
| 31 |
For more details on the model, please go to the upstream [model card](https://huggingface.co/google/tipsv2-g14-dpt).
|
| 32 |
|
| 33 |
-
Pure-**Keras 3** conversion of [`google/tipsv2-g14-dpt`](https://huggingface.co/google/tipsv2-g14-dpt) for [
|
| 34 |
|
| 35 |
## ✨ Quick start
|
| 36 |
|
|
@@ -41,7 +41,7 @@ os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
|
|
| 41 |
from PIL import Image
|
| 42 |
import numpy as np
|
| 43 |
import keras
|
| 44 |
-
from
|
| 45 |
Tipsv2DptDensePredict, # depth + segmentation
|
| 46 |
Tipsv2DptDepthEstimation, # depth only
|
| 47 |
Tipsv2DptSemanticSegment, # segmentation only
|
|
@@ -49,7 +49,7 @@ from kerasformers.models.tipsv2_dpt import (
|
|
| 49 |
)
|
| 50 |
|
| 51 |
# all three load from the SAME repo
|
| 52 |
-
model = Tipsv2DptDensePredict.from_weights("
|
| 53 |
proc = Tipsv2DptImageProcessor(image_resolution=448)
|
| 54 |
|
| 55 |
image = Image.open("your_image.jpg").convert("RGB")
|
|
@@ -59,22 +59,22 @@ depth = keras.ops.convert_to_numpy(out["predicted_depth"]) # (1, H', W'
|
|
| 59 |
seg = keras.ops.convert_to_numpy(out["segmentation_logits"]) # (1, H', W', num_labels)
|
| 60 |
|
| 61 |
# single-task variants (same weights, one output each)
|
| 62 |
-
depth_model = Tipsv2DptDepthEstimation.from_weights("
|
| 63 |
-
seg_model = Tipsv2DptSemanticSegment.from_weights("
|
| 64 |
```
|
| 65 |
|
| 66 |
Variants:
|
| 67 |
|
| 68 |
| Variant | Hub |
|
| 69 |
|---|---|
|
| 70 |
-
| `tipsv2-b14-dpt` | [`
|
| 71 |
-
| `tipsv2-l14-dpt` | [`
|
| 72 |
-
| `tipsv2-so400m14-dpt` | [`
|
| 73 |
-
| `tipsv2-g14-dpt` | [`
|
| 74 |
|
| 75 |
## Tips
|
| 76 |
|
| 77 |
-
- Set `KERAS_BACKEND` **before** importing Keras /
|
| 78 |
- The image processor rescales to `[0, 1]` (no mean/std normalization); input resolution is 448.
|
| 79 |
- Outputs are at the DPT feature resolution; resize to the input size for visualization.
|
| 80 |
- Upstream checkpoint: `Tipsv2DptDensePredict.from_weights("hf:google/tipsv2-g14-dpt")`.
|
|
|
|
| 2 |
pipeline_tag: depth-estimation
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: google/tipsv2-g14-dpt
|
| 5 |
+
library_name: zeromodels
|
| 6 |
tags:
|
| 7 |
- keras
|
| 8 |
+
- zeromodels
|
| 9 |
- tipsv2
|
| 10 |
- dpt
|
| 11 |
- depth-estimation
|
|
|
|
| 16 |
- tf
|
| 17 |
---
|
| 18 |
|
| 19 |
+
## ***See [our collection](https://huggingface.co/collections/zeromodels/tipsv2-dpt-6a8a3f36cd22fe9f68df6202) for all versions of TIPSv2-DPT.***
|
| 20 |
|
| 21 |
# Run TIPSv2-DPT with Keras 3: JAX, PyTorch, or TensorFlow
|
| 22 |
|
| 23 |
+
[](https://github.com/IMvision12/ZeroModels) [](https://huggingface.co/collections/zeromodels/tipsv2-dpt-6a8a3f36cd22fe9f68df6202)
|
| 24 |
|
| 25 |
+
# zeromodels/tipsv2-g14-dpt
|
| 26 |
|
| 27 |
Paper: [TIPSv2 (arXiv:2604.12012)](https://huggingface.co/papers/2604.12012)
|
| 28 |
|
|
|
|
| 30 |
|
| 31 |
For more details on the model, please go to the upstream [model card](https://huggingface.co/google/tipsv2-g14-dpt).
|
| 32 |
|
| 33 |
+
Pure-**Keras 3** conversion of [`google/tipsv2-g14-dpt`](https://huggingface.co/google/tipsv2-g14-dpt) for [zeromodels](https://github.com/IMvision12/ZeroModels). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
|
| 34 |
|
| 35 |
## ✨ Quick start
|
| 36 |
|
|
|
|
| 41 |
from PIL import Image
|
| 42 |
import numpy as np
|
| 43 |
import keras
|
| 44 |
+
from zeromodels.models.tipsv2_dpt import (
|
| 45 |
Tipsv2DptDensePredict, # depth + segmentation
|
| 46 |
Tipsv2DptDepthEstimation, # depth only
|
| 47 |
Tipsv2DptSemanticSegment, # segmentation only
|
|
|
|
| 49 |
)
|
| 50 |
|
| 51 |
# all three load from the SAME repo
|
| 52 |
+
model = Tipsv2DptDensePredict.from_weights("zeromodels/tipsv2-g14-dpt")
|
| 53 |
proc = Tipsv2DptImageProcessor(image_resolution=448)
|
| 54 |
|
| 55 |
image = Image.open("your_image.jpg").convert("RGB")
|
|
|
|
| 59 |
seg = keras.ops.convert_to_numpy(out["segmentation_logits"]) # (1, H', W', num_labels)
|
| 60 |
|
| 61 |
# single-task variants (same weights, one output each)
|
| 62 |
+
depth_model = Tipsv2DptDepthEstimation.from_weights("zeromodels/tipsv2-g14-dpt")
|
| 63 |
+
seg_model = Tipsv2DptSemanticSegment.from_weights("zeromodels/tipsv2-g14-dpt")
|
| 64 |
```
|
| 65 |
|
| 66 |
Variants:
|
| 67 |
|
| 68 |
| Variant | Hub |
|
| 69 |
|---|---|
|
| 70 |
+
| `tipsv2-b14-dpt` | [`zeromodels/tipsv2-b14-dpt`](https://huggingface.co/zeromodels/tipsv2-b14-dpt) |
|
| 71 |
+
| `tipsv2-l14-dpt` | [`zeromodels/tipsv2-l14-dpt`](https://huggingface.co/zeromodels/tipsv2-l14-dpt) |
|
| 72 |
+
| `tipsv2-so400m14-dpt` | [`zeromodels/tipsv2-so400m14-dpt`](https://huggingface.co/zeromodels/tipsv2-so400m14-dpt) |
|
| 73 |
+
| `tipsv2-g14-dpt` | [`zeromodels/tipsv2-g14-dpt`](https://huggingface.co/zeromodels/tipsv2-g14-dpt) |
|
| 74 |
|
| 75 |
## Tips
|
| 76 |
|
| 77 |
+
- Set `KERAS_BACKEND` **before** importing Keras / zeromodels.
|
| 78 |
- The image processor rescales to `[0, 1]` (no mean/std normalization); input resolution is 448.
|
| 79 |
- Outputs are at the DPT feature resolution; resize to the input size for visualization.
|
| 80 |
- Upstream checkpoint: `Tipsv2DptDensePredict.from_weights("hf:google/tipsv2-g14-dpt")`.
|
kf_config.json → zm_config.json
RENAMED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
-
"library_name": "
|
| 3 |
-
"
|
| 4 |
-
"model_module": "
|
| 5 |
"model_class": "Tipsv2DptDensePredict",
|
| 6 |
"variant": "tipsv2-g14-dpt",
|
| 7 |
"weights": "model.weights.h5",
|
|
|
|
| 1 |
{
|
| 2 |
+
"library_name": "zeromodels",
|
| 3 |
+
"zeromodels_version": "1.2.5",
|
| 4 |
+
"model_module": "zeromodels.models.tipsv2_dpt",
|
| 5 |
"model_class": "Tipsv2DptDensePredict",
|
| 6 |
"variant": "tipsv2-g14-dpt",
|
| 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": "Tipsv2DptImageProcessor",
|
| 6 |
"variant": "tipsv2-g14-dpt",
|
| 7 |
"image_resolution": 448,
|
|
|
|
| 1 |
{
|
| 2 |
+
"library_name": "zeromodels",
|
| 3 |
+
"zeromodels_version": "1.2.5",
|
| 4 |
+
"preprocessor_module": "zeromodels.models.tipsv2_dpt",
|
| 5 |
"preprocessor_class": "Tipsv2DptImageProcessor",
|
| 6 |
"variant": "tipsv2-g14-dpt",
|
| 7 |
"image_resolution": 448,
|