This model is a tiny variant of ConvNeXtV2 architecture, pretrained on ImageNet-22K and fine-tuned on ImageNet-1K (224x224 resolution).
Model parameters: 28.6M Input size: 3x224x224
ConvNeXtV2 is an improved convolutional neural network architecture that incorporates techniques from vision transformers (e.g., LayerNorm, GELU, large kernels) while maintaining the efficiency of pure ConvNets. The V2 version introduces ConvNeXtV2Block with GRN (Global Response Normalization) for better performance.
from PIL import Image
import requests
from transformers import AutoImageProcessor, ConvNextV2ForImageClassification
model_path = "weixin_72661020/convnextv2-tiny-22k-224"
processor = AutoImageProcessor.from_pretrained(model_path)
model = ConvNextV2ForImageClassification.from_pretrained(model_path)
# Example inference
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
inputs = processor(image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class = logits.argmax(-1).item()
print(f"Predicted class: {predicted_class}")| Batch Size | Mean Latency (ms) | Throughput (fps) |
|---|---|---|
| 1 | 7.78 | 128.6 |
| 4 | 9.55 | 418.7 |
| 8 | 16.57 | 482.7 |
Top-1 consistency between CPU and NPU: 100% KL Divergence (max): < 0.00001
pytorch_model.bin / model.safetensors: Model weightsconfig.json: Model configurationpreprocessor_config.json: Image processor configuration