
数据预处理
logic~
walk slowly, never stop
展开
-
ImageMake
对图片进行样本采集并标注label,用鼠标在图片中选择要标注的区域,当鼠标左键弹起便加入样本和标签,此图片采集器默认选取28x28尺寸的图片,三类标签各1000个;如有需要可自行在代码中更改。最后处理的样本数据保存成.npy格式。原创 2017-10-19 10:24:36 · 786 阅读 · 0 评论 -
拼接数组/删除元素
矩阵拼接的函数tf.stack()与矩阵分解的函数tf.unstack()tf.unstack(value, num=None, axis=0, name='unstack') Unpacks the given dimension of a rank-`R` tensor into rank-`(R-1)` tensors. Unpacks `num` tensors ...原创 2017-11-03 15:34:37 · 1592 阅读 · 0 评论 -
网络模型 data/label预处理
one_hot处理利用keras模块import keraslabels=keras.utils.to_categorical(labels, 10)orlabels=keras.utils.np_utils.to_categorical(labels, 10)# np_utils.pydef to_categorical(y, num_classes=None):...原创 2017-08-10 15:35:41 · 1721 阅读 · 0 评论 -
python - cPickle&pickle
loadpython2def unpickle(file): import cPickle with open(file, 'rb') as fo: dict = cPickle.load(fo) return dictpython3def unpickle(file): import pickle with open(file, 'rb')原创 2017-11-14 13:14:37 · 480 阅读 · 0 评论 -
Python模块_PyLibTiff读取tif文件
Usage example (libtiff wrapper)>>> from libtiff import TIFF>>> # to open a tiff file for reading:>>> tif = TIFF.open('filename.tif', mode='r')>>> # to read an image in the currect TIFF directory an原创 2017-11-01 14:59:56 · 15033 阅读 · 5 评论 -
opencv中伪彩色applyColorMap函数
colormap(色度图) 假设我们想在地图上显示美国不同地区的温度。我们可以把美国地图上的温度数据叠加为灰度图像——较暗的区域代表较冷的温度,更明亮的区域代表较热的区域。这样的表现不仅令人难以置信,而且代表了两个重要的原因。首先,人类视觉系统没有被优化来测量灰度强度的微小变化。我们能更好地感知颜色的变化。第二,我们用不同的颜色代表不同的意思。用蓝色和较温暖的温度用红色表示较冷的温度更有意义。原创 2017-10-25 15:16:47 · 38662 阅读 · 4 评论 -
python增加矩阵维度
numpy.expand_dims(a, axis) Examples>>> x = np.array([1,2])>>> x.shape(2,)>>> y = np.expand_dims(x, axis=0)>>> yarray([[1, 2]])>>> y.shape(1, 2)>>> y = np.expand_dims(x, axis=1) # Equivalent原创 2017-10-25 14:57:18 · 41727 阅读 · 0 评论 -
python数据保存/读取
pickle模块保存.p文件import numpy as npimport pickleimg_db = np.array(img_db)zeros = np.zeros(12500, dtype=np.uint8)ones = np.ones(12500, dtype=np.uint8)labels = np.concatenate((zeros, ones))obj = {'im原创 2017-10-25 11:06:23 · 2275 阅读 · 0 评论 -
python读取.mat数据之scipy.io&h5py
读取.mat数据之scipy.io&h5py原创 2017-10-17 11:34:23 · 15001 阅读 · 0 评论 -
imgaug
https://github.com/aleju/imgaug/blob/master/imgaug/imgaug.py原创 2019-08-19 01:55:28 · 355 阅读 · 0 评论