https://github.com/Randl/MobileNetV2-pytorch
Impementation of MobileNetV2 in pytorch
https://github.com/Randl/MobileNetV2-pytorch
cnn image-classification mobilenet2 pytorch
Last synced: 18 days ago
JSON representation
Impementation of MobileNetV2 in pytorch
- Host: GitHub
- URL: https://github.com/Randl/MobileNetV2-pytorch
- Owner: Randl
- License: mit
- Created: 2018-01-18T12:37:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-28T13:44:34.000Z (over 6 years ago)
- Last Synced: 2024-08-01T22:50:06.718Z (9 months ago)
- Topics: cnn, image-classification, mobilenet2, pytorch
- Language: Python
- Homepage: https://arxiv.org/abs/1801.04381
- Size: 53 MB
- Stars: 267
- Watchers: 14
- Forks: 83
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-image-classification - unofficial-pytorch : https://github.com/Randl/MobileNetV2-pytorch
- awesome-image-classification - unofficial-pytorch : https://github.com/Randl/MobileNetV2-pytorch
README
# MobileNetv2 in PyTorch
An implementation of `MobileNetv2` in PyTorch. `MobileNetv2` is an efficient convolutional neural network architecture for mobile devices. For more information check the paper:
[Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segmentation](https://arxiv.org/abs/1801.04381)## Usage
Clone the repo:
```bash
git clone https://github.com/Randl/MobileNetV2-pytorch
pip install -r requirements.txt
```Use the model defined in `model.py` to run ImageNet example:
```bash
python imagenet.py --dataroot "/path/to/imagenet/"
```To run continue training from checkpoint
```bash
python imagenet.py --dataroot "/path/to/imagenet/" --resume "/path/to/checkpoint/folder"
```
## ResultsFor x1.0 model I achieved 0.3% higher top-1 accuracy than claimed.
|Classification Checkpoint| MACs (M) | Parameters (M)| Top-1 Accuracy| Top-5 Accuracy| Claimed top-1| Claimed top-5|
|-------------------------|------------|---------------|---------------|---------------|---------------|---------------|
| [mobilenet_v2_1.0_224]|300 |3.47 | 72.10| 90.48| 71.8| 91.0|
| [mobilenet_v2_0.5_160]|50 |1.95 | 60.61| 82.87| 61.0| 83.2|You can test it with
```bash
python imagenet.py --dataroot "/path/to/imagenet/" --resume "results/mobilenet_v2_1.0_224/model_best.pth.tar" -e
python imagenet.py --dataroot "/path/to/imagenet/" --resume "results/mobilenet_v2_0.5_160/model_best.pth.tar" -e --scaling 0.5 --input-size 160
```