save_images.py 文件源码

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

项目:statestream 作者: VolkerFischer 项目源码 文件源码
def writeout(self):
        """Method to save stored data to images.
        """
        for i,I in self.items.items():
            current_frame = (self.current_frame - I['offset']) % (I['offset'] + 1)
            savefile = self.save_path + os.sep + i + os.sep + str(self.current_frame).rjust(8, '0') + '.png'
            item_shape = self.net['neuron_pools'][i]['shape']
            if item_shape[0] == 1:
                dat = self.store_data[i][current_frame][0,:,:]
            elif item_shape[0] == 2:
                dat = None
            elif item_shape[0] == 3:
                dat = np.swapaxes(self.store_data[i][current_frame], 0, 2)
            Image.imsave(savefile, dat)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号