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
File size: 1,015 Bytes
a3a6f49 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | {
"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"
} |