lmdb_detect.py 文件源码

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

项目:DeepID2 作者: chenzeyuczy 项目源码 文件源码
def detect_lmdb(path):
    env = lmdb.open(path, readonly=False)
    print "Info of lmdb at", path
    for key, value in env.stat().items():
        print key, ":", value

    datum = caffe.proto.caffe_pb2.Datum()
    with env.begin() as txn:
        cursor = txn.cursor()
        cursor.next()
        key, value = cursor.key(), cursor.value()
        datum.ParseFromString(value)
        label = datum.label
        data = caffe.io.datum_to_array(datum)
        print "Data shape:", data.shape
    env.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号