#-*- coding:utf-8 -*-### required libaraiedimport osimport matplotlib.image as imgimport matplotlib.pyplot as pltimport skimagefrom skimage import color, data, transformfrom scipy import ndimageimport numpy as npimport tensorflow as tffrom IPython.co…
# coding: utf-8 # In[1]:import osimport numpy as npfrom skimage import color, data, transform, io # In[34]: import tensorflow as tfimport numpy as np train10_images = np.load('train10_images.npy')train10_labels = np.load('train10_labels.npy') y=tf.pl…
import osimport kerasimport timeimport numpy as npimport tensorflow as tffrom random import shufflefrom keras.utils import np_utilsfrom skimage import color, data, transform, io trainDataDirList = os.listdir("F:\\MachineLearn\\ML-xiaoxueqi\\fruits\\t…
import osimport numpy as npimport matplotlib.pyplot as pltfrom skimage import color,data,transform,io labelList = os.listdir("F:\\MachineLearn\\ML-xiaoxueqi\\fruits\\Training")allFruitsImageName = []for i in range(10): allFruitsImageName.append(…
import osimport numpy as npimport matplotlib.pyplot as pltfrom skimage import color,data,transform,io labelList = os.listdir("F:\\MachineLearn\\ML-xiaoxueqi\\fruits\\Training")allFruitsImageName = []for i in range(len(labelList)): allFruitsImage…
import osimport numpy as npimport matplotlib.pyplot as pltfrom PIL import Image, ImageChopsfrom skimage import color,data,transform,io #获取所有数据文件夹名称fileList = os.listdir("F:\\data\\flowers")trainDataList = []trianLabel = []testDataList = []testLa…
import osimport numpy as npimport matplotlib.pyplot as pltfrom PIL import Image, ImageChopsfrom skimage import color,data,transform,io #获取所有数据文件夹名称fileList = os.listdir("F:\\data\\flowers")trainDataList = []trianLabel = []testDataList = []testLa…
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt def distort_color(image, color_ordering=0): ''' 随机调整图片的色彩,定义两种处理顺序. ''' if color_ordering == 0: image = tf.image.random_brightness(image, max_delta=32./255.) image = tf.image.…
import glob import os.path import numpy as np import tensorflow as tf from tensorflow.python.platform import gfile import tensorflow.contrib.slim as slim # 加载通过TensorFlow-Slim定义好的inception_v3模型. import tensorflow.contrib.slim.python.slim.nets.incepti…
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt # 使用'r'会出错,无法解码,只能以2进制形式读取 # img_raw = tf.gfile.FastGFile('E:\\myresource\\moutance.jpg','rb').read() img_raw = open('E:\\myresource\\moutance.jpg','rb').read() # 把二进制文件解码为uin…