Keras之inception_v3使用(单张图片测试)
一、安装
必要:tensorflow,Keras
首次运行需要安装:
1)下载模型权重 inception_v3_weights_tf_dim_ordering_tf_kernels.h5
路径见前一篇
2)安装h5py
pip install h5py
3)安装PIL
遇到pip无法安装,以pillow替代,见Stack Overflow
二、参数说明
分类结果:
ImageNet的1000种object,对应模型分类结果的1000 classes:
text: imagenet 1000 class id to human readable labels
https://github.com/cjyanyi/keras_deep_learning_tutorial/blob/master/imagenet1000_clsid_to_human.txt
三、代码示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
input_image 是一个默认大小:1*299*299*3 的4维向量(列表)
分类: machine learning