Instructions to use keras/depth_anything_v2_small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/depth_anything_v2_small with KerasHub:
import keras_hub # Create a DepthEstimator model task = keras_hub.models.DepthEstimator.from_preset("hf://keras/depth_anything_v2_small")import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://keras/depth_anything_v2_small") - Keras
How to use keras/depth_anything_v2_small 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://keras/depth_anything_v2_small") - Notebooks
- Google Colab
- Kaggle
Download image_converter.json from keras/depth_anything_v2_small: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/keras/depth_anything_v2_small/resolve/main/image_converter.json
- Command line
-
hf download hf://keras/depth_anything_v2_small/image_converter.json
-
curl -L -o image_converter.json https://huggingface.co/keras/depth_anything_v2_small/resolve/main/image_converter.json
1.02 kB
| { | |
| "module": "keras_hub.src.models.depth_anything.depth_anything_image_converter", | |
| "class_name": "DepthAnythingImageConverter", | |
| "config": { | |
| "name": "depth_anything_image_converter", | |
| "trainable": true, | |
| "dtype": { | |
| "module": "keras", | |
| "class_name": "DTypePolicy", | |
| "config": { | |
| "name": "float32" | |
| }, | |
| "registered_name": null | |
| }, | |
| "image_size": [ | |
| 518, | |
| 518 | |
| ], | |
| "scale": [ | |
| 0.017124753831663668, | |
| 0.01750700280112045, | |
| 0.017429193899782133 | |
| ], | |
| "offset": [ | |
| -2.1179039301310043, | |
| -2.0357142857142856, | |
| -1.8044444444444445 | |
| ], | |
| "interpolation": "bicubic", | |
| "antialias": false, | |
| "crop_to_aspect_ratio": true, | |
| "pad_to_aspect_ratio": false, | |
| "bounding_box_format": "yxyx" | |
| }, | |
| "registered_name": "keras_hub>DepthAnythingImageConverter" | |
| } |