summaryrefslogtreecommitdiff
path: root/tools/convert_imageset.cpp
diff options
context:
space:
mode:
authorEvan Shelhamer <shelhamer@imaginarynumber.net>2014-09-21 15:20:47 -0700
committerEvan Shelhamer <shelhamer@imaginarynumber.net>2014-09-21 15:35:16 -0700
commita6693464787b63d805f077961cb39eb96698807f (patch)
treecbfa362f5b3ccb877d11474fe7fbf275c7668a61 /tools/convert_imageset.cpp
parente5cc609138a0bc4ce5177a67cf84952756d11b38 (diff)
downloadcaffeonacl-a6693464787b63d805f077961cb39eb96698807f.tar.gz
caffeonacl-a6693464787b63d805f077961cb39eb96698807f.tar.bz2
caffeonacl-a6693464787b63d805f077961cb39eb96698807f.zip
default backend to lmdb for image conversion and mean computation
lmdb is 10-15% faster than leveldb although it takes ~1.1x the storage. This is usually irrelevant in prefetching since both are fast enough, but more important lmdb allows multiple, concurrent reads for training and evaluation several models on the same data.
Diffstat (limited to 'tools/convert_imageset.cpp')
-rw-r--r--tools/convert_imageset.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/tools/convert_imageset.cpp b/tools/convert_imageset.cpp
index 1c58f3de..7e1e83d9 100644
--- a/tools/convert_imageset.cpp
+++ b/tools/convert_imageset.cpp
@@ -1,17 +1,12 @@
-// This program converts a set of images to a leveldb by storing them as Datum
-// proto buffers.
+// This program converts a set of images to a lmdb/leveldb by storing them
+// as Datum proto buffers.
// Usage:
-// convert_imageset [-g] ROOTFOLDER/ LISTFILE DB_NAME RANDOM_SHUFFLE[0 or 1]
-// [resize_height] [resize_width]
+// convert_imageset [FLAGS] ROOTFOLDER/ LISTFILE DB_NAME
+//
// where ROOTFOLDER is the root folder that holds all the images, and LISTFILE
// should be a list of files as well as their labels, in the format as
// subfolder1/file1.JPEG 7
// ....
-// if RANDOM_SHUFFLE is 1, a random shuffle will be carried out before we
-// process the file lines.
-// Optional flag -g indicates the images should be read as
-// single-channel grayscale. If omitted, grayscale images will be
-// converted to color.
#include <gflags/gflags.h>
#include <glog/logging.h>
@@ -38,7 +33,7 @@ DEFINE_bool(gray, false,
"When this option is on, treat images as grayscale ones");
DEFINE_bool(shuffle, false,
"Randomly shuffle the order of images and their labels");
-DEFINE_string(backend, "leveldb", "The backend for storing the result");
+DEFINE_string(backend, "lmdb", "The backend for storing the result");
DEFINE_int32(resize_width, 0, "Width images are resized to");
DEFINE_int32(resize_height, 0, "Height images are resized to");