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/

lmdb的一些封装函数:http://nbviewer.jupyter.org/github/joyofdata/joyofdata-articles/blob/master/deeplearning-with-caffe/Neural-Networks-with-Caffe-on-the-GPU.ipynb

参考文献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()

最新文章

  1. OleDbDataReader快速数据读取方式
  2. [PaPaPa][需求说明书][V2.0]
  3. linux下调整音量大小
  4. ASP.NET中的母版页机制
  5. 剑指OFFER之二进制中1的个数(九度OJ1513)
  6. 【iOS】MD5数据加密和网络安全
  7. sql server drop talbe 自动删除关联的外键 ,权限体系(二)
  8. PIE使用阴影后的背景透明方法
  9. NetStream.appendBytes, 走向Flash P2P VOD的第一步
  10. Java中parse()和valueOf(),toString()的区别
  11. [转]结合HierarchyViewer和APK文件反编译获得APP元素id值
  12. Java学习笔记16---抽象类与接口的浅显理解
  13. HttpClient 通过代理访问验证服务器
  14. Lubuntu下小巧好用的Python编辑工具Geany
  15. boost的named_mutex的一些坑
  16. ELK日志分析方案
  17. PHP日常模拟业务的小工具
  18. Node.js中文乱码解决方法
  19. mybatis入门--mybatis和hibernate比较
  20. 路由其实也可以很简单-------Asp.net WebAPI学习笔记(一)

热门文章

  1. [LeetCode] 82. Remove Duplicates from Sorted List II_Medium tag: Linked List
  2. kylin与superset整合
  3. 2018 eclipse安装反编译插件
  4. RC1意思
  5. Union、Union All、Intersect、Minus用法和区别
  6. POI之Excel导入
  7. confluence wiki 安装
  8. 解决use -D_SCL_SECURE_NO_WARNINGS的问题
  9. CSU 1963 Feed the rabbit(斜率优化dp)
  10. Tinkoff Challenge - Elimination Round B. Igor and his way to work(dfs+优化)