Предварительно обученная сеть VGG16

In [3]:
from keras.applications.vgg16 import VGG16
from keras.preprocessing import image
from keras.applications.vgg16 import preprocess_input, decode_predictions
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from scipy.misc import toimage
%matplotlib inline 

Загружаем предварительно обученную нейронную сеть VGG16

In [2]:
model = VGG16(weights='imagenet')
Downloading data from https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels.h5
553467904/553467096 [==============================] - 725s 1us/step
In [0]:
model.summary()
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
input_1 (InputLayer)         (None, 224, 224, 3)       0         
_________________________________________________________________
block1_conv1 (Conv2D)        (None, 224, 224, 64)      1792      
_________________________________________________________________
block1_conv2 (Conv2D)        (None, 224, 224, 64)      36928     
_________________________________________________________________
block1_pool (MaxPooling2D)   (None, 112, 112, 64)      0         
_________________________________________________________________
block2_conv1 (Conv2D)        (None, 112, 112, 128)     73856     
_________________________________________________________________
block2_conv2 (Conv2D)        (None, 112, 112, 128)     147584    
_________________________________________________________________
block2_pool (MaxPooling2D)   (None, 56, 56, 128)       0         
_________________________________________________________________
block3_conv1 (Conv2D)        (None, 56, 56, 256)       295168    
_________________________________________________________________
block3_conv2 (Conv2D)        (None, 56, 56, 256)       590080    
_________________________________________________________________
block3_conv3 (Conv2D)        (None, 56, 56, 256)       590080    
_________________________________________________________________
block3_pool (MaxPooling2D)   (None, 28, 28, 256)       0         
_________________________________________________________________
block4_conv1 (Conv2D)        (None, 28, 28, 512)       1180160   
_________________________________________________________________
block4_conv2 (Conv2D)        (None, 28, 28, 512)       2359808   
_________________________________________________________________
block4_conv3 (Conv2D)        (None, 28, 28, 512)       2359808   
_________________________________________________________________
block4_pool (MaxPooling2D)   (None, 14, 14, 512)       0         
_________________________________________________________________
block5_conv1 (Conv2D)        (None, 14, 14, 512)       2359808   
_________________________________________________________________
block5_conv2 (Conv2D)        (None, 14, 14, 512)       2359808   
_________________________________________________________________
block5_conv3 (Conv2D)        (None, 14, 14, 512)       2359808   
_________________________________________________________________
block5_pool (MaxPooling2D)   (None, 7, 7, 512)         0         
_________________________________________________________________
flatten (Flatten)            (None, 25088)             0         
_________________________________________________________________
fc1 (Dense)                  (None, 4096)              102764544 
_________________________________________________________________
fc2 (Dense)                  (None, 4096)              16781312  
_________________________________________________________________
predictions (Dense)          (None, 1000)              4097000   
=================================================================
Total params: 138,357,544
Trainable params: 138,357,544
Non-trainable params: 0
_________________________________________________________________

Загружаем картинку

Просматриваем картинку

In [6]:
filename = 'plane.jpg'
img = image.load_img(filename, target_size=(224, 224))
plt.imshow(img)
plt.show()

Преобразуем картинку в массив

In [7]:
x = image.img_to_array(img)
x = np.expand_dims(x, axis=0)
x = preprocess_input(x)

Запускаем распознавание

