Skip to main content

Image classification models for TensorFlow

Project description

Large-scale image classification models on TensorFlow

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 tensorflowcv package with tensorflow:

pip install tensorflowcv tensorflow>=1.11.0

To enable/disable different hardware supports, check out TensorFlow installation instructions.

Usage

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

from tensorflowcv.model_provider import get_model as tfcv_get_model
from tensorflowcv.model_provider import init_variables_from_state_dict as tfcv_init_variables_from_state_dict
import tensorflow as tf
import numpy as np

net = tfcv_get_model("resnet18", pretrained=True, data_format="channels_first")
x = tf.placeholder(dtype=tf.float32, shape=(None, 3, 224, 224), name="xx")
y_net = net(x)

with tf.Session() as sess:
    tfcv_init_variables_from_state_dict(sess=sess, state_dict=net.state_dict)
    x_value = np.zeros((1, 3, 224, 224), np.float32)
    y = sess.run(y_net, feed_dict={x: x_value})

Pretrained models (ImageNet-1K)

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 model means that the model was trained on MXNet/Gluon and then converted to TensorFlow.
Model Top1 Top5 Params FLOPs/2 Remarks
AlexNet 44.07 21.32 61,100,840 714.83M From dmlc/gluon-cv (log)
VGG-11 31.89 11.73 132,863,336 7,615.87M From dmlc/gluon-cv (log)
VGG-13 31.03 11.15 133,047,848 11,317.65M From dmlc/gluon-cv (log)
VGG-16 26.77 8.68 138,357,544 15,480.10M From dmlc/gluon-cv (log)
VGG-19 25.93 8.23 143,667,240 19,642.55M From dmlc/gluon-cv (log)
BN-VGG-11 28.55 9.36 132,866,088 7,630.21M Converted from GL model (log)
BN-VGG-13 27.73 8.88 133,050,792 11,341.62M Converted from GL model (log)
BN-VGG-16 25.48 7.55 138,361,768 15,506.38M Converted from GL model (log)
BN-VGG-19 23.88 6.89 143,672,744 19,671.15M Converted from GL model (log)
BN-VGG-11b 30.34 10.58 132,868,840 7,630.72M From dmlc/gluon-cv (log)
BN-VGG-13b 29.47 10.15 133,053,736 11,342.14M From dmlc/gluon-cv (log)
BN-VGG-16b 26.83 8.66 138,365,992 15,507.20M From dmlc/gluon-cv (log)
BN-VGG-19b 25.62 8.17 143,678,248 19,672.26M From dmlc/gluon-cv (log)
ResNet-10 34.62 13.90 5,418,792 894.04M Converted from GL model (log)
ResNet-12 33.36 13.00 5,492,776 1,126.25M Converted from GL model (log)
ResNet-14 32.22 12.25 5,788,200 1,357.94M Converted from GL model (log)
ResNet-BC-14b 30.25 11.21 10,064,936 1,479.12M Converted from GL model (log)
ResNet-16 30.25 10.86 6,968,872 1,589.34M Converted from GL model (log)
ResNet-18 x0.25 39.32 17.41 3,937,400 270.94M Converted from GL model (log)
ResNet-18 x0.5 33.36 12.87 5,804,296 608.70M Converted from GL model (log)
ResNet-18 x0.75 30.00 10.69 8,476,056 1,129.45M Converted from GL model (log)
ResNet-18 28.16 9.56 11,689,512 1,820.41M Converted from GL model (log)
ResNet-26 26.13 8.38 17,960,232 2,746.79M Converted from GL model (log)
ResNet-BC-26b 24.81 7.57 15,995,176 2,356.67M Converted from GL model (log)
ResNet-34 24.57 7.42 21,797,672 3,672.68M Converted from GL model (log)
ResNet-BC-38b 23.51 6.73 21,925,416 3,234.21M Converted from GL model (log)
ResNet-50 22.14 6.05 25,557,032 3,877.95M Converted from GL model (log)
ResNet-50b 22.03 6.09 25,557,032 4,110.48M Converted from GL model (log)
ResNet-101 21.61 6.01 44,549,160 7,597.95M From dmlc/gluon-cv (log)
ResNet-101b 20.29 5.07 44,549,160 7,830.48M Converted from GL model (log)
ResNet-152 20.73 5.35 60,192,808 11,321.85M From dmlc/gluon-cv (log)
ResNet-152b 20.27 5.23 60,192,808 11,554.38M From dmlc/gluon-cv (log)
PreResNet-10 34.71 14.01 5,417,128 894.19M Converted from GL model (log)
PreResNet-12 33.58 13.21 5,491,112 1,126.40M Converted from GL model (log)
PreResNet-14 32.30 12.16 5,786,536 1,358.09M Converted from GL model (log)
PreResNet-BC-14b 30.80 11.53 10,057,384 1,476.62M Converted from GL model (log)
PreResNet-16 30.23 10.82 6,967,208 1,589.49M Converted from GL model (log)
PreResNet-18 x0.25 39.66 17.76 3,935,960 270.93M Converted from GL model (log)
PreResNet-18 x0.5 33.73 13.18 5,802,440 608.73M Converted from GL model (log)
PreResNet-18 x0.75 29.93 10.71 8,473,784 1,129.51M Converted from GL model (log)
PreResNet-18 28.21 9.49 11,687,848 1,820.56M Converted from GL model (log)
PreResNet-26 26.02 8.33 17,958,568 2,746.94M Converted from GL model (log)
PreResNet-BC-26b 25.24 7.89 15,987,624 2,354.16M Converted from GL model (log)
PreResNet-34 24.53 7.54 21,796,008 3,672.83M Converted from GL model (log)
PreResNet-BC-38b 22.70 6.34 21,917,864 3,231.70M Converted from GL model (log)
PreResNet-50 22.19 6.25 25,549,480 3,875.44M Converted from GL model (log)
PreResNet-50b 22.36 6.31 25,549,480 4,107.97M Converted from GL model (log)
PreResNet-101 21.49 5.72 44,541,608 7,595.44M From dmlc/gluon-cv (log)
PreResNet-101b 20.80 5.39 44,541,608 7,827.97M Converted from GL model (log)
PreResNet-152 20.63 5.29 60,185,256 11,319.34M From dmlc/gluon-cv (log)
PreResNet-152b 20.95 5.76 60,185,256 11,551.87M From dmlc/gluon-cv (log)
PreResNet-200b 21.12 5.60 64,666,280 15,068.63M From tornadomeet/ResNet (log)
PreResNet-269b 20.73 5.55 102,065,832 20,101.11M From soeaver/mxnet-model (log)
ResNeXt-14 (32x4d) 29.95 11.13 9,411,880 1,603.46M Converted from GL model (log)
ResNeXt-26 (32x4d) 23.94 7.17 15,389,480 2,488.07M Converted from GL model (log)
ResNeXt-101 (32x4d) 21.33 5.80 44,177,704 8,003.45M From Cadene/pretrained...pytorch (log)
ResNeXt-101 (64x4d) 20.59 5.43 83,455,272 15,500.27M From Cadene/pretrained...pytorch (log)
SE-ResNet-10 33.56 13.36 5,463,332 894.27M Converted from GL model (log)
SE-ResNet-18 27.89 9.23 11,778,592 1,820.88M Converted from GL model (log)
SE-ResNet-50 22.53 6.43 28,088,024 3,880.49M From Cadene/pretrained...pytorch (log)
SE-ResNet-101 21.92 5.89 49,326,872 7,602.76M From Cadene/pretrained...pytorch (log)
SE-ResNet-152 21.48 5.78 66,821,848 11,328.52M From Cadene/pretrained...pytorch (log)
SE-ResNeXt-50 (32x4d) 21.01 5.53 27,559,896 4,258.40M From Cadene/pretrained...pytorch (log)
SE-ResNeXt-101 (32x4d) 19.99 4.97 48,955,416 8,008.26M From Cadene/pretrained...pytorch (log)
SENet-16 25.34 8.03 31,366,168 5,081.30M Converted from GL model (log)
SENet-28 21.68 5.94 36,453,768 5,732.71M Converted from GL model (log)
SENet-154 18.77 4.63 115,088,984 20,745.78M From Cadene/pretrained...pytorch (log)
DenseNet-121 23.21 6.88 7,978,856 2,872.13M Converted from GL model (log)
DenseNet-161 22.40 6.17 28,681,000 7,793.16M From dmlc/gluon-cv (log)
DenseNet-169 23.93 6.87 14,149,480 3,403.89M From dmlc/gluon-cv (log)
DenseNet-201 22.70 6.35 20,013,928 4,347.15M From dmlc/gluon-cv (log)
DarkNet Tiny 40.35 17.51 1,042,104 500.85M Converted from GL model (log)
DarkNet Ref 37.99 16.72 7,319,416 367.59M Converted from GL model (log)
DarkNet-53 21.42 5.55 41,609,928 7,133.86M From dmlc/gluon-cv (log)
SqueezeNet v1.0 39.18 17.58 1,248,424 823.67M Converted from GL model (log)
SqueezeNet v1.1 39.14 17.39 1,235,496 352.02M Converted from GL model (log)
SqueezeResNet v1.0 39.36 17.82 1,248,424 823.67M Converted from GL model (log)
SqueezeResNet v1.1 39.75 17.92 1,235,496 352.02M Converted from GL model (log)
1.0-SqNxt-23 45.41 21.08 724,056 287.28M Converted from GL model (log)
1.0-SqNxt-23v5 44.68 20.77 921,816 285.82M Converted from GL model (log)
1.5-SqNxt-23 37.11 15.09 1,511,824 552.39M Converted from GL model (log)
1.5-SqNxt-23v5 37.33 15.39 1,953,616 550.97M Converted from GL model (log)
2.0-SqNxt-23 32.44 12.35 2,583,752 898.48M Converted from GL model (log)
2.0-SqNxt-23v5 32.19 12.13 3,366,344 897.60M Converted from GL model (log)
ShuffleNet x0.25 (g=1) 62.03 36.80 209,746 12.35M Converted from GL model (log)
ShuffleNet x0.25 (g=3) 61.33 36.17 305,902 13.09M Converted from GL model (log)
ShuffleNet x0.5 (g=1) 46.25 22.31 534,484 41.16M Converted from GL model (log)
ShuffleNet x0.5 (g=3) 43.89 20.63 718,324 41.70M Converted from GL model (log)
ShuffleNet x0.75 (g=1) 39.26 16.78 975,214 86.42M Converted from GL model (log)
ShuffleNet x0.75 (g=3) 37.89 16.13 1,238,266 85.82M Converted from GL model (log)
ShuffleNet x1.0 (g=1) 34.48 13.51 1,531,936 148.13M Converted from GL model (log)
ShuffleNet x1.0 (g=2) 33.97 13.33 1,733,848 147.60M Converted from GL model (log)
ShuffleNet x1.0 (g=3) 33.93 13.32 1,865,728 145.46M Converted from GL model (log)
ShuffleNet x1.0 (g=4) 33.89 13.13 1,968,344 143.33M Converted from GL model (log)
ShuffleNet x1.0 (g=8) 33.65 13.21 2,434,768 150.76M Converted from GL model (log)
ShuffleNetV2 x0.5 40.88 18.44 1,366,792 43.31M Converted from GL model (log)
ShuffleNetV2 x1.0 31.02 11.31 2,278,604 149.72M Converted from GL model (log)
ShuffleNetV2 x1.5 27.33 9.23 4,406,098 320.77M Converted from GL model (log)
ShuffleNetV2 x2.0 25.80 8.21 7,601,686 595.84M Converted from GL model (log)
ShuffleNetV2b x0.5 39.80 17.84 1,366,792 43.31M Converted from GL model (log)
ShuffleNetV2b x1.0 30.40 11.04 2,279,760 150.62M Converted from GL model (log)
ShuffleNetV2b x1.5 26.92 8.80 4,410,194 323.98M Converted from GL model (log)
ShuffleNetV2b x2.0 25.20 8.10 7,611,290 603.37M Converted from GL model (log)
108-MENet-8x1 (g=3) 43.67 20.32 654,516 42.68M Converted from GL model (log)
128-MENet-8x1 (g=4) 42.04 19.15 750,796 45.98M Converted from GL model (log)
160-MENet-8x1 (g=8) 43.53 20.28 850,120 45.63M Converted from GL model (log)
228-MENet-12x1 (g=3) 33.85 12.92 1,806,568 152.93M Converted from GL model (log)
256-MENet-12x1 (g=4) 32.19 12.19 1,888,240 150.65M Converted from GL model (log)
348-MENet-12x1 (g=3) 27.87 9.35 3,368,128 312.00M Converted from GL model (log)
352-MENet-12x1 (g=8) 31.31 11.69 2,272,872 157.35M Converted from GL model (log)
456-MENet-24x1 (g=3) 24.96 7.79 5,304,784 567.90M Converted from GL model (log)
MobileNet x0.25 45.78 22.21 470,072 44.09M Converted from GL model (log)
MobileNet x0.5 33.85 13.31 1,331,592 155.42M Converted from GL model (log)
MobileNet x0.75 29.82 10.49 2,585,560 333.99M Converted from GL model (log)
MobileNet x1.0 26.45 8.67 4,231,976 579.80M Converted from GL model (log)
FD-MobileNet x0.25 55.50 30.50 383,160 12.95M Converted from GL model (log)
FD-MobileNet x0.5 42.67 19.70 993,928 41.84M Converted from GL model (log)
FD-MobileNet x0.75 37.95 16.02 1,833,304 86.68M Converted from GL model (log)
FD-MobileNet x1.0 33.78 13.18 2,901,288 147.46M Converted from GL model (log)
MobileNetV2 x0.25 48.18 24.16 1,516,392 34.24M Converted from GL model (log)
MobileNetV2 x0.5 35.56 14.46 1,964,736 100.13M Converted from GL model (log)
MobileNetV2 x0.75 29.80 10.44 2,627,592 198.50M Converted from GL model (log)
MobileNetV2 x1.0 26.79 8.62 3,504,960 329.36M Converted from GL model (log)
IGCV3 x0.25 53.39 28.35 1,534,020 41.29M Converted from GL model (log)
IGCV3 x0.5 39.38 17.05 1,985,528 111.12M Converted from GL model (log)
IGCV3 x0.75 30.80 10.96 2,638,084 210.95M Converted from GL model (log)
IGCV3 x1.0 27.67 9.03 3,491,688 340.79M Converted from GL model (log)
MnasNet 31.29 11.44 4,308,816 317.67M From zeusees/Mnasnet...Model (log)

Project details


Download files

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

Files for tensorflowcv, version 0.0.34
Filename, size File type Python version Upload date Hashes
Filename, size tensorflowcv-0.0.34-py2.py3-none-any.whl (99.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size tensorflowcv-0.0.34.tar.gz (60.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page