Zero-Shot Object Detection
ZeroModels
Keras
PyTorch
JAX
TensorFlow
owlvit
open-vocabulary
object-detection
Instructions to use zeromodels/owlvit-base-patch16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/owlvit-base-patch16 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/owlvit-base-patch16") - Keras
How to use zeromodels/owlvit-base-patch16 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/owlvit-base-patch16") - Notebooks
- Google Colab
- Kaggle
Upload kf_preprocessor.json with huggingface_hub
Browse files- kf_preprocessor.json +27 -0
kf_preprocessor.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"library_name": "kerasformers",
|
| 3 |
+
"kerasformers_version": "1.1.3",
|
| 4 |
+
"preprocessor_module": "kerasformers.models.owlvit",
|
| 5 |
+
"preprocessor_class": "OwlViTImageProcessor",
|
| 6 |
+
"variant": "owlvit-base-patch16",
|
| 7 |
+
"size": {
|
| 8 |
+
"height": 768,
|
| 9 |
+
"width": 768
|
| 10 |
+
},
|
| 11 |
+
"resample": "bicubic",
|
| 12 |
+
"do_rescale": true,
|
| 13 |
+
"rescale_factor": 0.00392156862745098,
|
| 14 |
+
"do_normalize": true,
|
| 15 |
+
"image_mean": [
|
| 16 |
+
0.48145466,
|
| 17 |
+
0.4578275,
|
| 18 |
+
0.40821073
|
| 19 |
+
],
|
| 20 |
+
"image_std": [
|
| 21 |
+
0.26862954,
|
| 22 |
+
0.26130258,
|
| 23 |
+
0.27577711
|
| 24 |
+
],
|
| 25 |
+
"return_tensor": true,
|
| 26 |
+
"data_format": null
|
| 27 |
+
}
|