Instructions to use zeromodels/rfdetr-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/rfdetr-small 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/rfdetr-small") - Keras
How to use zeromodels/rfdetr-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://zeromodels/rfdetr-small") - Notebooks
- Google Colab
- Kaggle
Upload kf_config.json with huggingface_hub
Browse files- kf_config.json +30 -13
kf_config.json
CHANGED
|
@@ -5,17 +5,34 @@
|
|
| 5 |
"model_class": "RFDETRDetect",
|
| 6 |
"variant": "rfdetr-small",
|
| 7 |
"weights": "model.weights.h5",
|
| 8 |
-
"
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
}
|
|
|
|
| 5 |
"model_class": "RFDETRDetect",
|
| 6 |
"variant": "rfdetr-small",
|
| 7 |
"weights": "model.weights.h5",
|
| 8 |
+
"model_type": "rf_detr",
|
| 9 |
+
"hidden_dim": 256,
|
| 10 |
+
"backbone_hidden_size": 384,
|
| 11 |
+
"backbone_num_heads": 6,
|
| 12 |
+
"backbone_num_layers": 12,
|
| 13 |
+
"backbone_mlp_ratio": 4,
|
| 14 |
+
"backbone_use_swiglu": false,
|
| 15 |
+
"num_register_tokens": 0,
|
| 16 |
+
"out_feature_indexes": [
|
| 17 |
+
3,
|
| 18 |
+
6,
|
| 19 |
+
9,
|
| 20 |
+
12
|
| 21 |
+
],
|
| 22 |
+
"patch_size": 16,
|
| 23 |
+
"num_windows": 2,
|
| 24 |
+
"positional_encoding_size": 32,
|
| 25 |
+
"resolution": 512,
|
| 26 |
+
"dec_layers": 3,
|
| 27 |
+
"sa_nheads": 8,
|
| 28 |
+
"ca_nheads": 16,
|
| 29 |
+
"dec_n_points": 2,
|
| 30 |
+
"num_queries": 300,
|
| 31 |
+
"num_classes": 91,
|
| 32 |
+
"two_stage": true,
|
| 33 |
+
"bbox_reparam": true,
|
| 34 |
+
"lite_refpoint_refine": true,
|
| 35 |
+
"group_detr": 13,
|
| 36 |
+
"dim_feedforward": 2048,
|
| 37 |
+
"image_size": null
|
| 38 |
}
|