ImageReader.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:deeplearning 作者: zxjzxj9 项目源码 文件源码
def __next__(self):
        tmp = self.fdata.read(self.nrows*self.ncols)
        if tmp == "": raise StopIteration
        #image = np.array(struct.unpack("{0}B", tmp), dtype=np.byte). \
        #                reshape((self.nrows, self.ncols))
        # notice we shall normalize the input
        image = np.array(struct.unpack("{0}B".format(self.nrows*self.ncols), tmp), dtype=np.float32) / 256.0
        #print np.max(image), np.min(image)
        return image
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号