Skip to main content

Image classification models for Keras

Project description

Large-scale image classification models on Keras

PyPI Downloads

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

Installation

To use the models in your project, simply install the kerascv package with desired backend. For example for MXNet backend:

pip install mxnet>=1.2.1 keras-mxnet kerascv

Or if you prefer TensorFlow backend:

pip install tensorflow kerascv

To enable/disable different hardware supports, check out installation instruction for the corresponding backend.

After installation check that the backend field is set to the correct value in the file ~/.keras/keras.json. It is also preferable to set the value of the image_data_format field to channels_first in the case of using the MXNet backend.

Usage

Example of using a pretrained ResNet-18 model (for channels_first data format):

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 (ImageNet-1K)

Some remarks:

  • All quality values are estimated with MXNet backend.
  • 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 model means that the model was trained on MXNet/Gluon and then converted to Keras.
Model Top1 Top5 Params FLOPs/2 Remarks
AlexNet 40.47 17.88 62,378,344 1,132.33M Converted from GL model (log)
AlexNet-b 41.08 18.53 61,100,840 714.83M Converted from GL model (log)
ZFNet 39.56 17.15 62,357,608 1,170.33M Converted from GL model (log)
ZFNet-b 36.30 14.83 107,627,624 2,479.13M Converted from GL model (log)
VGG-11 29.59 10.16 132,863,336 7,615.87M Converted from GL model (log)
VGG-13 28.37 9.50 133,047,848 11,317.65M Converted from GL model (log)
VGG-16 26.61 8.32 138,357,544 15,480.10M Converted from GL model (log)
VGG-19 25.58 7.67 143,667,240 19,642.55M Converted from GL model (log)
BN-VGG-11 28.55 9.34 132,866,088 7,630.21M Converted from GL model (log)
BN-VGG-13 27.68 8.87 133,050,792 11,341.62M Converted from GL model (log)
BN-VGG-16 25.50 7.57 138,361,768 15,506.38M Converted from GL model (log)
BN-VGG-19 23.91 6.89 143,672,744 19,671.15M Converted from GL model (log)
BN-VGG-11b 29.24 9.75 132,868,840 7,630.72M Converted from GL model (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 34.59 13.85 5,418,792 894.04M Converted from GL model (log)
ResNet-12 33.43 13.03 5,492,776 1,126.25M Converted from GL model (log)
ResNet-14 32.18 12.20 5,788,200 1,357.94M Converted from GL model (log)
ResNet-BC-14b 30.25 11.16 10,064,936 1,479.12M Converted from GL model (log)
ResNet-16 30.23 10.88 6,968,872 1,589.34M Converted from GL model (log)
ResNet-18 x0.25 39.30 17.41 3,937,400 270.94M Converted from GL model (log)
ResNet-18 x0.5 33.40 12.83 5,804,296 608.70M Converted from GL model (log)
ResNet-18 x0.75 29.98 10.66 8,476,056 1,129.45M Converted from GL model (log)
ResNet-18 28.08 9.52 11,689,512 1,820.41M Converted from GL model (log)
ResNet-26 26.12 8.37 17,960,232 2,746.79M Converted from GL model (log)
ResNet-BC-26b 24.85 7.59 15,995,176 2,356.67M Converted from GL model (log)
ResNet-34 24.53 7.44 21,797,672 3,672.68M Converted from GL model (log)
ResNet-BC-38b 23.48 6.72 21,925,416 3,234.21M Converted from GL model (log)
ResNet-50 22.14 6.04 25,557,032 3,877.95M Converted from GL model (log)
ResNet-50b 22.06 6.10 25,557,032 4,110.48M Converted from GL model (log)
ResNet-101 21.64 5.99 44,549,160 7,597.95M From dmlc/gluon-cv (log)
ResNet-101b 20.25 5.11 44,549,160 7,830.48M Converted from GL model (log)
ResNet-152 20.74 5.35 60,192,808 11,321.85M From dmlc/gluon-cv (log)
ResNet-152b 19.63 4.79 60,192,808 11,554.38M Converted from GL model (log)
PreResNet-10 34.65 14.01 5,417,128 894.19M Converted from GL model (log)
PreResNet-12 33.56 13.22 5,491,112 1,126.40M Converted from GL model (log)
PreResNet-14 32.29 12.19 5,786,536 1,358.09M Converted from GL model (log)
PreResNet-BC-14b 30.66 11.51 10,057,384 1,476.62M Converted from GL model (log)
PreResNet-16 30.21 10.81 6,967,208 1,589.49M Converted from GL model (log)
PreResNet-18 x0.25 39.63 17.78 3,935,960 270.93M Converted from GL model (log)
PreResNet-18 x0.5 33.67 13.19 5,802,440 608.73M Converted from GL model (log)
PreResNet-18 x0.75 29.95 10.68 8,473,784 1,129.51M Converted from GL model (log)
PreResNet-18 28.16 9.52 11,687,848 1,820.56M Converted from GL model (log)
PreResNet-26 26.02 8.34 17,958,568 2,746.94M Converted from GL model (log)
PreResNet-BC-26b 25.20 7.86 15,987,624 2,354.16M Converted from GL model (log)
PreResNet-34 24.55 7.51 21,796,008 3,672.83M Converted from GL model (log)
PreResNet-BC-38b 22.65 6.33 21,917,864 3,231.70M Converted from GL model (log)
PreResNet-50 22.26 6.20 25,549,480 3,875.44M Converted from GL model (log)
PreResNet-50b 22.35 6.32 25,549,480 4,107.97M Converted from GL model (log)
PreResNet-101 21.43 5.75 44,541,608 7,595.44M From dmlc/gluon-cv (log)
PreResNet-101b 20.84 5.40 44,541,608 7,827.97M Converted from GL model (log)
PreResNet-152 20.69 5.31 60,185,256 11,319.34M From dmlc/gluon-cv (log)
PreResNet-152b 19.89 5.00 60,185,256 11,551.87M Converted from GL model (log)
PreResNet-200b 21.09 5.64 64,666,280 15,068.63M From tornadomeet/ResNet (log)
PreResNet-269b 20.71 5.56 102,065,832 20,101.11M From soeaver/mxnet-model (log)
ResNeXt-14 (16x4d) 31.65 12.24 7,127,336 1,045.77M Converted from GL model (log)
ResNeXt-14 (32x2d) 32.15 12.46 7,029,416 1,031.32M Converted from GL model (log)
ResNeXt-14 (32x4d) 29.95 11.10 9,411,880 1,603.46M Converted from GL model (log)
ResNeXt-26 (32x2d) 26.34 8.50 9,924,136 1,461.06M Converted from GL model (log)
ResNeXt-26 (32x4d) 23.91 7.20 15,389,480 2,488.07M Converted from GL model (log)
ResNeXt-50 (32x4d) 20.64 5.46 25,028,904 4,255.86M From dmlc/gluon-cv (log)
ResNeXt-101 (32x4d) 19.62 4.92 44,177,704 8,003.45M From dmlc/gluon-cv (log)
ResNeXt-101 (64x4d) 19.28 4.83 83,455,272 15,500.27M From dmlc/gluon-cv (log)
SE-ResNet-10 33.55 13.29 5,463,332 894.27M Converted from GL model (log)
SE-ResNet-18 27.95 9.20 11,778,592 1,820.88M Converted from GL model (log)
SE-ResNet-26 25.42 8.03 18,093,852 2,747.49M Converted from GL model (log)
SE-ResNet-BC-26b 23.44 6.82 17,395,976 2,359.58M Converted from GL model (log)
SE-ResNet-BC-38b 21.44 5.75 24,026,616 3,238.58M Converted from GL model (log)
SE-ResNet-50 22.50 6.43 28,088,024 3,880.49M From Cadene/pretrained...pytorch (log)
SE-ResNet-50b 20.58 5.33 28,088,024 4,115.78M Converted from GL model (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-PreResNet-10 33.60 13.06 5,461,668 894.42M Converted from GL model (log)
SE-PreResNet-18 27.67 9.38 11,776,928 1,821.03M Converted from GL model (log)
SE-PreResNet-BC-26b 22.95 6.36 17,388,424 2,357.07M Converted from GL model (log)
SE-PreResNet-BC-38b 21.42 5.63 24,019,064 3,236.07M Converted from GL model (log)
SE-ResNeXt-50 (32x4d) 20.03 5.05 27,559,896 4,261.16M From dmlc/gluon-cv (log)
SE-ResNeXt-101 (32x4d) 19.07 4.60 48,955,416 8,012.73M From dmlc/gluon-cv (log)
SE-ResNeXt-101 (64x4d) 18.98 4.66 88,232,984 15,509.54M From dmlc/gluon-cv (log)
SENet-16 25.34 8.06 31,366,168 5,081.30M Converted from GL model (log)
SENet-28 21.68 5.91 36,453,768 5,732.71M Converted from GL model (log)
SENet-154 18.83 4.65 115,088,984 20,745.78M From Cadene/pretrained...pytorch (log)
DenseNet-121 23.23 6.84 7,978,856 2,872.13M Converted from GL model (log)
DenseNet-161 22.39 6.18 28,681,000 7,793.16M From dmlc/gluon-cv (log)
DenseNet-169 22.09 6.05 14,149,480 3,403.89M Converted from GL model (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.0 39.40 17.80 1,248,424 823.67M 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)
1.5-SqNxt-23 34.59 13.30 1,511,824 552.39M Converted from GL model (log)
1.5-SqNxt-23v5 33.56 12.84 1,953,616 550.97M Converted from GL model (log)
2.0-SqNxt-23 30.15 10.66 2,583,752 898.48M Converted from GL model (log)
2.0-SqNxt-23v5 29.40 10.28 3,366,344 897.60M 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=1) 46.21 22.38 534,484 41.16M Converted from GL model (log)
ShuffleNet x0.5 (g=3) 43.82 20.60 718,324 41.70M Converted from GL model (log)
ShuffleNet x0.75 (g=1) 39.24 16.75 975,214 86.42M Converted from GL model (log)
ShuffleNet x0.75 (g=3) 37.81 16.09 1,238,266 85.82M Converted from GL model (log)
ShuffleNet x1.0 (g=1) 34.41 13.50 1,531,936 148.13M Converted from GL model (log)
ShuffleNet x1.0 (g=2) 33.97 13.32 1,733,848 147.60M Converted from GL model (log)
ShuffleNet x1.0 (g=3) 33.96 13.29 1,865,728 145.46M Converted from GL model (log)
ShuffleNet x1.0 (g=4) 33.83 13.10 1,968,344 143.33M Converted from GL model (log)
ShuffleNet x1.0 (g=8) 33.64 13.20 2,434,768 150.76M 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 27.32 9.27 4,406,098 320.77M Converted from GL model (log)
ShuffleNetV2 x2.0 25.77 8.22 7,601,686 595.84M Converted from GL model (log)
ShuffleNetV2b x0.5 39.81 17.83 1,366,792 43.31M Converted from GL model (log)
ShuffleNetV2b x1.0 30.38 11.01 2,279,760 150.62M Converted from GL model (log)
ShuffleNetV2b x1.5 26.89 8.80 4,410,194 323.98M Converted from GL model (log)
ShuffleNetV2b x2.0 25.18 8.10 7,611,290 603.37M 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) 27.85 9.36 3,368,128 312.00M Converted from GL model (log)
352-MENet-12x1 (g=8) 31.29 11.67 2,272,872 157.35M Converted from GL model (log)
456-MENet-24x1 (g=3) 25.00 7.80 5,304,784 567.90M Converted from GL model (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 55.42 30.52 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 29.76 10.44 2,627,592 198.50M Converted from GL model (log)
MobileNetV2 x1.0 26.76 8.64 3,504,960 329.36M Converted from GL model (log)
MobileNetV3 L/224/1.0 24.63 7.69 5,481,752 227.09M 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 x0.75 30.71 10.97 2,638,084 210.95M Converted from GL model (log)
IGCV3 x1.0 27.72 8.99 3,491,688 340.79M Converted from GL model (log)
MnasNet-B1 25.76 8.00 4,383,312 326.30M From rwightman/pyt...models (log)
MnasNet-A1 25.02 7.55 3,887,038 326.07M From rwightman/pyt...models (log)
EfficientNet-B0 24.50 7.22 5,288,548 414.31M Converted from GL model (log)
EfficientNet-B1 22.89 6.26 7,794,184 732.54M Converted from GL model (log)
EfficientNet-B0b 22.95 6.69 5,288,548 414.31M From rwightman/pyt...models (log)
EfficientNet-B1b 20.97 5.64 7,794,184 732.54M From rwightman/pyt...models (log)
EfficientNet-B2b 19.93 5.16 9,109,994 1,051.98M From rwightman/pyt...models (log)
EfficientNet-B3b 18.59 4.31 12,233,232 1,928.55M From rwightman/pyt...models (log)
EfficientNet-B4b 17.24 3.76 19,341,616 4,607.46M From rwightman/pyt...models (log)
EfficientNet-B5b 16.39 3.34 30,389,784 10,695.20M From rwightman/pyt...models (log)
EfficientNet-B6b 15.96 3.12 43,040,704 19,796.24M From rwightman/pyt...models (log)
EfficientNet-B7b 15.70 3.11 66,347,960 39,010.98M From rwightman/pyt...models (log)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kerascv-0.0.40.tar.gz (75.8 kB view details)

Uploaded Source

Built Distribution

kerascv-0.0.40-py2.py3-none-any.whl (102.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file kerascv-0.0.40.tar.gz.

File metadata

  • Download URL: kerascv-0.0.40.tar.gz
  • Upload date:
  • Size: 75.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5

File hashes

Hashes for kerascv-0.0.40.tar.gz
Algorithm Hash digest
SHA256 eb42eb62cd8b87be0611b2fa92b02386e5b3fb20cc68081065a7154b3fc59d65
MD5 b3d1d6759827670bb5a9afebc24e40f5
BLAKE2b-256 3b9667c0362488c0fc5d0e9c56ea7d7b90589e05ff1ffbd37ed8019cef2708f0

See more details on using hashes here.

File details

Details for the file kerascv-0.0.40-py2.py3-none-any.whl.

File metadata

  • Download URL: kerascv-0.0.40-py2.py3-none-any.whl
  • Upload date:
  • Size: 102.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5

File hashes

Hashes for kerascv-0.0.40-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2064cd57df6c51f72d39ad2cc45a7edd752a46fa868203bfd3a5a9a402a46cd9
MD5 b7598c660e503b8bf8104fdb4ad4a35e
BLAKE2b-256 f06839f12a9c48b91ca4634a43d048ccfd1c32506de3ccde25191cbd77154384

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page