深度学习模型在图像分类中的应用
1. Inception - v3模型的使用
1.1 Keras实现
可以使用Keras框架来使用Inception - v3模型进行图像分类。以下是具体的代码实现:
import os
import numpy as np
from keras.applications import InceptionV3
from keras.applications.inception_v3 import preprocess_input, decode_predictions
from keras.preprocessing import image as image_utils
from keras import utils
def preprocess_image(im):
# Load the image and resize it to the target size of (299, 299).
img = utils.load_img(im, target_size=(299, 299))
# Convert the loaded image to a NumPy array.
img = utils.img_to_array(img)
# Add an additional dimension to the array to represent batch size (1).
img = np.expand_dims(img, axis=0)
#
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



