Package: tensorflowcv
Large-scale image classification models on TensorFlowThis is a collection of large-scale image classification models. Many of them are pretrained onImageNet-1Kdataset and loaded automatically during use. All pretrained models require the
same ordinary normalization. Scripts for training/evaluating/converting models are in theimgclsmobrepo.List of implemented modelsAlexNet ('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')ChannelNet ('ChannelNets: Compact and Efficient Convolutional Neural Networks via Channel-Wise Convolutions')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')InstallationTo use the models in your project, simply install thetensorflowcvpackage withtensorflow:pip install tensorflowcv tensorflow>=1.11.0To enable/disable different hardware supports, check out TensorFlow installationinstructions.UsageExample of using a pretrained ResNet-18 model (withchannels_firstdata 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.RemarkConverted from GL modelmeans that the model was trained onMXNet/Gluonand then converted to TensorFlow.ModelTop1Top5ParamsFLOPs/2RemarksAlexNet40.4417.8862,378,3441,132.33MConverted from GL model (log)AlexNet-b41.0518.5361,100,840714.83MConverted from GL model (log)ZFNet39.5117.1562,357,6081,170.33MConverted from GL model (log)ZFNet-b36.3014.82107,627,6242,479.13MConverted from GL model (log)VGG-1129.5810.15132,863,3367,615.87MConverted from GL model (log)VGG-1328.349.46133,047,84811,317.65MConverted from GL model (log)VGG-1626.658.30138,357,54415,480.10MConverted from GL model (log)VGG-1925.607.68143,667,24019,642.55MConverted from GL model (log)BN-VGG-1128.559.36132,866,0887,630.21MConverted from GL model (log)BN-VGG-1327.738.88133,050,79211,341.62MConverted from GL model (log)BN-VGG-1625.487.55138,361,76815,506.38MConverted from GL model (log)BN-VGG-1923.886.89143,672,74419,671.15MConverted from GL model (log)BN-VGG-11b29.219.79132,868,8407,630.72MConverted from GL model (log)BN-VGG-13b29.4710.15133,053,73611,342.14MFromdmlc/gluon-cv(log)BN-VGG-16b26.838.66138,365,99215,507.20MFromdmlc/gluon-cv(log)BN-VGG-19b25.628.17143,678,24819,672.26MFromdmlc/gluon-cv(log)ResNet-1034.6213.905,418,792894.04MConverted from GL model (log)ResNet-1233.3613.005,492,7761,126.25MConverted from GL model (log)ResNet-1432.2212.255,788,2001,357.94MConverted from GL model (log)ResNet-BC-14b30.2511.2110,064,9361,479.12MConverted from GL model (log)ResNet-1630.2510.866,968,8721,589.34MConverted from GL model (log)ResNet-18 x0.2539.3217.413,937,400270.94MConverted from GL model (log)ResNet-18 x0.533.3612.875,804,296608.70MConverted from GL model (log)ResNet-18 x0.7530.0010.698,476,0561,129.45MConverted from GL model (log)ResNet-1828.169.5611,689,5121,820.41MConverted from GL model (log)ResNet-2626.138.3817,960,2322,746.79MConverted from GL model (log)ResNet-BC-26b24.817.5715,995,1762,356.67MConverted from GL model (log)ResNet-3424.577.4221,797,6723,672.68MConverted from GL model (log)ResNet-BC-38b23.516.7321,925,4163,234.21MConverted from GL model (log)ResNet-5022.146.0525,557,0323,877.95MConverted from GL model (log)ResNet-50b22.036.0925,557,0324,110.48MConverted from GL model (log)ResNet-10121.616.0144,549,1607,597.95MFromdmlc/gluon-cv(log)ResNet-101b20.295.0744,549,1607,830.48MConverted from GL model (log)ResNet-15220.735.3560,192,80811,321.85MFromdmlc/gluon-cv(log)ResNet-152b19.614.8560,192,80811,554.38MConverted from GL model (log)PreResNet-1034.7114.015,417,128894.19MConverted from GL model (log)PreResNet-1233.5813.215,491,1121,126.40MConverted from GL model (log)PreResNet-1432.3012.165,786,5361,358.09MConverted from GL model (log)PreResNet-BC-14b30.8011.5310,057,3841,476.62MConverted from GL model (log)PreResNet-1630.2310.826,967,2081,589.49MConverted from GL model (log)PreResNet-18 x0.2539.6617.763,935,960270.93MConverted from GL model (log)PreResNet-18 x0.533.7313.185,802,440608.73MConverted from GL model (log)PreResNet-18 x0.7529.9310.718,473,7841,129.51MConverted from GL model (log)PreResNet-1828.219.4911,687,8481,820.56MConverted from GL model (log)PreResNet-2626.028.3317,958,5682,746.94MConverted from GL model (log)PreResNet-BC-26b25.247.8915,987,6242,354.16MConverted from GL model (log)PreResNet-3424.537.5421,796,0083,672.83MConverted from GL model (log)PreResNet-BC-38b22.706.3421,917,8643,231.70MConverted from GL model (log)PreResNet-5022.196.2525,549,4803,875.44MConverted from GL model (log)PreResNet-50b22.366.3125,549,4804,107.97MConverted from GL model (log)PreResNet-10121.495.7244,541,6087,595.44MFromdmlc/gluon-cv(log)PreResNet-101b20.805.3944,541,6087,827.97MConverted from GL model (log)PreResNet-15220.635.2960,185,25611,319.34MFromdmlc/gluon-cv(log)PreResNet-152b19.875.0060,185,25611,551.87MConverted from GL model (log)PreResNet-200b21.125.6064,666,28015,068.63MFromtornadomeet/ResNet(log)PreResNet-269b20.735.55102,065,83220,101.11MFromsoeaver/mxnet-model(log)ResNeXt-14 (16x4d)31.6512.247,127,3361,045.77MConverted from GL model (log)ResNeXt-14 (32x2d)32.1112.467,029,4161,031.32MConverted from GL model (log)ResNeXt-14 (32x4d)29.9511.139,411,8801,603.46MConverted from GL model (log)ResNeXt-26 (32x2d)26.298.499,924,1361,461.06MConverted from GL model (log)ResNeXt-26 (32x4d)23.947.1715,389,4802,488.07MConverted from GL model (log)ResNeXt-50 (32x4d)20.655.4625,028,9044,255.86MFromdmlc/gluon-cv(log)ResNeXt-101 (32x4d)19.614.9344,177,7048,003.45MFromdmlc/gluon-cv(log)ResNeXt-101 (64x4d)19.274.8583,455,27215,500.27MFromdmlc/gluon-cv(log)SE-ResNet-1033.5613.365,463,332894.27MConverted from GL model (log)SE-ResNet-1827.899.2311,778,5921,820.88MConverted from GL model (log)SE-ResNet-2625.448.0918,093,8522,747.49MConverted from GL model (log)SE-ResNet-BC-26b23.446.8117,395,9762,359.58MConverted from GL model (log)SE-ResNet-BC-38b21.435.7824,026,6163,238.58MConverted from GL model (log)SE-ResNet-5022.536.4328,088,0243,880.49MFromCadene/pretrained...pytorch(log)SE-ResNet-50b20.605.3328,088,0244,115.78MConverted from GL model (log)SE-ResNet-10121.925.8949,326,8727,602.76MFromCadene/pretrained...pytorch(log)SE-ResNet-15221.485.7866,821,84811,328.52MFromCadene/pretrained...pytorch(log)SE-PreResNet-1033.6713.095,461,668894.42MConverted from GL model (log)SE-PreResNet-1827.679.4111,776,9281,821.03MConverted from GL model (log)SE-PreResNet-BC-26b22.966.3417,388,4242,357.07MConverted from GL model (log)SE-PreResNet-BC-38b21.375.6424,019,0643,236.07MConverted from GL model (log)SE-ResNeXt-50 (32x4d)19.955.0727,559,8964,261.16MFromdmlc/gluon-cv(log)SE-ResNeXt-101 (32x4d)19.024.6148,955,4168,012.73MFromdmlc/gluon-cv(log)SE-ResNeXt-101 (64x4d)19.024.6588,232,98415,509.54MFromdmlc/gluon-cv(log)SENet-1625.348.0331,366,1685,081.30MConverted from GL model (log)SENet-2821.685.9436,453,7685,732.71MConverted from GL model (log)SENet-15418.774.63115,088,98420,745.78MFromCadene/pretrained...pytorch(log)DenseNet-12123.216.887,978,8562,872.13MConverted from GL model (log)DenseNet-16122.406.1728,681,0007,793.16MFromdmlc/gluon-cv(log)DenseNet-16922.136.0614,149,4803,403.89MConverted from GL model (log)DenseNet-20122.706.3520,013,9284,347.15MFromdmlc/gluon-cv(log)DarkNet Tiny40.3517.511,042,104500.85MConverted from GL model (log)DarkNet Ref37.9916.727,319,416367.59MConverted from GL model (log)DarkNet-5321.425.5541,609,9287,133.86MFromdmlc/gluon-cv(log)SqueezeNet v1.039.1817.581,248,424823.67MConverted from GL model (log)SqueezeNet v1.139.1417.391,235,496352.02MConverted from GL model (log)SqueezeResNet v1.039.3617.821,248,424823.67MConverted from GL model (log)SqueezeResNet v1.139.7517.921,235,496352.02MConverted from GL model (log)1.0-SqNxt-2345.4121.08724,056287.28MConverted from GL model (log)1.0-SqNxt-23v544.6820.77921,816285.82MConverted from GL model (log)1.5-SqNxt-2337.1115.091,511,824552.39MConverted from GL model (log)1.5-SqNxt-23v537.3315.391,953,616550.97MConverted from GL model (log)2.0-SqNxt-2332.4412.352,583,752898.48MConverted from GL model (log)2.0-SqNxt-23v532.1912.133,366,344897.60MConverted from GL model (log)ShuffleNet x0.25 (g=1)62.0336.80209,74612.35MConverted from GL model (log)ShuffleNet x0.25 (g=3)61.3336.17305,90213.09MConverted from GL model (log)ShuffleNet x0.5 (g=1)46.2522.31534,48441.16MConverted from GL model (log)ShuffleNet x0.5 (g=3)43.8920.63718,32441.70MConverted from GL model (log)ShuffleNet x0.75 (g=1)39.2616.78975,21486.42MConverted from GL model (log)ShuffleNet x0.75 (g=3)37.8916.131,238,26685.82MConverted from GL model (log)ShuffleNet x1.0 (g=1)34.4813.511,531,936148.13MConverted from GL model (log)ShuffleNet x1.0 (g=2)33.9713.331,733,848147.60MConverted from GL model (log)ShuffleNet x1.0 (g=3)33.9313.321,865,728145.46MConverted from GL model (log)ShuffleNet x1.0 (g=4)33.8913.131,968,344143.33MConverted from GL model (log)ShuffleNet x1.0 (g=8)33.6513.212,434,768150.76MConverted from GL model (log)ShuffleNetV2 x0.540.8818.441,366,79243.31MConverted from GL model (log)ShuffleNetV2 x1.031.0211.312,278,604149.72MConverted from GL model (log)ShuffleNetV2 x1.527.339.234,406,098320.77MConverted from GL model (log)ShuffleNetV2 x2.025.808.217,601,686595.84MConverted from GL model (log)ShuffleNetV2b x0.539.8017.841,366,79243.31MConverted from GL model (log)ShuffleNetV2b x1.030.4011.042,279,760150.62MConverted from GL model (log)ShuffleNetV2b x1.526.928.804,410,194323.98MConverted from GL model (log)ShuffleNetV2b x2.025.208.107,611,290603.37MConverted from GL model (log)108-MENet-8x1 (g=3)43.6720.32654,51642.68MConverted from GL model (log)128-MENet-8x1 (g=4)42.0419.15750,79645.98MConverted from GL model (log)160-MENet-8x1 (g=8)43.5320.28850,12045.63MConverted from GL model (log)228-MENet-12x1 (g=3)33.8512.921,806,568152.93MConverted from GL model (log)256-MENet-12x1 (g=4)32.1912.191,888,240150.65MConverted from GL model (log)348-MENet-12x1 (g=3)27.879.353,368,128312.00MConverted from GL model (log)352-MENet-12x1 (g=8)31.3111.692,272,872157.35MConverted from GL model (log)456-MENet-24x1 (g=3)24.967.795,304,784567.90MConverted from GL model (log)MobileNet x0.2545.7822.21470,07244.09MConverted from GL model (log)MobileNet x0.533.8513.311,331,592155.42MConverted from GL model (log)MobileNet x0.7529.8210.492,585,560333.99MConverted from GL model (log)MobileNet x1.026.458.674,231,976579.80MConverted from GL model (log)FD-MobileNet x0.2555.5030.50383,16012.95MConverted from GL model (log)FD-MobileNet x0.542.6719.70993,92841.84MConverted from GL model (log)FD-MobileNet x0.7537.9516.021,833,30486.68MConverted from GL model (log)FD-MobileNet x1.033.7813.182,901,288147.46MConverted from GL model (log)MobileNetV2 x0.2548.1824.161,516,39234.24MConverted from GL model (log)MobileNetV2 x0.535.5614.461,964,736100.13MConverted from GL model (log)MobileNetV2 x0.7529.8010.442,627,592198.50MConverted from GL model (log)MobileNetV2 x1.026.798.623,504,960329.36MConverted from GL model (log)IGCV3 x0.2553.3928.351,534,02041.29MConverted from GL model (log)IGCV3 x0.539.3817.051,985,528111.12MConverted from GL model (log)IGCV3 x0.7530.8010.962,638,084210.95MConverted from GL model (log)IGCV3 x1.027.679.033,491,688340.79MConverted from GL model (log)MnasNet-B125.738.004,383,312326.30MFrom [rwightman/pyt...models] (log)MnasNet-A125.007.563,887,038326.07MFrom [rwightman/pyt...models] (log)