In [8]:
preds = model.predict(x)
In [9]:
preds
Out[9]:
array([[3.42457081e-14, 6.56329158e-11, 4.01833775e-12, 1.67535116e-12,
        6.38400183e-12, 2.53420552e-14, 1.49601498e-15, 1.65264287e-12,
        1.96521402e-12, 1.44228976e-14, 2.41909357e-13, 2.59244037e-12,
        1.23495430e-12, 1.07686639e-13, 1.30054767e-13, 4.90098210e-14,
        1.92249276e-12, 1.64839212e-13, 1.87864633e-12, 1.53180311e-13,
        1.47084927e-13, 2.93089407e-11, 8.70595913e-13, 2.74831494e-11,
        1.55143503e-14, 3.31093727e-14, 2.80460442e-12, 2.40792548e-13,
        1.69262967e-14, 9.53195788e-14, 1.13205053e-15, 4.94432020e-15,
        3.09010134e-15, 2.22366393e-14, 8.25893580e-14, 2.73533061e-14,
        3.42450576e-14, 3.04696571e-16, 3.01160680e-15, 8.38974276e-15,
        1.39627376e-14, 3.53015105e-15, 1.55511847e-13, 6.90242225e-16,
        2.77823482e-15, 2.27029034e-15, 2.17288113e-15, 3.72825533e-15,
        1.78631350e-15, 1.47695663e-15, 1.44084065e-14, 4.03709564e-13,
        7.06571100e-14, 1.12806411e-13, 8.77120320e-15, 2.48395143e-15,
        5.62807823e-14, 2.28185645e-14, 1.56304643e-13, 8.64991793e-16,
        5.18567631e-15, 4.72743360e-15, 9.90924279e-15, 1.66373195e-15,
        1.33251348e-15, 1.39553164e-13, 3.10384106e-15, 2.67465635e-16,
        4.94117093e-15, 5.03040480e-16, 1.62828828e-15, 9.66987890e-15,
        2.57668886e-13, 6.40678482e-13, 2.85580885e-13, 3.95083619e-12,
        1.82271749e-14, 8.28317924e-15, 3.77971851e-13, 8.68752566e-14,
        3.63369447e-12, 4.35214104e-12, 3.15835005e-13, 2.82681691e-12,
        2.43671253e-14, 9.73389189e-14, 3.66580518e-13, 4.31228881e-12,
        1.00914502e-11, 2.89813520e-11, 3.22388167e-13, 3.21134822e-14,
        1.34707631e-12, 3.04697470e-14, 2.25340076e-11, 7.40626720e-15,
        7.35594420e-13, 1.52128206e-11, 1.80432091e-12, 4.94555896e-10,
        3.45877042e-11, 3.07351347e-15, 5.16305333e-16, 5.15071894e-16,
        3.18292980e-15, 1.79117769e-16, 6.65970192e-17, 6.63061118e-14,
        2.44896072e-15, 9.90120055e-14, 1.31126311e-13, 9.29879817e-14,
        1.13129192e-13, 1.37623344e-12, 8.30140752e-13, 1.10757183e-12,
        1.22261974e-15, 2.81175594e-15, 8.51916516e-15, 4.96410028e-14,
        8.23556040e-14, 1.00761108e-13, 5.55668758e-14, 2.62811305e-15,
        1.38301900e-13, 3.70791858e-14, 6.31152099e-14, 1.59798660e-10,
        3.37370041e-12, 5.06701001e-11, 6.89832956e-12, 1.49683766e-14,
        2.64502775e-13, 9.06912247e-15, 1.50099780e-10, 3.33975626e-15,
        3.60569024e-13, 2.03765126e-14, 8.13918957e-15, 2.06137754e-12,
        2.99402647e-13, 4.05440612e-12, 1.12466548e-13, 1.19178807e-11,
        1.32850717e-10, 1.74439293e-13, 1.82401750e-11, 1.32156341e-12,
        2.11857767e-12, 2.37588595e-13, 1.48911292e-13, 3.78604645e-13,
        2.03926485e-14, 1.78005383e-13, 1.88405928e-14, 4.19045732e-14,
        3.72888332e-14, 9.91798467e-14, 3.22990603e-14, 6.34258101e-15,
        8.77765525e-13, 1.81089491e-13, 3.80010151e-14, 2.34055837e-14,
        1.22329227e-14, 2.51392200e-15, 1.59377973e-14, 4.79824717e-14,
        5.09446577e-14, 8.18790782e-12, 1.25371257e-13, 1.76441588e-14,
        2.54170379e-14, 2.66344049e-13, 4.29106688e-14, 6.98892238e-14,
        3.64213732e-13, 1.50838763e-14, 1.45427578e-14, 7.13823532e-14,
        5.59540775e-15, 1.30928376e-13, 1.95089323e-14, 2.11012272e-14,
        4.59954666e-13, 2.53833331e-13, 5.81341480e-14, 3.92295110e-14,
        1.17629905e-13, 4.17236314e-13, 4.04104755e-13, 2.60066881e-14,
        6.07795606e-14, 1.11576635e-13, 2.25450341e-13, 6.36640060e-14,
        2.49155910e-14, 1.01156774e-14, 6.57241112e-15, 8.59534611e-13,
        8.59132576e-14, 2.95704487e-14, 5.33872317e-13, 8.10243105e-12,
        4.97978530e-14, 4.02400362e-13, 4.36792055e-14, 5.45361456e-12,
        4.40895394e-13, 2.02423378e-13, 4.33804170e-13, 1.60870910e-13,
        1.17935332e-11, 1.78961650e-13, 3.10335254e-13, 2.02931422e-12,
        5.93723096e-13, 1.54416180e-13, 4.98762978e-13, 9.48728401e-14,
        1.12572076e-14, 1.64006788e-14, 2.77907784e-11, 5.80937208e-13,
        1.87139976e-13, 1.15190735e-13, 1.04491838e-12, 1.87162547e-12,
        1.07079357e-13, 3.12720803e-14, 4.53270234e-14, 4.69328894e-13,
        2.32707625e-13, 4.97576935e-14, 5.67984143e-14, 1.78923499e-12,
        1.56877197e-13, 7.82490866e-14, 7.49001935e-13, 1.95959853e-13,
        3.79589453e-13, 4.39178153e-13, 4.50936760e-14, 7.32995631e-15,
        5.43303195e-14, 7.96788105e-14, 7.60545598e-14, 2.40264053e-13,
        9.37319992e-13, 1.70528468e-13, 3.39546045e-13, 2.61968572e-11,
        2.31570359e-15, 1.94072148e-13, 8.36360874e-14, 5.09910527e-13,
        1.29126893e-13, 2.75617040e-13, 5.59838703e-11, 4.33646175e-13,
        1.25174063e-14, 1.79321008e-14, 5.87157013e-15, 2.73113536e-13,
        7.67806012e-13, 2.90859865e-13, 2.37135398e-13, 4.02425142e-12,
        5.22622844e-15, 1.40763010e-14, 4.95494542e-13, 5.58246678e-15,
        3.78340242e-14, 3.21994120e-14, 4.27818512e-15, 7.44445331e-14,
        2.89651875e-13, 2.64968359e-13, 6.48424389e-14, 3.86488767e-14,
        1.00404414e-14, 1.90423662e-14, 5.02260341e-15, 3.56936770e-14,
        1.74974357e-14, 9.37494287e-15, 5.60093654e-16, 3.55893810e-15,
        3.27748430e-15, 7.76119772e-15, 8.75391769e-16, 1.95579060e-16,
        1.68098209e-15, 2.59399923e-15, 6.53587427e-14, 1.21925247e-15,
        9.47078700e-12, 4.33213122e-16, 3.60554905e-15, 1.07822229e-14,
        5.07085998e-14, 1.94762717e-12, 8.49329084e-14, 2.16510552e-13,
        8.07437992e-13, 1.16509763e-15, 1.12216273e-13, 2.44130562e-13,
        1.68215695e-14, 7.87065183e-14, 1.17907832e-12, 9.70365021e-12,
        7.77801109e-13, 1.20285760e-14, 1.08024422e-13, 2.72059149e-13,
        1.98534845e-15, 1.50175289e-11, 3.54063838e-14, 1.19249922e-12,
        2.61810945e-13, 1.53066785e-12, 4.81391101e-15, 5.97594755e-14,
        1.80586154e-14, 7.43817985e-14, 2.14370093e-13, 7.51843865e-11,
        1.23892189e-13, 1.84912456e-13, 1.77452301e-15, 1.37406820e-14,
        3.62281887e-14, 5.13295325e-14, 3.12211500e-16, 5.51332369e-16,
        1.21139950e-14, 8.88885946e-15, 1.10049959e-14, 1.79166137e-14,
        3.70198934e-14, 5.42988201e-14, 5.54800810e-16, 3.61530010e-15,
        1.75747822e-16, 7.93400556e-13, 9.98572969e-14, 9.86604258e-14,
        2.81298178e-13, 1.61532791e-14, 4.98813196e-14, 5.81705298e-14,
        4.99272686e-15, 8.25548668e-14, 1.28002806e-13, 3.39418840e-11,
        1.40282507e-13, 3.04614202e-15, 1.17007776e-14, 2.23702147e-14,
        2.06213729e-15, 3.82586656e-15, 2.41287034e-15, 2.39870943e-15,
        3.55638641e-15, 3.81197759e-14, 4.81379835e-16, 8.11101174e-16,
        3.24066166e-14, 8.30781909e-14, 6.96210327e-17, 9.57071527e-16,
        7.09817972e-15, 3.04989934e-14, 4.38179546e-15, 2.43272124e-16,
        3.10721734e-15, 2.03501296e-15, 1.68426202e-15, 1.42782413e-14,
        3.29810320e-15, 1.35185213e-14, 1.62108035e-15, 2.14751397e-14,
        8.41053996e-15, 2.16344370e-15, 3.67503540e-15, 9.20941061e-15,
        1.07068065e-14, 1.37880484e-13, 4.26054930e-14, 1.24141877e-11,
        2.21504113e-14, 9.44562438e-15, 1.33407252e-11, 3.48819693e-12,
        5.24608839e-13, 3.20498273e-15, 3.06654082e-14, 3.95646515e-14,
        5.15820568e-14, 9.27667163e-14, 5.80867878e-15, 2.24802329e-06,
        9.24650848e-01, 3.27214802e-05, 2.33258084e-14, 4.77199706e-07,
        3.09349282e-11, 7.63748786e-12, 3.67386006e-14, 4.25312607e-15,
        1.74511263e-12, 1.31628874e-11, 2.03049315e-14, 1.43694694e-13,
        4.60524587e-12, 4.51538446e-10, 1.19735277e-10, 3.06853745e-13,
        2.65536232e-15, 3.47686485e-12, 6.68574300e-13, 2.69079785e-14,
        2.97682452e-13, 4.94263755e-13, 6.25282093e-14, 1.36409628e-13,
        4.09655252e-12, 2.58905189e-11, 3.15376479e-12, 4.23766213e-14,
        4.94657687e-14, 1.79969036e-13, 1.95712765e-15, 7.88599465e-14,
        2.46920323e-12, 1.50484104e-11, 8.98491554e-14, 2.50922633e-12,
        2.38142687e-12, 1.52811168e-13, 7.53635262e-12, 5.80601241e-14,
        5.94843359e-12, 5.65656429e-14, 1.58300649e-14, 6.12664867e-12,
        2.01285776e-12, 2.34215945e-12, 4.10551548e-09, 3.68806311e-14,
        8.58190878e-14, 7.89933927e-16, 7.39734456e-15, 3.61417981e-13,
        2.47840064e-11, 3.16174766e-14, 1.69379552e-14, 4.24678942e-14,
        3.43747496e-11, 2.47452937e-13, 1.28195347e-13, 1.40739265e-12,
        1.95701643e-14, 8.64108369e-15, 3.63646474e-10, 9.85597458e-15,
        1.14285040e-11, 8.53064330e-15, 4.71801350e-14, 2.55128724e-10,
        1.35277831e-10, 1.57762171e-12, 1.30859094e-15, 3.71535571e-12,
        3.04627460e-12, 3.04135542e-13, 6.81066640e-13, 2.95533528e-11,
        2.89640246e-13, 7.09120127e-14, 3.35971112e-14, 1.51578977e-12,
        1.15212051e-09, 2.69325713e-14, 3.65144892e-14, 2.13058867e-12,
        1.50952894e-12, 1.84927108e-11, 5.42931246e-14, 2.79753755e-11,
        7.87653481e-15, 2.88095048e-15, 8.59778936e-13, 2.17528503e-16,
        2.77645257e-13, 1.29710739e-12, 8.36449020e-13, 2.43358800e-13,
        3.95109360e-15, 7.26940955e-14, 8.84908195e-13, 7.43454912e-14,
        7.86924508e-13, 1.57427240e-13, 1.13635728e-12, 9.15211984e-14,
        5.28541891e-13, 1.40990138e-13, 3.62614494e-10, 3.71993625e-12,
        2.84837930e-12, 4.69193505e-14, 1.61057647e-12, 2.43151528e-12,
        8.45396395e-15, 3.95520772e-09, 1.94662647e-10, 7.82922243e-14,
        4.89477640e-15, 2.78257438e-14, 9.00954184e-14, 2.43391895e-12,
        7.10349273e-14, 2.69105701e-12, 1.33374477e-14, 6.53274852e-13,
        4.34646868e-15, 2.49533873e-15, 2.36791142e-12, 7.75806421e-14,
        4.75028041e-16, 2.32570961e-13, 1.19317886e-13, 1.44639324e-12,
        2.76996648e-10, 2.23819747e-12, 3.12764072e-12, 4.40778294e-14,
        1.53980245e-10, 2.42914060e-13, 2.57518534e-13, 9.78276908e-14,
        9.35329610e-15, 1.98989588e-13, 2.07742528e-13, 4.35898442e-13,
        5.09174332e-15, 1.09216089e-13, 1.72967272e-13, 1.24188276e-15,
        2.73246405e-13, 6.93597604e-14, 1.20642722e-08, 9.53477297e-11,
        1.81497426e-14, 1.71808363e-08, 5.01552162e-14, 1.51397807e-12,
        2.01199907e-11, 6.12077680e-11, 1.66435754e-11, 3.29001561e-12,
        1.04413129e-16, 1.34245946e-12, 4.72454903e-15, 9.17984239e-15,
        1.50504829e-14, 2.03774259e-12, 4.55272586e-14, 3.30943801e-12,
        1.31447028e-14, 4.43093435e-12, 3.71034150e-12, 1.09842452e-12,
        1.31987994e-13, 6.19156775e-15, 9.29360281e-14, 1.46633113e-13,
        9.85654429e-14, 8.19018356e-13, 4.51132534e-12, 3.43203525e-12,
        8.90692576e-13, 2.49182185e-13, 1.68192120e-12, 1.37010206e-12,
        2.24563893e-15, 2.80238370e-13, 9.19765783e-13, 1.51573686e-13,
        3.22468594e-14, 1.46092922e-13, 3.27518774e-13, 2.79020487e-11,
        4.32801446e-14, 1.19001903e-14, 4.47851933e-14, 9.55243304e-14,
        4.99325359e-10, 7.27491594e-14, 1.52967266e-12, 4.67855084e-13,
        1.29974859e-14, 4.88630031e-14, 5.75198309e-13, 3.40130552e-14,
        4.02291183e-14, 7.65583603e-12, 2.40113681e-14, 5.43517000e-13,
        3.30918398e-13, 1.77516563e-12, 2.82962049e-13, 5.20005610e-12,
        7.07607931e-11, 2.87531433e-14, 4.33745836e-15, 3.18002494e-14,
        4.78478108e-12, 2.53512684e-12, 9.09899309e-15, 2.09741187e-13,
        1.35372345e-13, 3.19594733e-08, 3.16399359e-13, 2.12242810e-12,
        7.09944381e-10, 5.40023992e-14, 1.62006113e-14, 3.54532823e-14,
        1.54744414e-12, 1.21571878e-14, 6.94530967e-14, 3.40225461e-13,
        1.98522043e-14, 1.16398427e-12, 7.37421666e-14, 1.70819407e-14,
        3.60525547e-14, 3.11607538e-13, 2.83185307e-15, 2.01805789e-13,
        3.25576935e-12, 7.94533330e-13, 1.07292430e-12, 2.00028926e-12,
        2.20857810e-14, 7.62928335e-14, 1.33578023e-12, 1.70480576e-14,
        6.10077310e-12, 8.72564228e-13, 1.57615778e-11, 1.80921952e-14,
        9.09047230e-12, 7.54153734e-06, 2.18666011e-14, 5.16551117e-14,
        8.52259062e-12, 9.19332156e-14, 1.65389065e-13, 2.24786959e-13,
        5.46320662e-11, 4.29892372e-10, 1.25756176e-12, 3.03115302e-12,
        1.31509421e-11, 7.17281264e-16, 2.76364959e-10, 8.65565050e-11,
        1.39839597e-13, 9.18021952e-13, 9.59549280e-14, 3.86587394e-11,
        4.21639557e-13, 1.84645322e-13, 1.13234368e-12, 9.65534347e-14,
        8.37049126e-13, 5.41875572e-12, 5.78735844e-11, 1.97363369e-14,
        4.84385232e-12, 9.74738004e-14, 3.85098935e-13, 1.61439080e-15,
        9.52343998e-13, 4.66726250e-15, 1.17320086e-12, 1.67388740e-13,
        5.56688430e-13, 5.02328422e-11, 5.12513504e-11, 8.80582770e-13,
        4.96073289e-13, 1.31029817e-13, 2.63870176e-11, 2.00461070e-14,
        1.97839873e-13, 1.13306874e-06, 2.64944100e-13, 8.02732989e-13,
        7.98150879e-14, 1.80875297e-11, 4.13994902e-13, 5.12773756e-14,
        1.19134034e-11, 1.46970869e-12, 3.28499137e-13, 1.31322235e-14,
        1.23736030e-14, 9.32435552e-14, 1.73266671e-14, 1.80342445e-14,
        5.29721720e-13, 5.93658889e-12, 2.49617202e-11, 1.84820171e-12,
        5.62675015e-13, 3.49708022e-14, 1.25408147e-12, 2.43227261e-11,
        8.41592854e-12, 3.56816966e-14, 3.11137021e-14, 5.87511593e-13,
        1.43570128e-12, 7.86821695e-15, 6.45432839e-12, 1.32141964e-12,
        6.98959941e-15, 2.17389384e-10, 2.31699850e-11, 2.57671841e-13,
        9.38428141e-15, 1.85394950e-12, 4.19961688e-15, 2.27910626e-15,
        1.72709893e-12, 2.46496091e-14, 9.23055794e-13, 1.45880131e-14,
        3.20973254e-06, 4.68886641e-14, 4.17481506e-13, 1.12308188e-12,
        4.87682133e-14, 2.84101373e-14, 1.03362253e-14, 2.68239930e-10,
        1.26522458e-12, 9.54462068e-14, 2.77644990e-11, 1.37995934e-10,
        8.80985416e-14, 1.92414210e-10, 1.97625380e-12, 3.17467186e-15,
        3.31831871e-12, 3.05141356e-13, 8.69712492e-14, 1.40730949e-12,
        1.04673015e-11, 3.67433135e-13, 1.06103894e-13, 5.87351652e-12,
        2.26971150e-10, 1.76595041e-11, 8.29484398e-12, 2.31850807e-13,
        2.35790597e-12, 3.25438766e-14, 2.54920020e-14, 1.24393930e-13,
        2.64693442e-14, 2.21830085e-14, 4.70553941e-14, 1.67890910e-11,
        4.01640873e-11, 6.55400942e-11, 4.74195544e-11, 1.46329216e-12,
        2.71184247e-12, 1.75109005e-13, 1.01487536e-12, 5.42755814e-12,
        5.43029976e-13, 1.18926119e-14, 8.60950105e-14, 5.02541168e-11,
        1.54037959e-12, 1.85659352e-15, 5.09686911e-13, 1.06158149e-09,
        1.43756188e-12, 3.74562035e-14, 3.86827987e-14, 1.19291100e-12,
        1.93023359e-13, 5.86712048e-13, 3.47750551e-10, 1.73971965e-11,
        3.27512370e-14, 6.65006314e-11, 6.16051394e-12, 4.28390379e-10,
        3.69120576e-12, 1.65601429e-14, 1.45712023e-12, 3.02433274e-12,
        1.50085834e-05, 4.73358027e-14, 1.99045025e-09, 9.82100577e-13,
        1.79480549e-13, 1.61755644e-11, 1.94108531e-12, 5.08677128e-12,
        3.69484738e-12, 1.27474723e-11, 5.35433243e-14, 7.08544145e-14,
        6.72470468e-15, 8.06980351e-14, 5.06809458e-14, 8.16771577e-14,
        4.46388694e-13, 4.35033216e-12, 5.23869670e-10, 9.70691118e-15,
        6.06881420e-11, 2.70648837e-09, 3.10569611e-14, 2.05523727e-12,
        7.32065884e-13, 1.96247857e-13, 1.18988112e-13, 2.87207376e-11,
        5.05089778e-14, 5.07190454e-14, 3.86368624e-14, 1.28165328e-12,
        1.29012718e-12, 1.18735743e-10, 1.38198412e-15, 2.88737072e-11,
        7.15995731e-14, 5.00890887e-13, 8.72544279e-13, 1.36545469e-10,
        9.59240500e-13, 2.66689425e-15, 1.16734481e-14, 5.63677997e-14,
        8.78769366e-12, 2.17833369e-15, 1.14511037e-12, 1.84683703e-13,
        1.67058316e-13, 1.76523377e-14, 1.75611303e-10, 3.23844805e-11,
        3.10497406e-10, 4.94897916e-12, 2.98677316e-12, 3.93594979e-09,
        4.19251188e-14, 1.24416892e-14, 4.40298969e-12, 4.63123806e-09,
        1.24084588e-11, 4.69268938e-13, 2.38393398e-13, 1.83927106e-14,
        8.40012332e-14, 5.87206878e-13, 1.92112832e-13, 2.81027666e-11,
        4.49827606e-11, 1.50078280e-14, 3.52938880e-12, 2.56751339e-14,
        1.42476363e-14, 7.87301963e-15, 7.62193173e-12, 1.00652146e-14,
        3.43811568e-12, 8.10013609e-14, 1.68697814e-12, 3.52804605e-14,
        1.05093462e-12, 2.24067692e-14, 1.38425614e-14, 1.51609164e-03,
        2.97981109e-14, 2.33508823e-13, 1.35784431e-11, 4.59376840e-13,
        5.71234249e-12, 1.91157930e-15, 6.94298135e-13, 1.27243517e-14,
        1.02251283e-13, 1.24099542e-14, 1.89277855e-15, 1.58300196e-12,
        7.37707540e-02, 1.59000336e-13, 2.25966283e-15, 2.78203838e-14,
        5.23992850e-13, 1.16905114e-11, 1.09567563e-11, 1.64017197e-13,
        8.16789128e-13, 5.51754789e-14, 4.88443650e-14, 3.23686737e-11,
        1.32346911e-10, 5.78654637e-13, 3.86367879e-14, 1.02144741e-15,
        1.52787193e-14, 2.31254352e-15, 4.70786894e-16, 2.81714180e-14,
        3.06357858e-13, 5.46727648e-13, 4.46491268e-15, 7.23980829e-15,
        2.79051481e-14, 6.59086130e-16, 3.18217430e-13, 1.05142276e-14,
        7.20641317e-15, 2.44588916e-15, 1.04680042e-14, 1.09972735e-14,
        1.46051909e-14, 9.61965260e-16, 1.23512195e-15, 1.75345619e-13,
        7.90338237e-15, 7.11151498e-15, 1.79969632e-14, 1.76495086e-14,
        6.54588840e-15, 1.18283272e-13, 5.20714982e-13, 2.45989786e-14,
        2.83942490e-15, 2.02913434e-14, 6.33470435e-13, 3.00274768e-17,
        2.53461502e-15, 1.08024009e-13, 4.16356533e-12, 1.73003398e-15,
        5.62564979e-15, 7.73557159e-15, 1.42934851e-16, 2.12238538e-14,
        1.25925678e-15, 1.33126415e-14, 5.78716437e-13, 3.83319441e-14,
        5.11045850e-13, 2.82970414e-15, 1.66406625e-10, 1.78932972e-13,
        6.96734163e-12, 3.65805433e-12, 1.16937892e-11, 6.04591516e-11,
        2.61133698e-13, 4.85479643e-11, 1.51333512e-11, 3.96645043e-12,
        7.44315859e-11, 9.99694511e-12, 1.41340973e-13, 7.55635918e-12,
        4.57167420e-12, 2.99580713e-14, 8.54043601e-17, 1.17271481e-13,
        1.12431308e-14, 1.91518784e-12, 9.43262031e-16, 3.97989035e-14,
        1.47047901e-13, 1.20647760e-16, 4.48636760e-14, 4.84261848e-14,
        6.89371571e-15, 1.49817215e-17, 1.31365315e-14, 4.71599159e-13]],
      dtype=float32)
In [10]:
print('Результаты распознавания:', decode_predictions(preds, top=3)[0])
Downloading data from https://s3.amazonaws.com/deep-learning-models/image-models/imagenet_class_index.json
40960/35363 [==================================] - 0s 4us/step
Результаты распознавания: [('n02690373', 'airliner', 0.92465085), ('n04592741', 'wing', 0.073770754), ('n04552348', 'warplane', 0.0015160916)]