Instructions to use zeromodels/dfine-medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasFormers
How to use zeromodels/dfine-medium with KerasFormers:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Keras
How to use zeromodels/dfine-medium with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://zeromodels/dfine-medium") - Notebooks
- Google Colab
- Kaggle
Upgrade kf_config.json to v2 (nested config + dtype)
Browse files- kf_config.json +70 -66
kf_config.json
CHANGED
|
@@ -1,74 +1,78 @@
|
|
| 1 |
{
|
| 2 |
"library_name": "kerasformers",
|
| 3 |
-
"kerasformers_version": "1.
|
| 4 |
"model_module": "kerasformers.models.dfine",
|
| 5 |
"model_class": "DFineDetect",
|
| 6 |
"variant": "dfine-medium",
|
| 7 |
"weights": "model.weights.h5",
|
|
|
|
|
|
|
| 8 |
"model_type": "d_fine",
|
| 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 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
| 74 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"library_name": "kerasformers",
|
| 3 |
+
"kerasformers_version": "1.2.1",
|
| 4 |
"model_module": "kerasformers.models.dfine",
|
| 5 |
"model_class": "DFineDetect",
|
| 6 |
"variant": "dfine-medium",
|
| 7 |
"weights": "model.weights.h5",
|
| 8 |
+
"schema_version": 2,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
"model_type": "d_fine",
|
| 11 |
+
"vision_config": {
|
| 12 |
+
"stem_channels": [
|
| 13 |
+
3,
|
| 14 |
+
24,
|
| 15 |
+
32
|
| 16 |
+
],
|
| 17 |
+
"stage_in_channels": [
|
| 18 |
+
32,
|
| 19 |
+
96,
|
| 20 |
+
384,
|
| 21 |
+
768
|
| 22 |
+
],
|
| 23 |
+
"stage_mid_channels": [
|
| 24 |
+
32,
|
| 25 |
+
64,
|
| 26 |
+
128,
|
| 27 |
+
256
|
| 28 |
+
],
|
| 29 |
+
"stage_out_channels": [
|
| 30 |
+
96,
|
| 31 |
+
384,
|
| 32 |
+
768,
|
| 33 |
+
1536
|
| 34 |
+
],
|
| 35 |
+
"stage_num_blocks": [
|
| 36 |
+
1,
|
| 37 |
+
1,
|
| 38 |
+
3,
|
| 39 |
+
1
|
| 40 |
+
],
|
| 41 |
+
"stage_numb_of_layers": [
|
| 42 |
+
4,
|
| 43 |
+
4,
|
| 44 |
+
4,
|
| 45 |
+
4
|
| 46 |
+
],
|
| 47 |
+
"use_lab": true,
|
| 48 |
+
"encoder_in_channels": [
|
| 49 |
+
384,
|
| 50 |
+
768,
|
| 51 |
+
1536
|
| 52 |
+
],
|
| 53 |
+
"encoder_hidden_dim": 256,
|
| 54 |
+
"encoder_ffn_dim": 1024,
|
| 55 |
+
"encode_proj_layers": [
|
| 56 |
+
2
|
| 57 |
+
],
|
| 58 |
+
"hidden_expansion": 1.0,
|
| 59 |
+
"ccfm_num_blocks": 2,
|
| 60 |
+
"hidden_dim": 256,
|
| 61 |
+
"decoder_num_layers": 4,
|
| 62 |
+
"decoder_ffn_dim": 1024,
|
| 63 |
+
"decoder_n_points": [
|
| 64 |
+
3,
|
| 65 |
+
6,
|
| 66 |
+
3
|
| 67 |
+
],
|
| 68 |
+
"num_feature_levels": 3,
|
| 69 |
+
"feat_strides": [
|
| 70 |
+
8,
|
| 71 |
+
16,
|
| 72 |
+
32
|
| 73 |
+
],
|
| 74 |
+
"num_classes": 80,
|
| 75 |
+
"num_queries": 300,
|
| 76 |
+
"image_size": 640
|
| 77 |
+
}
|
| 78 |
}
|