Instructions to use zeromodels/convnext_large_fb_in22k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use zeromodels/convnext_large_fb_in22k 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/convnext_large_fb_in22k") - Notebooks
- Google Colab
- Kaggle
Migrate to zeromodels (rename kf_*.json -> zm_*.json, fix refs in config + README, ensure tag + badge)
Browse files- README.md +36 -36
- kf_config.json → zm_config.json +26 -26
README.md
CHANGED
|
@@ -2,10 +2,10 @@
|
|
| 2 |
pipeline_tag: image-classification
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: timm/convnext_large.fb_in22k
|
| 5 |
-
library_name:
|
| 6 |
tags:
|
| 7 |
- keras
|
| 8 |
-
-
|
| 9 |
- image-classification
|
| 10 |
- convnext
|
| 11 |
- backbone
|
|
@@ -15,13 +15,13 @@ tags:
|
|
| 15 |
- tf
|
| 16 |
---
|
| 17 |
|
| 18 |
-
## ***See [our collection](https://huggingface.co/collections/
|
| 19 |
|
| 20 |
# Run ConvNeXt with Keras 3: JAX, PyTorch, or TensorFlow
|
| 21 |
|
| 22 |
-
[](https://arxiv.org/abs/2201.03545) · [HF Papers](https://huggingface.co/papers/2201.03545)
|
| 27 |
|
|
@@ -29,7 +29,7 @@ ConvNeXt modernizes a ResNet-style CNN with ViT-inspired design choices. Use as
|
|
| 29 |
|
| 30 |
For more details on the model, please go to the upstream [model card](https://huggingface.co/timm/convnext_large.fb_in22k).
|
| 31 |
|
| 32 |
-
Pure-**Keras 3** conversion of [`timm/convnext_large.fb_in22k`](https://huggingface.co/timm/convnext_large.fb_in22k) for [
|
| 33 |
|
| 34 |
This is an **image-classification / backbone** checkpoint (`ConvNeXtImageClassify` / `ConvNeXtModel`).
|
| 35 |
|
|
@@ -41,11 +41,11 @@ os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
|
|
| 41 |
|
| 42 |
from PIL import Image
|
| 43 |
import numpy as np
|
| 44 |
-
from
|
| 45 |
|
| 46 |
-
model = ConvNeXtImageClassify.from_weights("
|
| 47 |
backbone = ConvNeXtModel.from_weights(
|
| 48 |
-
"
|
| 49 |
)
|
| 50 |
|
| 51 |
image = Image.open("your_image.jpg").convert("RGB")
|
|
@@ -56,40 +56,40 @@ feats = backbone(x)
|
|
| 56 |
print(len(feats), [tuple(f.shape) for f in feats])
|
| 57 |
```
|
| 58 |
|
| 59 |
-
Load any ConvNeXt variant the same way with `from_weights("
|
| 60 |
|
| 61 |
| Variant | Hub |
|
| 62 |
|---|---|
|
| 63 |
-
| `convnext_atto_d2_in1k` | [`
|
| 64 |
-
| `convnext_base_fb_in1k` | [`
|
| 65 |
-
| `convnext_base_fb_in22k` | [`
|
| 66 |
-
| `convnext_base_fb_in22k_ft_in1k` | [`
|
| 67 |
-
| `convnext_base_fb_in22k_ft_in1k_384` | [`
|
| 68 |
-
| `convnext_femto_d1_in1k` | [`
|
| 69 |
-
| `convnext_large_fb_in1k` | [`
|
| 70 |
-
| `convnext_large_fb_in22k` | [`
|
| 71 |
-
| `convnext_large_fb_in22k_ft_in1k` | [`
|
| 72 |
-
| `convnext_large_fb_in22k_ft_in1k_384` | [`
|
| 73 |
-
| `convnext_nano_d1h_in1k` | [`
|
| 74 |
-
| `convnext_nano_in12k_ft_in1k` | [`
|
| 75 |
-
| `convnext_pico_d1_in1k` | [`
|
| 76 |
-
| `convnext_small_fb_in1k` | [`
|
| 77 |
-
| `convnext_small_fb_in22k` | [`
|
| 78 |
-
| `convnext_small_fb_in22k_ft_in1k` | [`
|
| 79 |
-
| `convnext_small_fb_in22k_ft_in1k_384` | [`
|
| 80 |
-
| `convnext_tiny_fb_in1k` | [`
|
| 81 |
-
| `convnext_tiny_fb_in22k` | [`
|
| 82 |
-
| `convnext_tiny_fb_in22k_ft_in1k` | [`
|
| 83 |
-
| `convnext_tiny_fb_in22k_ft_in1k_384` | [`
|
| 84 |
-
| `convnext_xlarge_fb_in22k` | [`
|
| 85 |
-
| `convnext_xlarge_fb_in22k_ft_in1k` | [`
|
| 86 |
-
| `convnext_xlarge_fb_in22k_ft_in1k_384` | [`
|
| 87 |
|
| 88 |
## Tips
|
| 89 |
|
| 90 |
-
- Set `KERAS_BACKEND` **before** importing Keras /
|
| 91 |
- `ConvNeXtImageClassify` returns class logits; `ConvNeXtModel` returns features (`as_backbone=True` for multi-scale stages).
|
| 92 |
-
- See [docs](https://imvision12.github.io/
|
| 93 |
- Upstream / timm checkpoints: `ConvNeXtImageClassify.from_weights("hf:timm/convnext_large.fb_in22k")`.
|
| 94 |
|
| 95 |
## Special Thanks
|
|
|
|
| 2 |
pipeline_tag: image-classification
|
| 3 |
license: apache-2.0
|
| 4 |
base_model: timm/convnext_large.fb_in22k
|
| 5 |
+
library_name: zeromodels
|
| 6 |
tags:
|
| 7 |
- keras
|
| 8 |
+
- zeromodels
|
| 9 |
- image-classification
|
| 10 |
- convnext
|
| 11 |
- backbone
|
|
|
|
| 15 |
- tf
|
| 16 |
---
|
| 17 |
|
| 18 |
+
## ***See [our collection](https://huggingface.co/collections/zeromodels/convnext-6a6bd0f2a94679977d564d48) for all versions of ConvNeXt.***
|
| 19 |
|
| 20 |
# Run ConvNeXt with Keras 3: JAX, PyTorch, or TensorFlow
|
| 21 |
|
| 22 |
+
[](https://github.com/IMvision12/ZeroModels) [](https://imvision12.github.io/ZeroModels/classification_backbones/) [](https://huggingface.co/collections/zeromodels/convnext-6a6bd0f2a94679977d564d48)
|
| 23 |
|
| 24 |
+
# zeromodels/convnext_large_fb_in22k
|
| 25 |
|
| 26 |
Paper: [A ConvNet for the 2020s (arXiv:2201.03545)](https://arxiv.org/abs/2201.03545) · [HF Papers](https://huggingface.co/papers/2201.03545)
|
| 27 |
|
|
|
|
| 29 |
|
| 30 |
For more details on the model, please go to the upstream [model card](https://huggingface.co/timm/convnext_large.fb_in22k).
|
| 31 |
|
| 32 |
+
Pure-**Keras 3** conversion of [`timm/convnext_large.fb_in22k`](https://huggingface.co/timm/convnext_large.fb_in22k) for [zeromodels](https://github.com/IMvision12/ZeroModels). One implementation runs unmodified on **TensorFlow / Torch / JAX**.
|
| 33 |
|
| 34 |
This is an **image-classification / backbone** checkpoint (`ConvNeXtImageClassify` / `ConvNeXtModel`).
|
| 35 |
|
|
|
|
| 41 |
|
| 42 |
from PIL import Image
|
| 43 |
import numpy as np
|
| 44 |
+
from zeromodels.models.convnext import ConvNeXtImageClassify, ConvNeXtModel
|
| 45 |
|
| 46 |
+
model = ConvNeXtImageClassify.from_weights("zeromodels/convnext_large_fb_in22k")
|
| 47 |
backbone = ConvNeXtModel.from_weights(
|
| 48 |
+
"zeromodels/convnext_large_fb_in22k", as_backbone=True
|
| 49 |
)
|
| 50 |
|
| 51 |
image = Image.open("your_image.jpg").convert("RGB")
|
|
|
|
| 56 |
print(len(feats), [tuple(f.shape) for f in feats])
|
| 57 |
```
|
| 58 |
|
| 59 |
+
Load any ConvNeXt variant the same way with `from_weights("zeromodels/<variant>")`:
|
| 60 |
|
| 61 |
| Variant | Hub |
|
| 62 |
|---|---|
|
| 63 |
+
| `convnext_atto_d2_in1k` | [`zeromodels/convnext_atto_d2_in1k`](https://huggingface.co/zeromodels/convnext_atto_d2_in1k) |
|
| 64 |
+
| `convnext_base_fb_in1k` | [`zeromodels/convnext_base_fb_in1k`](https://huggingface.co/zeromodels/convnext_base_fb_in1k) |
|
| 65 |
+
| `convnext_base_fb_in22k` | [`zeromodels/convnext_base_fb_in22k`](https://huggingface.co/zeromodels/convnext_base_fb_in22k) |
|
| 66 |
+
| `convnext_base_fb_in22k_ft_in1k` | [`zeromodels/convnext_base_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/convnext_base_fb_in22k_ft_in1k) |
|
| 67 |
+
| `convnext_base_fb_in22k_ft_in1k_384` | [`zeromodels/convnext_base_fb_in22k_ft_in1k_384`](https://huggingface.co/zeromodels/convnext_base_fb_in22k_ft_in1k_384) |
|
| 68 |
+
| `convnext_femto_d1_in1k` | [`zeromodels/convnext_femto_d1_in1k`](https://huggingface.co/zeromodels/convnext_femto_d1_in1k) |
|
| 69 |
+
| `convnext_large_fb_in1k` | [`zeromodels/convnext_large_fb_in1k`](https://huggingface.co/zeromodels/convnext_large_fb_in1k) |
|
| 70 |
+
| `convnext_large_fb_in22k` | [`zeromodels/convnext_large_fb_in22k`](https://huggingface.co/zeromodels/convnext_large_fb_in22k) |
|
| 71 |
+
| `convnext_large_fb_in22k_ft_in1k` | [`zeromodels/convnext_large_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/convnext_large_fb_in22k_ft_in1k) |
|
| 72 |
+
| `convnext_large_fb_in22k_ft_in1k_384` | [`zeromodels/convnext_large_fb_in22k_ft_in1k_384`](https://huggingface.co/zeromodels/convnext_large_fb_in22k_ft_in1k_384) |
|
| 73 |
+
| `convnext_nano_d1h_in1k` | [`zeromodels/convnext_nano_d1h_in1k`](https://huggingface.co/zeromodels/convnext_nano_d1h_in1k) |
|
| 74 |
+
| `convnext_nano_in12k_ft_in1k` | [`zeromodels/convnext_nano_in12k_ft_in1k`](https://huggingface.co/zeromodels/convnext_nano_in12k_ft_in1k) |
|
| 75 |
+
| `convnext_pico_d1_in1k` | [`zeromodels/convnext_pico_d1_in1k`](https://huggingface.co/zeromodels/convnext_pico_d1_in1k) |
|
| 76 |
+
| `convnext_small_fb_in1k` | [`zeromodels/convnext_small_fb_in1k`](https://huggingface.co/zeromodels/convnext_small_fb_in1k) |
|
| 77 |
+
| `convnext_small_fb_in22k` | [`zeromodels/convnext_small_fb_in22k`](https://huggingface.co/zeromodels/convnext_small_fb_in22k) |
|
| 78 |
+
| `convnext_small_fb_in22k_ft_in1k` | [`zeromodels/convnext_small_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/convnext_small_fb_in22k_ft_in1k) |
|
| 79 |
+
| `convnext_small_fb_in22k_ft_in1k_384` | [`zeromodels/convnext_small_fb_in22k_ft_in1k_384`](https://huggingface.co/zeromodels/convnext_small_fb_in22k_ft_in1k_384) |
|
| 80 |
+
| `convnext_tiny_fb_in1k` | [`zeromodels/convnext_tiny_fb_in1k`](https://huggingface.co/zeromodels/convnext_tiny_fb_in1k) |
|
| 81 |
+
| `convnext_tiny_fb_in22k` | [`zeromodels/convnext_tiny_fb_in22k`](https://huggingface.co/zeromodels/convnext_tiny_fb_in22k) |
|
| 82 |
+
| `convnext_tiny_fb_in22k_ft_in1k` | [`zeromodels/convnext_tiny_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/convnext_tiny_fb_in22k_ft_in1k) |
|
| 83 |
+
| `convnext_tiny_fb_in22k_ft_in1k_384` | [`zeromodels/convnext_tiny_fb_in22k_ft_in1k_384`](https://huggingface.co/zeromodels/convnext_tiny_fb_in22k_ft_in1k_384) |
|
| 84 |
+
| `convnext_xlarge_fb_in22k` | [`zeromodels/convnext_xlarge_fb_in22k`](https://huggingface.co/zeromodels/convnext_xlarge_fb_in22k) |
|
| 85 |
+
| `convnext_xlarge_fb_in22k_ft_in1k` | [`zeromodels/convnext_xlarge_fb_in22k_ft_in1k`](https://huggingface.co/zeromodels/convnext_xlarge_fb_in22k_ft_in1k) |
|
| 86 |
+
| `convnext_xlarge_fb_in22k_ft_in1k_384` | [`zeromodels/convnext_xlarge_fb_in22k_ft_in1k_384`](https://huggingface.co/zeromodels/convnext_xlarge_fb_in22k_ft_in1k_384) |
|
| 87 |
|
| 88 |
## Tips
|
| 89 |
|
| 90 |
+
- Set `KERAS_BACKEND` **before** importing Keras / zeromodels.
|
| 91 |
- `ConvNeXtImageClassify` returns class logits; `ConvNeXtModel` returns features (`as_backbone=True` for multi-scale stages).
|
| 92 |
+
- See [docs](https://imvision12.github.io/ZeroModels/classification_backbones/) and [Loading Weights](https://imvision12.github.io/ZeroModels/loading_weights/).
|
| 93 |
- Upstream / timm checkpoints: `ConvNeXtImageClassify.from_weights("hf:timm/convnext_large.fb_in22k")`.
|
| 94 |
|
| 95 |
## Special Thanks
|
kf_config.json → zm_config.json
RENAMED
|
@@ -1,27 +1,27 @@
|
|
| 1 |
-
{
|
| 2 |
-
"library_name": "
|
| 3 |
-
"
|
| 4 |
-
"model_module": "
|
| 5 |
-
"model_class": "ConvNeXtImageClassify",
|
| 6 |
-
"variant": "convnext_large_fb_in22k",
|
| 7 |
-
"weights": "model.weights.h5",
|
| 8 |
-
"schema_version": 2,
|
| 9 |
-
"weight_dtype": "float32",
|
| 10 |
-
"model_type": "convnext",
|
| 11 |
-
"vision_config": {
|
| 12 |
-
"depths": [
|
| 13 |
-
3,
|
| 14 |
-
3,
|
| 15 |
-
27,
|
| 16 |
-
3
|
| 17 |
-
],
|
| 18 |
-
"projection_dim": [
|
| 19 |
-
192,
|
| 20 |
-
384,
|
| 21 |
-
768,
|
| 22 |
-
1536
|
| 23 |
-
],
|
| 24 |
-
"image_size": 224,
|
| 25 |
-
"num_classes": 21841
|
| 26 |
-
}
|
| 27 |
}
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"library_name": "zeromodels",
|
| 3 |
+
"zeromodels_version": "1.2.1",
|
| 4 |
+
"model_module": "zeromodels.models.convnext",
|
| 5 |
+
"model_class": "ConvNeXtImageClassify",
|
| 6 |
+
"variant": "convnext_large_fb_in22k",
|
| 7 |
+
"weights": "model.weights.h5",
|
| 8 |
+
"schema_version": 2,
|
| 9 |
+
"weight_dtype": "float32",
|
| 10 |
+
"model_type": "convnext",
|
| 11 |
+
"vision_config": {
|
| 12 |
+
"depths": [
|
| 13 |
+
3,
|
| 14 |
+
3,
|
| 15 |
+
27,
|
| 16 |
+
3
|
| 17 |
+
],
|
| 18 |
+
"projection_dim": [
|
| 19 |
+
192,
|
| 20 |
+
384,
|
| 21 |
+
768,
|
| 22 |
+
1536
|
| 23 |
+
],
|
| 24 |
+
"image_size": 224,
|
| 25 |
+
"num_classes": 21841
|
| 26 |
+
}
|
| 27 |
}
|