|
Download README.md from grabbou/pvt-v2-b0-CoreAI: direct link, hf CLI and curl.
- Browser
- Download file 1.66 kB
-
https://huggingface.co/grabbou/pvt-v2-b0-CoreAI/resolve/main/README.md
- Command line
-
hf download hf://grabbou/pvt-v2-b0-CoreAI/README.md
-
curl -L -o README.md https://huggingface.co/grabbou/pvt-v2-b0-CoreAI/resolve/main/README.md
1.66 kB
metadata
license: apache-2.0
pipeline_tag: image-classification
library_name: coreai
tags:
- core-ai
- ios
- imagenet
PVT v2 b0 for Core AI
PVT v2 b0 (3.7M parameters, ImageNet-1k) from timm, exported to Apple Core AI with the apple/coreai-models recipe:
uv run models/pvt/export.py --dtype float16
| Folder | Contents | Size | Platforms |
|---|---|---|---|
pvt-v2-b0/ |
pvt-v2-b0.aimodel: main(x) -> logits, x is [1, 3, 224, 224] float16 RGB normalized with the ImageNet mean and std. labels.json: the 1000 ImageNet class names, by logit index |
7.1 MB | iOS, macOS |
Use
With @react-native-ai/core-ai, download pvt-v2-b0/ into app storage, then:
const { output } = await CoreAI.runTask(
'classification',
{ id: 'pvt-v2-b0', sourceType: 'file', sourceUri: pathToFolder },
{ imageUri },
{ topK: 5 }
)
// output.classifications: [{ label: 'tabby, tabby cat', index: 281, confidence: 0.36 }, ...]
The Neural Engine compiler rejects this export on macOS 27.0, so load it on the GPU there (computeUnits: 'gpu').
License
PVT v2 and its timm weights are Apache-2.0 (paper). The labels come from timm's ImageNet metadata. This repository only converts the model to Core AI format.