Variables | |
int | height = 300 |
int | width = 300 |
int | NUM_BATCHES = 0 |
int | NUM_PER_BATCH = 1 |
int | NUM_CALIBRATION_IMAGES = 50 |
parser = argparse.ArgumentParser() | |
required | |
True | |
help | |
args = parser.parse_args() | |
string | CALIBRATION_DATASET_LOC = args.inDir + '/*.jpg' |
list | imgs = [] |
string | outDir = args.outDir+"/batches" |
int | img = 0 |
string | batchfile = outDir + "/batch_calibration" + str(i) + ".batch" |
string | batchlistfile = outDir + "/batch_calibration" + str(i) + ".list" |
batchlist = open(batchlistfile,'a') | |
batch = np.zeros(shape=(NUM_PER_BATCH, 3, height, width), dtype = np.float32) | |
im = Image.open(imgs[img]).resize((width,height), Image.NEAREST) | |
in_ = np.array(im, dtype=np.float32, order='C') | |
ba = bytearray(struct.pack("4i", batch.shape[0], batch.shape[1], batch.shape[2], batch.shape[3])) | |
content = f.read() | |
int batchPrepare.height = 300 |
int batchPrepare.width = 300 |
int batchPrepare.NUM_BATCHES = 0 |
int batchPrepare.NUM_PER_BATCH = 1 |
int batchPrepare.NUM_CALIBRATION_IMAGES = 50 |
batchPrepare.parser = argparse.ArgumentParser() |
batchPrepare.required |
batchPrepare.True |
batchPrepare.help |
batchPrepare.args = parser.parse_args() |
string batchPrepare.CALIBRATION_DATASET_LOC = args.inDir + '/*.jpg' |
list batchPrepare.imgs = [] |
string batchPrepare.outDir = args.outDir+"/batches" |
int batchPrepare.img = 0 |
string batchPrepare.batchfile = outDir + "/batch_calibration" + str(i) + ".batch" |
string batchPrepare.batchlistfile = outDir + "/batch_calibration" + str(i) + ".list" |
batchPrepare.batchlist = open(batchlistfile,'a') |
batchPrepare.batch = np.zeros(shape=(NUM_PER_BATCH, 3, height, width), dtype = np.float32) |
batchPrepare.in_ = np.array(im, dtype=np.float32, order='C') |
batchPrepare.ba = bytearray(struct.pack("4i", batch.shape[0], batch.shape[1], batch.shape[2], batch.shape[3])) |
batchPrepare.content = f.read() |