您当前的位置:首页 > IT编程 > cnn卷积神经网络
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch |

自学教程:利用ResNet50网络进行ImageNet分类

51自学网 2020-03-04 09:17:17
  cnn卷积神经网络
这篇教程利用ResNet50网络进行ImageNet分类写得很实用,希望能帮到您。

利用ResNet50网络进行ImageNet分类


 
  1. from keras.applications.resnet50 import ResNet50
  2. from keras.preprocessing import image
  3. from keras.applications.resnet50 import preprocess_input, decode_predictions
  4. import numpy as np
  5.  
  6. model = ResNet50(weights='imagenet')
  7. #仅仅这样就可以
  8. img_path = 'elephant.jpg'
  9. img = image.load_img(img_path, target_size=(224, 224))
  10. x = image.img_to_array(img)
  11. x = np.expand_dims(x, axis=0)
  12. x = preprocess_input(x)
  13.  
  14. preds = model.predict(x)
  15. # decode the results into a list of tuples (class, description, probability)
  16. # (one such list for each sample in the batch)
  17. print('Predicted:', decode_predictions(preds, top=3)[0])
  18. # Predicted: [(u'n02504013', u'Indian_elephant', 0.82658225), (u'n01871265', u'tusker', 0.1122357), (u'n02504458

 


keras画图cnn
keras笔记(3)-猫狗数据集上的训练以及单张图片多张图片的测试
51自学网,即我要自学网,自学EXCEL、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。
京ICP备13026421号-1