用AI模型识别图像是桌子、猫、狗,还是其他 # -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import sys nets_path=r'slim' if nets_path not in sys.path: sys.path.insert(0,nets_path) else: print('already add slim') import tensorflow as tf form PIL import Image import matplotlib.pyplot as plt from nets.nasnet import pnasnet import numpy as np from datasets import imagenet slim=tf.contrib.slim tf.reset_default_graph() '''获得图片的尺寸''' image_size=pnasnet.build_pnasnet_large.default_iamge_size labels=imagenet.create_readable_name_for_imagenet_labels() print(len(labels),labels) def getone(onestr)