Instructions to use keras/siglip_so400m_patch14_224 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/siglip_so400m_patch14_224 with KerasHub:
import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://keras/siglip_so400m_patch14_224") - Keras
How to use keras/siglip_so400m_patch14_224 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/siglip_so400m_patch14_224") - Notebooks
- Google Colab
- Kaggle
File size: 1,711 Bytes
f32a3e2 | 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 37 38 39 40 41 42 43 44 45 46 47 48 | {
"module": "keras_hub.src.models.siglip.siglip_backbone",
"class_name": "SigLIPBackbone",
"config": {
"name": "sig_lip_backbone",
"trainable": true,
"vision_encoder": {
"module": "keras_hub.src.models.siglip.siglip_vision_encoder",
"class_name": "SigLIPVisionEncoder",
"config": {
"name": "sig_lip_vision_encoder",
"trainable": true,
"patch_size": 14,
"hidden_dim": 1152,
"num_layers": 27,
"num_heads": 16,
"intermediate_dim": 4304,
"intermediate_activation": "gelu_approximate",
"layer_norm_epsilon": 1e-06,
"image_shape": [
224,
224,
3
]
},
"registered_name": "keras_hub>SigLIPVisionEncoder"
},
"text_encoder": {
"module": "keras_hub.src.models.siglip.siglip_text_encoder",
"class_name": "SigLIPTextEncoder",
"config": {
"name": "sig_lip_text_encoder",
"trainable": true,
"vocabulary_size": 32000,
"embedding_dim": 1152,
"hidden_dim": 1152,
"num_layers": 27,
"num_heads": 16,
"intermediate_dim": 4304,
"intermediate_activation": "gelu_approximate",
"layer_norm_epsilon": 1e-06,
"max_sequence_length": 16
},
"registered_name": "keras_hub>SigLIPTextEncoder"
}
},
"registered_name": "keras_hub>SigLIPBackbone"
} |