# Find the best implementation available try: from cStringIO import StringIO except ImportError: from StringIO import StringIO import lmdb import numpy as np import PIL.Image if __name__ == '__main__': dirname = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(dirname,'..','..','..','..')) from digits.config.load import load_config load_config() # Run load_config() first to set the path to Caffe import caffe_pb2 IMAGE_SIZE = 10 TRAIN_IMAGE_COUNT = 360 #VAL_IMAGE_COUNT = 20 def create_lmdbs(folder, image_width=None, image_height=None, image_count=None): """ Creates LMDBs for generic inference Returns the filename for a test image
# Find the best implementation available try: from cStringIO import StringIO except ImportError: from StringIO import StringIO import lmdb import numpy as np import PIL.Image if __name__ == '__main__': dirname = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(dirname, '..', '..')) from digits.config.load import load_config load_config() from digits import utils # Run load_config() first to set the path to Caffe import caffe.io import caffe_pb2 IMAGE_SIZE = 10 TRAIN_IMAGE_COUNT = 1000 VAL_IMAGE_COUNT = 1000 TEST_IMAGE_COUNT = 10 DB_BATCH_SIZE = 100 def create_lmdbs(folder,