Mobileone is proposed by apple and based on reparameterization. On the apple chips, the accuracy of the model is close to 0.76 on the ImageNet dataset when the latency is less than 1ms. Its main improvements based on RepVGG are fllowing:
Predict image
from mmpretrain import inference_model
predict = inference_model('mobileone-s0_8xb32_in1k', 'demo/bird.JPEG')
print(predict['pred_class'])
print(predict['pred_score'])
Use the model
import torch
from mmpretrain import get_model
model = get_model('mobileone-s0_8xb32_in1k', pretrained=True)
inputs = torch.rand(1, 3, 224, 224)
out = model(inputs)
print(type(out))
# To extract features.
feats = model.extract_feat(inputs)
print(type(feats))
Train/Test Command
Prepare your dataset according to the docs.
Train:
python tools/train.py configs/mobileone/mobileone-s0_8xb32_in1k.py
Test:
python tools/test.py configs/mobileone/mobileone-s0_8xb32_in1k.py https://download.openmmlab.com/mmclassification/v0/mobileone/mobileone-s0_8xb32_in1k_20221110-0bc94952.pth
| Model | Pretrain | Params (M) | Flops (G) | Top-1 (%) | Top-5 (%) | Config | Download |
|---|---|---|---|---|---|---|---|
mobileone-s0_8xb32_in1k |
From scratch | 2.08 | 0.27 | 71.34 | 89.87 | config | model | log |
mobileone-s1_8xb32_in1k |
From scratch | 4.76 | 0.82 | 75.72 | 92.54 | config | model | log |
mobileone-s2_8xb32_in1k |
From scratch | 7.81 | 1.30 | 77.37 | 93.34 | config | model | log |
mobileone-s3_8xb32_in1k |
From scratch | 10.08 | 1.89 | 78.06 | 93.83 | config | model | log |
mobileone-s4_8xb32_in1k |
From scratch | 14.84 | 2.98 | 79.69 | 94.46 | config | model | log |
@article{mobileone2022,
title={An Improved One millisecond Mobile Backbone},
author={Vasu, Pavan Kumar Anasosalu and Gabriel, James and Zhu, Jeff and Tuzel, Oncel and Ranjan, Anurag},
journal={arXiv preprint arXiv:2206.04040},
year={2022}
}