摘要:        
from keras.utils.np_utils import * # 类别向量定义 b = [0, 1, 2, 3, 4, 5, 6, 7, 8] # 调用to_categorical将b按照9个类别来进行转换 b = to_categorical(b, 9) print(b) 来源:https    
阅读全文
摘要:        
img = np.array(im) R,G,B=im.split() r=np.array(R) g=np.array(G) b=np.array(B) print(r[0]) print(g[0]) print(b[0]) print(im.getpixel((0,0)))    
阅读全文
摘要:        
1. 数组的操作: import numpy as np a = np.array([[1, 2], [3, 4]]) print(a) print(type(a)) print(np.mean(a)) print(np.mean(a, axis=0)) # axis=0,计算每一列的均值 prin    
阅读全文
摘要:        
import numpy as np from PIL import Image import pickle import os CHANNEL = 3 WIDTH = 32 HEIGHT = 32 data = [] labels=[] classification = ['airplane','automobile','bird','cat','deer','dog','frog...    
阅读全文