Instructions to use zeromodels/res2net50_14w_8s_in1k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use zeromodels/res2net50_14w_8s_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/res2net50_14w_8s_in1k") - Notebooks
- Google Colab
- Kaggle
See our collection for all versions of Res2Net.
Run Res2Net with Keras 3: JAX, PyTorch, or TensorFlow
zeromodels/res2net50_14w_8s_in1k
Paper: Res2Net: A New Multi-scale Backbone Architecture (arXiv:1904.01169) · HF Papers
Res2Net represents multi-scale features at a granular level inside residual blocks. Available as classifier and feature backbone.
For more details on the model, please go to the upstream model card.
Pure-Keras 3 conversion of timm/res2net50_14w_8s.in1k for zeromodels. One implementation runs unmodified on TensorFlow / Torch / JAX.
This is an image-classification / backbone checkpoint (Res2NetImageClassify / Res2NetModel).
✨ Quick start
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from PIL import Image
from zeromodels.models.res2net import Res2NetImageClassify, Res2NetModel, Res2NetImageProcessor
model = Res2NetImageClassify.from_weights("zeromodels/res2net50_14w_8s_in1k")
processor = Res2NetImageProcessor.from_weights("zeromodels/res2net50_14w_8s_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 = Res2NetModel.from_weights("zeromodels/res2net50_14w_8s_in1k", as_backbone=True)
features = backbone(pixels, training=False)
Load any Res2Net variant the same way with from_weights("zeromodels/<variant>"):
| Variant | Hub |
|---|---|
res2net101_26w_4s_in1k |
zeromodels/res2net101_26w_4s_in1k |
res2net50_14w_8s_in1k |
zeromodels/res2net50_14w_8s_in1k |
res2net50_26w_4s_in1k |
zeromodels/res2net50_26w_4s_in1k |
res2net50_26w_6s_in1k |
zeromodels/res2net50_26w_6s_in1k |
res2net50_26w_8s_in1k |
zeromodels/res2net50_26w_8s_in1k |
res2net50_48w_2s_in1k |
zeromodels/res2net50_48w_2s_in1k |
res2next50_in1k |
zeromodels/res2next50_in1k |
Tips
- Set
KERAS_BACKENDbefore importing Keras / zeromodels. Res2NetImageClassifyreturns class logits;Res2NetModelreturns features (as_backbone=Truefor multi-scale stages).- See docs and Loading Weights.
- Upstream / timm checkpoints:
Res2NetImageClassify.from_weights("hf:timm/res2net50_14w_8s.in1k").
Special Thanks
A huge thank you to the Res2Net authors and the timm / Hub communities for creating and releasing these models.
License: see YAML license (usually matches the upstream checkpoint).
Model tree for zeromodels/res2net50_14w_8s_in1k
Base model
timm/res2net50_14w_8s.in1k