{"id":13444292,"url":"https://github.com/apple/ml-mobileone","last_synced_at":"2025-04-04T19:14:35.733Z","repository":{"id":49740547,"uuid":"513630533","full_name":"apple/ml-mobileone","owner":"apple","description":"This repository contains the official implementation of the research paper, \"An Improved One millisecond Mobile Backbone\".","archived":false,"fork":false,"pushed_at":"2022-07-25T21:19:45.000Z","size":749,"stargazers_count":759,"open_issues_count":19,"forks_count":64,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-03-28T18:17:12.702Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apple.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-13T18:29:33.000Z","updated_at":"2025-03-27T11:26:00.000Z","dependencies_parsed_at":"2022-08-21T23:00:35.515Z","dependency_job_id":null,"html_url":"https://github.com/apple/ml-mobileone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fml-mobileone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fml-mobileone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fml-mobileone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apple%2Fml-mobileone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apple","download_url":"https://codeload.github.com/apple/ml-mobileone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234923,"owners_count":20905854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:02:23.862Z","updated_at":"2025-04-04T19:14:35.713Z","avatar_url":"https://github.com/apple.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# MobileOne: An Improved One millisecond Mobile Backbone\n\nThis software project accompanies the research paper, [An Improved One millisecond Mobile Backbone](https://arxiv.org/abs/2206.04040).\n\nOur model achieves Top-1 Accuracy of 75.9\\% under 1ms.\n\n![MobileOne Performance](docs/accuracy_v_latency.jpg)\n\n## Model Zoo\n### ImageNet-1K\n| Model | Top-1 Acc.| Latency* | Pytorch Checkpoint (url) | CoreML Model |\n| :--- | :---: | :---: | :---: | :---: |\n| MobileOne-S0 | 71.4 | 0.79 | [S0](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s0.pth.tar)([unfused](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s0_unfused.pth.tar)) | [mlmodel](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s0.mlmodel) |\n| MobileOne-S1 | 75.9 | 0.89 | [S1](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s1.pth.tar)([unfused](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s1_unfused.pth.tar)) | [mlmodel](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s1.mlmodel) |\n| MobileOne-S2 | 77.4 | 1.18 | [S2](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s2.pth.tar)([unfused](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s2_unfused.pth.tar)) | [mlmodel](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s2.mlmodel) |\n| MobileOne-S3 | 78.1 | 1.53 | [S3](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s3.pth.tar)([unfused](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s3_unfused.pth.tar)) | [mlmodel](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s3.mlmodel) |\n| MobileOne-S4 | 79.4 | 1.86 | [S4](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s4.pth.tar)([unfused](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s4_unfused.pth.tar)) | [mlmodel](https://docs-assets.developer.apple.com/ml-research/datasets/mobileone/mobileone_s4.mlmodel) |\n\n*Latency measured on iPhone 12 Pro.\n\n## Usage\nTo use our model, follow the code snippet below,\n\n```python\nimport torch\nfrom mobileone import mobileone, reparameterize_model\n\n# To Train from scratch/fine-tuning\nmodel = mobileone(variant='s0')\n# ... train ...\n\n# Load Pre-trained checkpoint for fine-tuning\ncheckpoint = torch.load('/path/to/unfused_checkpoint.pth.tar')\nmodel.load_state_dict(checkpoint)\n# ... train ...\n\n# For inference\nmodel.eval()      \nmodel_eval = reparameterize_model(model)\n# Use model_eval at test-time\n```\nTo simply evaluate our model, use the fused checkpoint where branches are re-parameterized.\n```python\nimport torch\nfrom mobileone import mobileone\n\nmodel = mobileone(variant='s0', inference_mode=True)\ncheckpoint = torch.load('/path/to/checkpoint.pth.tar')\nmodel.load_state_dict(checkpoint)\n# ... evaluate/demo ...\n``` \n\n## ModelBench App\n\nAn iOS benchmark app for MobileOne CoreML models. See \n[ModelBench](ModelBench/README.md) for addition details on building\nand running the app. \n\n\n## Citation\n\nIf our code or models help your work, please cite our [paper](https://arxiv.org/abs/2206.04040):\n```BibTeX\n@article{mobileone2022,\n  title={An Improved One millisecond Mobile Backbone},\n  author={Vasu, Pavan Kumar Anasosalu and Gabriel, James and Zhu, Jeff and Tuzel, Oncel and Ranjan, Anurag},\n  journal={arXiv preprint arXiv:2206.04040},\n  year={2022}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapple%2Fml-mobileone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapple%2Fml-mobileone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapple%2Fml-mobileone/lists"}