data_process.py 文件源码

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

项目:pytorch_crowd_count 作者: BingzheWu 项目源码 文件源码
def read_lmdb(lmdb_path):
    env = lmdb.open(lmdb_path)
    with env.begin() as txn:
        cursor = txn.cursor()
        for (idx, (key, value)) in enumerate(cursor):
            image = np.fromstring(value, dtype = np.float32)
            #image = np.reshape(image, (3,225,225))/255.0
            image = np.reshape(image, (27, 27))
            #image = image.transpose((1,2,0))
            print(image)
            plt.imshow(image, cmap = 'hot')
            plt.show()
            break
        #image = txn.get('0')
        #image = np.fromstring(image)[0]
        #print image.shape
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号