ResNet-50 (ANEForge)
An unmodified duplicate of microsoft/resnet-50, tagged for use with
ANEForge so the weights load and run directly on the
Apple Neural Engine (no CoreML). BatchNorm is folded into the preceding convolution at load. Weights are
byte-identical to the source; see the original repo for the model details. Licensed apache-2.0 from the source.
Use with ANEForge
# pip install "aneforge[models]"
import aneforge as af
from transformers import AutoImageProcessor
proc = AutoImageProcessor.from_pretrained("aneforge/resnet-50")
net = af.load_resnet("aneforge/resnet-50")
logits = net(proc(image, return_tensors="np")["pixel_values"]) # image: a PIL.Image -> [1, 1000] logits
ANEForge compiles the model's graph into a single ANE program and streams the weights from this repo
via huggingface_hub. See the docs and the paper.