Large-scale image classification models on Keras with MXNet backend
This is a collection of large-scale image classification models. Many of them are pretrained on ImageNet-1K dataset
and loaded automatically during use. All pretrained models require the same ordinary normalization. Scripts for
training/evaluating/converting models are in the imgclsmob repo.
List of implemented models
- AlexNet ('One weird trick for parallelizing convolutional neural networks')
- VGG/BN-VGG ('Very Deep Convolutional Networks for Large-Scale Image Recognition')
- ResNet ('Deep Residual Learning for Image Recognition')
- PreResNet ('Identity Mappings in Deep Residual Networks')
- ResNeXt ('Aggregated Residual Transformations for Deep Neural Networks')
- SENet/SE-ResNet/SE-PreResNet/SE-ResNeXt ('Squeeze-and-Excitation Networks')
- DenseNet ('Densely Connected Convolutional Networks')
- DarkNet Ref/Tiny/19 ('Darknet: Open source neural networks in c')
- DarkNet-53 ('YOLOv3: An Incremental Improvement')
- SqueezeNet/SqueezeResNet ('SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size')
- SqueezeNext ('SqueezeNext: Hardware-Aware Neural Network Design')
- ShuffleNet ('ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices')
- ShuffleNetV2 ('ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design')
- MENet ('Merging and Evolution: Improving Convolutional Neural Networks for Mobile Applications')
- MobileNet ('MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications')
- FD-MobileNet ('FD-MobileNet: Improved MobileNet with A Fast Downsampling Strategy')
- MobileNetV2 ('MobileNetV2: Inverted Residuals and Linear Bottlenecks')
- IGCV3 ('IGCV3: Interleaved Low-Rank Group Convolutions for Efficient Deep Neural Networks')
- MnasNet ('MnasNet: Platform-Aware Neural Architecture Search for Mobile')
Installation
To use the models in your project, simply install the kerascv package with mxnet:
pip install kerascv mxnet>=1.2.1
To enable different hardware supports such as GPUs, check out MXNet variants. For example, you can install with CUDA-9.2 supported MXNet:
pip install kerascv mxnet-cu92>=1.2.1
After installation change the value of the image_data_format field to channels_first in the file
~/.keras/keras.json. Also check that the backend field is set to mxnet.
Usage
Example of using the pretrained ResNet-18 model:
from kerascv.model_provider import get_model as kecv_get_model
import numpy as np
net = kecv_get_model("resnet18", pretrained=True)
x = np.zeros((1, 3, 224, 224), np.float32)
y = net.predict(x)
Pretrained models
Some remarks:
- Top1/Top5 are the standard 1-crop Top-1/Top-5 errors (in percents) on the validation subset of the ImageNet-1K dataset.
- FLOPs/2 is the number of FLOPs divided by two to be similar to the number of MACs.
- Remark
Converted from GL modelmeans that the model was trained onMXNet/Gluonand then converted to Keras.
| Model | Top1 | Top5 | Params | FLOPs/2 | Remarks |
|---|---|---|---|---|---|
| AlexNet | 44.10 | 21.26 | 61,100,840 | 714.83M | From dmlc/gluon-cv (log) |
| VGG-11 | 31.90 | 11.75 | 132,863,336 | 7,615.87M | From dmlc/gluon-cv (log) |
| VGG-13 | 31.06 | 11.12 | 133,047,848 | 11,317.65M | From dmlc/gluon-cv (log) |
| VGG-16 | 26.78 | 8.69 | 138,357,544 | 15,507.20M | From dmlc/gluon-cv (log) |
| VGG-19 | 25.87 | 8.23 | 143,667,240 | 19,642.55M | From dmlc/gluon-cv (log) |
| BN-VGG-11b | 30.34 | 10.57 | 132,868,840 | 7,630.72M | From dmlc/gluon-cv (log) |
| BN-VGG-13b | 29.48 | 10.16 | 133,053,736 | 11,342.14M | From dmlc/gluon-cv (log) |
| BN-VGG-16b | 26.88 | 8.65 | 138,365,992 | 15,507.20M | From dmlc/gluon-cv (log) |
| BN-VGG-19b | 25.65 | 8.14 | 143,678,248 | 19,672.26M | From dmlc/gluon-cv (log) |
| ResNet-10 | 37.09 | 15.54 | 5,418,792 | 894.04M | Converted from GL model (log) |
| ResNet-12 | 35.86 | 14.45 | 5,492,776 | 1,126.25M | Converted from GL model (log) |
| ResNet-14 | 32.85 | 12.42 | 5,788,200 | 1,357.94M | Converted from GL model (log) |
| ResNet-16 | 30.67 | 11.09 | 6,968,872 | 1,589.34M | Converted from GL model (log) |
| ResNet-18 x0.25 | 49.14 | 24.45 | 831,096 | 137.32M | Converted from GL model (log) |
| ResNet-18 x0.5 | 36.54 | 14.96 | 3,055,880 | 486.49M | Converted from GL model (log) |
| ResNet-18 x0.75 | 33.24 | 12.54 | 6,675,352 | 1,047.53M | Converted from GL model (log) |
| ResNet-18 | 28.08 | 9.52 | 11,689,512 | 1,820.41M | Converted from GL model (log) |
| ResNet-34 | 25.32 | 7.92 | 21,797,672 | 3,672.68M | From dmlc/gluon-cv (log) |
| ResNet-50 | 22.63 | 6.41 | 25,557,032 | 3,877.95M | From dmlc/gluon-cv (log) |
| ResNet-50b | 22.31 | 6.18 | 25,557,032 | 4,110.48M | From dmlc/gluon-cv (log) |
| ResNet-101 | 21.64 | 5.99 | 44,549,160 | 7,597.95M | From dmlc/gluon-cv (log) |
| ResNet-101b | 20.78 | 5.39 | 44,549,160 | 7,830.48M | From dmlc/gluon-cv (log) |
| ResNet-152 | 20.74 | 5.35 | 60,192,808 | 11,321.85M | From dmlc/gluon-cv (log) |
| ResNet-152b | 20.30 | 5.25 | 60,192,808 | 11,554.38M | From dmlc/gluon-cv (log) |
| PreResNet-18 | 28.16 | 9.52 | 11,687,848 | 1,820.56M | Converted from GL model (log) |
| PreResNet-34 | 25.86 | 8.11 | 21,796,008 | 3,672.83M | From dmlc/gluon-cv (log) |
| PreResNet-50 | 23.38 | 6.68 | 25,549,480 | 3,875.44M | From dmlc/gluon-cv (log) |
| PreResNet-50b | 23.14 | 6.63 | 25,549,480 | 4,107.97M | From dmlc/gluon-cv (log) |
| PreResNet-101 | 21.43 | 5.75 | 44,541,608 | 7,595.44M | From dmlc/gluon-cv (log) |
| PreResNet-101b | 21.71 | 5.88 | 44,541,608 | 7,827.97M | From dmlc/gluon-cv (log) |
| PreResNet-152 | 20.69 | 5.31 | 60,185,256 | 11,319.34M | From dmlc/gluon-cv (log) |
| PreResNet-152b | 20.99 | 5.76 | 60,185,256 | 11,551.87M | From dmlc/gluon-cv (log) |
| PreResNet-200b | 21.09 | 5.64 | 64,666,280 | 15,068.63M | From tornadomeet/ResNet (log) |
| ResNeXt-101 (32x4d) | 21.30 | 5.78 | 44,177,704 | 8,003.45M | From Cadene/pretrained...pytorch (log) |
| ResNeXt-101 (64x4d) | 20.59 | 5.41 | 83,455,272 | 15,500.27M | From Cadene/pretrained...pytorch (log) |
| SE-ResNet-50 | 22.50 | 6.43 | 28,088,024 | 3,880.49M | From Cadene/pretrained...pytorch (log) |
| SE-ResNet-101 | 21.92 | 5.88 | 49,326,872 | 7,602.76M | From Cadene/pretrained...pytorch (log) |
| SE-ResNet-152 | 21.46 | 5.77 | 66,821,848 | 11,328.52M | From Cadene/pretrained...pytorch (log) |
| SE-ResNeXt-50 (32x4d) | 21.05 | 5.57 | 27,559,896 | 4,258.40M | From Cadene/pretrained...pytorch (log) |
| SE-ResNeXt-101 (32x4d) | 19.98 | 4.99 | 48,955,416 | 8,008.26M | From Cadene/pretrained...pytorch (log) |
| SENet-154 | 18.83 | 4.65 | 115,088,984 | 20,745.78M | From Cadene/pretrained...pytorch (log) |
| DenseNet-121 | 25.09 | 7.80 | 7,978,856 | 2,872.13M | From dmlc/gluon-cv (log) |
| DenseNet-161 | 22.39 | 6.18 | 28,681,000 | 7,793.16M | From dmlc/gluon-cv (log) |
| DenseNet-169 | 23.88 | 6.89 | 14,149,480 | 3,403.89M | From dmlc/gluon-cv (log) |
| DenseNet-201 | 22.69 | 6.35 | 20,013,928 | 4,347.15M | From dmlc/gluon-cv (log) |
| DarkNet Tiny | 40.31 | 17.46 | 1,042,104 | 500.85M | Converted from GL model (log) |
| DarkNet Ref | 37.99 | 16.68 | 7,319,416 | 367.59M | Converted from GL model (log) |
| DarkNet-53 | 21.43 | 5.56 | 41,609,928 | 7,133.86M | From dmlc/gluon-cv (log) |
| SqueezeNet v1.0 | 39.17 | 17.56 | 1,248,424 | 823.67M | Converted from GL model (log) |
| SqueezeNet v1.1 | 39.08 | 17.39 | 1,235,496 | 352.02M | Converted from GL model (log) |
| SqueezeResNet v1.1 | 39.82 | 17.84 | 1,235,496 | 352.02M | Converted from GL model (log) |
| 1.0-SqNxt-23 | 42.28 | 18.62 | 724,056 | 287.28M | Converted from GL model (log) |
| 1.0-SqNxt-23v5 | 40.38 | 17.57 | 921,816 | 285.82M | Converted from GL model (log) |
| ShuffleNet x0.25 (g=1) | 62.00 | 36.76 | 209,746 | 12.35M | Converted from GL model (log) |
| ShuffleNet x0.25 (g=3) | 61.32 | 36.15 | 305,902 | 13.09M | Converted from GL model (log) |
| ShuffleNet x0.5 (g=3) | 43.82 | 20.60 | 718,324 | 41.70M | Converted from GL model (log) |
| ShuffleNetV2 x0.5 | 40.76 | 18.40 | 1,366,792 | 43.31M | Converted from GL model (log) |
| ShuffleNetV2 x1.0 | 31.02 | 11.33 | 2,278,604 | 149.72M | Converted from GL model (log) |
| ShuffleNetV2 x1.5 | 32.46 | 12.47 | 4,406,098 | 320.77M | Converted from GL model (log) |
| ShuffleNetV2 x2.0 | 31.91 | 12.23 | 7,601,686 | 595.84M | Converted from GL model (log) |
| 108-MENet-8x1 (g=3) | 43.61 | 20.31 | 654,516 | 42.68M | Converted from GL model (log) |
| 128-MENet-8x1 (g=4) | 42.08 | 19.14 | 750,796 | 45.98M | Converted from GL model (log) |
| 160-MENet-8x1 (g=8) | 43.47 | 20.28 | 850,120 | 45.63M | Converted from GL model (log) |
| 228-MENet-12x1 (g=3) | 33.85 | 12.88 | 1,806,568 | 152.93M | Converted from GL model (log) |
| 256-MENet-12x1 (g=4) | 32.22 | 12.17 | 1,888,240 | 150.65M | Converted from GL model (log) |
| 348-MENet-12x1 (g=3) | 31.17 | 11.42 | 3,368,128 | 312.00M | From clavichord93/MENet (log) |
| 352-MENet-12x1 (g=8) | 34.69 | 13.75 | 2,272,872 | 157.35M | From clavichord93/MENet (log) |
| 456-MENet-24x1 (g=3) | 29.55 | 10.44 | 5,304,784 | 567.90M | From clavichord93/MENet (log) |
| MobileNet x0.25 | 45.80 | 22.17 | 470,072 | 44.09M | Converted from GL model (log) |
| MobileNet x0.5 | 33.94 | 13.30 | 1,331,592 | 155.42M | Converted from GL model (log) |
| MobileNet x0.75 | 29.85 | 10.51 | 2,585,560 | 333.99M | Converted from GL model (log) |
| MobileNet x1.0 | 26.43 | 8.66 | 4,231,976 | 579.80M | Converted from GL model (log) |
| FD-MobileNet x0.25 | 56.17 | 31.37 | 383,160 | 12.95M | Converted from GL model (log) |
| FD-MobileNet x0.5 | 42.61 | 19.69 | 993,928 | 41.84M | Converted from GL model (log) |
| FD-MobileNet x0.75 | 37.90 | 16.01 | 1,833,304 | 86.68M | Converted from GL model (log) |
| FD-MobileNet x1.0 | 33.80 | 13.12 | 2,901,288 | 147.46M | Converted from GL model (log) |
| MobileNetV2 x0.25 | 48.06 | 24.12 | 1,516,392 | 34.24M | Converted from GL model (log) |
| MobileNetV2 x0.5 | 35.63 | 14.43 | 1,964,736 | 100.13M | Converted from GL model (log) |
| MobileNetV2 x0.75 | 30.81 | 11.26 | 2,627,592 | 198.50M | From dmlc/gluon-cv (log) |
| MobileNetV2 x1.0 | 28.50 | 9.90 | 3,504,960 | 329.36M | From dmlc/gluon-cv (log) |
| IGCV3 x0.25 | 53.41 | 28.29 | 1,534,020 | 41.29M | Converted from GL model (log) |
| IGCV3 x0.5 | 39.39 | 17.04 | 1,985,528 | 111.12M | Converted from GL model (log) |
| IGCV3 x1.0 | 28.21 | 9.55 | 3,491,688 | 340.79M | From homles11/IGCV3 (log) |
| MnasNet | 31.30 | 11.45 | 4,308,816 | 317.67M | From zeusees/Mnasnet...Model (log) |
Metadata
Release files for kerascv 0.0.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kerascv-0.0.18.tar.gz | 40.5 kB | Without provenance | Details for kerascv-0.0.18.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kerascv-0.0.18-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for kerascv-0.0.18-py2.py3-none-any.whl |
Total release size: 115.8 kB
Release files / kerascv-0.0.18.tar.gz
| Download URL | kerascv-0.0.18.tar.gz |
|---|---|
| Size | 40.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce09e8861fda2c8657bff8681d6e64293b25fdbab6bcab36b63bddecb33aa7b2
|
|
BLAKE2b-256 checksum How to use checksums |
1b51081faae4d8c24c3bfb240cb49bd6b17c899ca97ba0cc90bde5bea364ef30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
|
Release files / kerascv-0.0.18-py2.py3-none-any.whl
| Download URL | kerascv-0.0.18-py2.py3-none-any.whl |
|---|---|
| Size | 75.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
dbedf93b8cdf83ca15a2137d4ac38b3a5080b2aec0c4533e0b9ee57d16e1c6fa
|
|
BLAKE2b-256 checksum How to use checksums |
055643e8e91a1cfc0aee622d51d8b86e8b79f0f93a9c546656d258ac7dea8268
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.5
|
Security for kerascv 0.0.18
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.