Views
No views yet
timm state-dict layout.crop_pct=0.95.features_only=True.1from urllib.request import urlopen
2from PIL import Image
3import timm
4
5img = Image.open(urlopen(
6 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
7))
8
9model = timm.create_model('cpubone_s0.r224_in1k', pretrained=True)
10model = model.eval()
11
12# get model specific transforms (normalization, resize)
13data_config = timm.data.resolve_model_data_config(model)
14transforms = timm.data.create_transform(**data_config, is_training=False)
15
16output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
17
18top5_probabilities, top5_class_indices = torch.topk(output.softmax(dim=1) * 100, k=5)1from urllib.request import urlopen
2from PIL import Image
3import timm
4
5img = Image.open(urlopen(
6 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
7))
8
9model = timm.create_model(
10 'cpubone_s0.r224_in1k',
11 pretrained=True,
12 features_only=True,
13)
14model = model.eval()
15
16# get model specific transforms (normalization, resize)
17data_config = timm.data.resolve_model_data_config(model)
18transforms = timm.data.create_transform(**data_config, is_training=False)
19
20output = model(transforms(img).unsqueeze(0)) # unsqueeze single image into batch of 1
21
22for o in output:
23 # print shape of each feature map in output
24 # e.g.:
25 # torch.Size([1, 28, 56, 56])
26 # torch.Size([1, 56, 28, 28])
27 # torch.Size([1, 112, 14, 14])
28 # torch.Size([1, 224, 7, 7])
29
30 print(o.shape)1from urllib.request import urlopen
2from PIL import Image
3import timm
4
5img = Image.open(urlopen(
6 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
7))
8
9model = timm.create_model(
10 'cpubone_s0.r224_in1k',
11 pretrained=True,
12 num_classes=0, # remove classifier nn.Linear
13)
14model = model.eval()
15
16# get model specific transforms (normalization, resize)
17data_config = timm.data.resolve_model_data_config(model)
18transforms = timm.data.create_transform(**data_config, is_training=False)
19
20output = model(transforms(img).unsqueeze(0)) # output is (batch_size, num_features) shaped tensor
21
22# or equivalently (without needing to set num_classes=0)
23
24output = model.forward_features(transforms(img).unsqueeze(0))
25# output is unpooled, a (1, 224, 7, 7) shaped tensor
26
27output = model.forward_head(output, pre_logits=True)
28# output is a (1, num_features) shaped tensorcrop_pct=0.95). Values are Top-1 / Top-5 percentages; only input resolution changes
between columns.| Model | Params (M) | 224 Top-1 / Top-5 | 256 Top-1 / Top-5 | 288 Top-1 / Top-5 |
|---|---|---|---|---|
| cpubone_b0_bfrobust.r224_in1k | 10.37 | 77.632 / 93.548 | 78.344 / 93.896 | 78.342 / 94.010 |
| cpubone_b1_bfrobust.r224_in1k | 12.44 | 78.928 / 94.188 | 79.462 / 94.564 | 79.620 / 94.548 |
| cpubone_b1_dwnorm.timm_r256_in1k | 12.43 | 78.280 / 94.020 | 79.352 / 94.624 | 80.002 / 94.914 |
| cpubone_b2_bfrobust.r224_in1k | 23.87 | 80.730 / 95.238 | 81.144 / 95.536 | 81.330 / 95.528 |
| cpubone_b2pt5_dwnorm.timm_r256_in1k | 30.43 | 81.118 / 95.354 | 81.736 / 95.706 | 82.072 / 95.882 |
| cpubone_b3.r224_in1k | 40.74 | 83.048 / 96.366 | 83.244 / 96.474 | 83.050 / 96.130 |
| cpubone_nano.r224_in1k | 6.52 | 72.806 / 90.624 | 73.716 / 91.150 | 73.572 / 91.124 |
| cpubone_s0.r224_in1k | 8.73 | 75.892 / 92.568 | 76.532 / 92.916 | 76.636 / 93.030 |
| cpubone_t0.r224_in1k | 7.54 | 74.868 / 91.928 | 75.330 / 92.358 | 75.406 / 92.330 |
1@inproceedings{nottebaum2026cpubone,
2 title={CPUBone: Efficient Vision Backbone Design for Devices with Low Parallelization Capabilities},
3 author={Nottebaum, Moritz and Dunnhofer, Matteo and Micheloni, Christian},
4 booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
5 year={2026}
6}1@misc{rw2019timm,
2 author = {Ross Wightman},
3 title = {PyTorch Image Models},
4 year = {2019},
5 publisher = {GitHub},
6 journal = {GitHub repository},
7 doi = {10.5281/zenodo.4414861},
8 howpublished = {\url{https://github.com/huggingface/pytorch-image-models}}
9}