利用Xception网络判断图片是不是狗,更多办法,查阅
https://keras-cn.readthedocs.io/en/latest/other/application/
from keras.applications import *
import cv2
import numpy as np
model_pre = xception.Xception(weights='imagenet')
Dogs = set(['n02085620', 'n02085782', 'n02085936', 'n02086079', 'n02086240', 'n02086646', 'n02086910', 'n02087046', 'n02087394', 'n02088094', 'n02088238',
'n02088364', 'n02088466', 'n02088632', 'n02089078', 'n02089867', 'n02089973', 'n02090379', 'n02090622', 'n02090721', 'n02091032', 'n02091134',
'n02091244', 'n02091467', 'n02091635', 'n02091831', 'n02092002', 'n02092339', 'n02093256', 'n02093428', 'n02093647', 'n02093754', 'n02093859',
'n02093991', 'n02094114', 'n02094258', 'n02094433', 'n02095314', 'n02095570', 'n02095889', 'n02096051', 'n02096177', 'n02096294', 'n02096437',
'n02096585'

本文介绍使用Xception深度学习模型来判断一张图片是否为狗的方法。通过加载预训练权重,设置狗的ImageNet类别ID,并对输入图片进行预处理,实现对图片中狗的精确识别。
最低0.47元/天 解锁文章
602





