# -*- coding: utf-8 -*-
"""
此文件由 LuWu 自动生成
"""
import tensorflow as tf

{{data_preprocess_template}}

# 定义编号->类别的映射
num_to_classes_map = {{num_classes_map}}
# 加载训练好的模型
model = tf.keras.models.load_model("{{model_path}}")
# 加载并预处理图片
image = read_image("/path/to/image")
# 进行预测，并输出结果
outputs = model.predict(tf.reshape(image, (-1, {{image_size}}, {{image_size}}, 3)))
index = int(tf.argmax(outputs[0]))
print("当前图片类别为：{}".format(num_to_classes_map[index]))