regnet-y-320 / README.md
IMvision12's picture
Upload README.md with huggingface_hub
b7a1166 verified
|
Raw
History Blame Contribute Delete
5.92 kB
metadata
pipeline_tag: image-classification
license: apache-2.0
base_model: facebook/regnet-y-320
library_name: zeromodels
tags:
  - keras
  - zeromodels
  - image-classification
  - regnet
  - backbone
  - arxiv:2003.13678
  - pytorch
  - jax
  - tf

See our collection for all versions of RegNet.

Run RegNet with Keras 3: JAX, PyTorch, or TensorFlow

GitHub Docs Collection

zeromodels/regnet-y-320

Paper: Designing Network Design Spaces (arXiv:2003.13678) · HF Papers

RegNet is a family of ConvNets whose per-stage widths and depths follow a simple quantized-linear rule. This is the Y (with Squeeze-and-Excitation) variant: a 3x3 stride-2 stem then four stages of 1x1 -> 3x3 grouped -> [SE] -> 1x1 residual blocks. Use as an ImageNet classifier or a 4-stage backbone.

For more details on the model, please go to the upstream model card.

Pure-Keras 3 conversion of facebook/regnet-y-320 for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.

This is an image-classification / backbone checkpoint (RegNetImageClassify / RegNetModel).

✨ Quick start

import os

os.environ["KERAS_BACKEND"] = "torch"  # or "jax" / "tensorflow"

from PIL import Image
from zeromodels.models.regnet import RegNetImageClassify, RegNetModel, RegNetImageProcessor

model = RegNetImageClassify.from_weights("zeromodels/regnet-y-320")
processor = RegNetImageProcessor.from_weights("zeromodels/regnet-y-320")

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 = RegNetModel.from_weights("zeromodels/regnet-y-320", as_backbone=True)
features = backbone(pixels, training=False)

Load any RegNet variant the same way with from_weights("zeromodels/<variant>"):

Tips

  • Set KERAS_BACKEND before importing Keras / zeromodels.
  • RegNetImageClassify returns class logits; RegNetModel returns features (as_backbone=True for multi-scale stages at strides 4, 8, 16, 32).
  • Normalization is baked in (include_normalization=True): pass raw [0, 255] pixels.
  • Both channels_last and channels_first are supported (bit-exact); set the format before building.
  • See docs and Loading Weights.
  • Upstream checkpoints: RegNetImageClassify.from_weights("hf:facebook/regnet-y-320").

Special Thanks

A huge thank you to the RegNet authors and the transformers / Hub communities for creating and releasing these models.

License: see YAML license (matches the upstream checkpoint: apache-2.0).