See our collection for all versions of ConvNeXt-V2.
Run ConvNeXt-V2 with Keras 3: JAX, PyTorch, or TensorFlow
zeromodels/convnextv2_large_fcmae_ft_in22k_in1k
Paper: ConvNeXt V2: Co-designing and Scaling ConvNets with Masked Autoencoders (arXiv:2301.00808) · HF Papers
ConvNeXt V2 adds Global Response Normalization and FCMAE pretraining. Same classifier / backbone split as ConvNeXt.
For more details on the model, please go to the upstream model card.
Pure-Keras 3 conversion of timm/convnextv2_large.fcmae_ft_in22k_in1k for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.
This is an image-classification / backbone checkpoint (ConvNeXtV2ImageClassify / ConvNeXtV2Model).
✨ Quick start
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from PIL import Image
from zeromodels.models.convnextv2 import ConvNeXtV2ImageClassify, ConvNeXtV2Model, ConvNeXtV2ImageProcessor
model = ConvNeXtV2ImageClassify.from_weights("zeromodels/convnextv2_large_fcmae_ft_in22k_in1k")
processor = ConvNeXtV2ImageProcessor.from_weights("zeromodels/convnextv2_large_fcmae_ft_in22k_in1k")
image = Image.open("your_image.jpg").convert("RGB")
pixels = processor(image) # resize + normalize (normalization lives in the processor)
logits = model(pixels, training=False)
print(logits.shape) # (1, num_classes)
# Feature extraction: the backbone without the classifier head
backbone = ConvNeXtV2Model.from_weights("zeromodels/convnextv2_large_fcmae_ft_in22k_in1k", as_backbone=True)
features = backbone(pixels, training=False)
Load any ConvNeXt-V2 variant the same way with from_weights("zeromodels/<variant>"):
Tips
- Set
KERAS_BACKENDbefore importing Keras / zeromodels. ConvNeXtV2ImageClassifyreturns class logits;ConvNeXtV2Modelreturns features (as_backbone=Truefor multi-scale stages).- See docs and Loading Weights.
- Upstream / timm checkpoints:
ConvNeXtV2ImageClassify.from_weights("hf:timm/convnextv2_large.fcmae_ft_in22k_in1k").
Special Thanks
A huge thank you to the ConvNeXt-V2 authors and the timm / Hub communities for creating and releasing these models.
License: see YAML license (usually matches the upstream checkpoint).