Instructions to use zeromodels/mobilenetv4_conv_large_e600_r384_in1k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ZeroModels
How to use zeromodels/mobilenetv4_conv_large_e600_r384_in1k with ZeroModels:
# 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/mobilenetv4_conv_large_e600_r384_in1k 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/mobilenetv4_conv_large_e600_r384_in1k") - Notebooks
- Google Colab
- Kaggle
See our collection for all versions of MobileNetV4.
Run MobileNetV4 with Keras 3: JAX, PyTorch, or TensorFlow
zeromodels/mobilenetv4_conv_large_e600_r384_in1k
Paper: MobileNetV4 - Universal Models for the Mobile Ecosystem (arXiv:2404.10518) · HF Papers
MobileNetV4 (MNv4) refines the MobileNet line with the Universal Inverted Bottleneck (UIB) block; the hybrid variants add a Mobile Multi-Query Attention (Mobile MQA) block. Use as an ImageNet classifier or a 5-stage backbone.
For more details on the model, please go to the upstream model card.
Pure-Keras 3 conversion of timm/mobilenetv4_conv_large.e600_r384_in1k for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.
This is an image-classification / backbone checkpoint (MobileNetV4ImageClassify / MobileNetV4Model).
✨ Quick start
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from PIL import Image
from zeromodels.models.mobilenetv4 import MobileNetV4ImageClassify, MobileNetV4Model, MobileNetV4ImageProcessor
model = MobileNetV4ImageClassify.from_weights("zeromodels/mobilenetv4_conv_large_e600_r384_in1k")
processor = MobileNetV4ImageProcessor.from_weights("zeromodels/mobilenetv4_conv_large_e600_r384_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 = MobileNetV4Model.from_weights("zeromodels/mobilenetv4_conv_large_e600_r384_in1k", as_backbone=True)
features = backbone(pixels, training=False)
Load any MobileNetV4 variant the same way with from_weights("zeromodels/<variant>"):
| Variant | Hub |
|---|---|
mobilenetv4_conv_small_e2400_r224_in1k |
zeromodels/mobilenetv4_conv_small_e2400_r224_in1k |
mobilenetv4_conv_medium_e500_r256_in1k |
zeromodels/mobilenetv4_conv_medium_e500_r256_in1k |
mobilenetv4_conv_large_e600_r384_in1k |
zeromodels/mobilenetv4_conv_large_e600_r384_in1k |
mobilenetv4_hybrid_medium_e500_r224_in1k |
zeromodels/mobilenetv4_hybrid_medium_e500_r224_in1k |
mobilenetv4_hybrid_large_e600_r384_in1k |
zeromodels/mobilenetv4_hybrid_large_e600_r384_in1k |
Tips
- Set
KERAS_BACKENDbefore importing Keras / zeromodels. - Pass raw
[0, 255]images: the classifier normalizes internally (ImageNet mean/std). MobileNetV4ImageClassifyreturns class logits;MobileNetV4Modelreturns features (as_backbone=Truefor the 5 stride-2 stages).- See docs and Loading Weights.
- Upstream / timm checkpoints:
MobileNetV4ImageClassify.from_weights("hf:timm/mobilenetv4_conv_large.e600_r384_in1k").
Special Thanks
A huge thank you to the MobileNetV4 authors and the timm / Hub communities for creating and releasing these models.
License: see YAML license (matches the upstream timm/mobilenetv4_conv_large.e600_r384_in1k checkpoint, Apache-2.0).
- Downloads last month
- 35
Model tree for zeromodels/mobilenetv4_conv_large_e600_r384_in1k
Base model
timm/mobilenetv4_conv_large.e600_r384_in1k