2020
12-10
12-10
使用python操作lmdb对数据读取的实例
由于c++速度快,所以一般写入数据我调用c++借口,而读取数据使用c++也行,但有时候Python在某方面方便,所以通过使用python借口仅仅对lmdb文件读取,处理数据是图片importlmdbimportnumpyasnpimportcv2lmdb_file="/home/rui/demo"lmdb_env=lmdb.open(lmdb_file)lmdb_txn=lmdb_env.begin()lmdb_cursor=lmdb_txn.cursor()forkey,valueinlmdb_cursor:img=cv2.imdecode(np.fromstring(value,np.uint8),3);cv2...
继续阅读 >