lmdb数据格式
2024-08-22 00:43:15
http://deepdish.io/2015/04/28/creating-lmdb-in-python/
https://lmdb.readthedocs.org/en/release/
https://github.com/BVLC/caffe/issues/1698#issuecomment-70211045
lmdb的安装:https://lmdb.readthedocs.org/en/release/
参考文献3:
import caffe
import lmdb
from PIL import Image
in_db = lmdb.open('image-lmdb', map_size=int(1e12))
with in_db.begin(write=True) as in_txn:
for in_idx, in_ in enumerate(inputs):
# load image:
# - as np.uint8 {0, ..., 255}
# - in BGR (switch from RGB)
# - in Channel x Height x Width order (switch from H x W x C)
im = np.array(Image.open(in_)) # or load whatever ndarray you need
im = im[:,:,::-1]
im = im.transpose((2,0,1))
im_dat = caffe.io.array_to_datum(im)
in_txn.put('{:0>10d}'.format(in_idx), im_dat.SerializeToString())
in_db.close()
最新文章
- OleDbDataReader快速数据读取方式
- [PaPaPa][需求说明书][V2.0]
- linux下调整音量大小
- ASP.NET中的母版页机制
- 剑指OFFER之二进制中1的个数(九度OJ1513)
- 【iOS】MD5数据加密和网络安全
- sql server drop talbe 自动删除关联的外键 ,权限体系(二)
- PIE使用阴影后的背景透明方法
- NetStream.appendBytes, 走向Flash P2P VOD的第一步
- Java中parse()和valueOf(),toString()的区别
- [转]结合HierarchyViewer和APK文件反编译获得APP元素id值
- Java学习笔记16---抽象类与接口的浅显理解
- HttpClient 通过代理访问验证服务器
- Lubuntu下小巧好用的Python编辑工具Geany
- boost的named_mutex的一些坑
- ELK日志分析方案
- PHP日常模拟业务的小工具
- Node.js中文乱码解决方法
- mybatis入门--mybatis和hibernate比较
- 路由其实也可以很简单-------Asp.net WebAPI学习笔记(一)
热门文章
- [LeetCode] 82. Remove Duplicates from Sorted List II_Medium tag: Linked List
- kylin与superset整合
- 2018 eclipse安装反编译插件
- RC1意思
- Union、Union All、Intersect、Minus用法和区别
- POI之Excel导入
- confluence wiki 安装
- 解决use -D_SCL_SECURE_NO_WARNINGS的问题
- CSU 1963 Feed the rabbit(斜率优化dp)
- Tinkoff Challenge - Elimination Round B. Igor and his way to work(dfs+优化)