TensorRT  7.2.1.6
NVIDIA TensorRT
Looking for a C++ dev who knows TensorRT?
I'm looking for work. Hire me!
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
batchPrepare Namespace Reference

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()
 

Variable Documentation

◆ height

int batchPrepare.height = 300

◆ width

int batchPrepare.width = 300

◆ NUM_BATCHES

int batchPrepare.NUM_BATCHES = 0

◆ NUM_PER_BATCH

int batchPrepare.NUM_PER_BATCH = 1

◆ NUM_CALIBRATION_IMAGES

int batchPrepare.NUM_CALIBRATION_IMAGES = 50

◆ parser

batchPrepare.parser = argparse.ArgumentParser()

◆ required

batchPrepare.required

◆ True

batchPrepare.True

◆ help

batchPrepare.help

◆ args

batchPrepare.args = parser.parse_args()

◆ CALIBRATION_DATASET_LOC

string batchPrepare.CALIBRATION_DATASET_LOC = args.inDir + '/*.jpg'

◆ imgs

list batchPrepare.imgs = []

◆ outDir

string batchPrepare.outDir = args.outDir+"/batches"

◆ img

int batchPrepare.img = 0

◆ batchfile

string batchPrepare.batchfile = outDir + "/batch_calibration" + str(i) + ".batch"

◆ batchlistfile

string batchPrepare.batchlistfile = outDir + "/batch_calibration" + str(i) + ".list"

◆ batchlist

batchPrepare.batchlist = open(batchlistfile,'a')

◆ batch

batchPrepare.batch = np.zeros(shape=(NUM_PER_BATCH, 3, height, width), dtype = np.float32)

◆ im

batchPrepare.im = Image.open(imgs[img]).resize((width,height), Image.NEAREST)

◆ in_

batchPrepare.in_ = np.array(im, dtype=np.float32, order='C')

◆ ba

batchPrepare.ba = bytearray(struct.pack("4i", batch.shape[0], batch.shape[1], batch.shape[2], batch.shape[3]))

◆ content

batchPrepare.content = f.read()