MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / main

Function main

samples/python/efficientnet/infer.py:127–142  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

125
126
127def main(args):
128 trt_infer = TensorRTInfer(args.engine)
129 batcher = ImageBatcher(args.input, *trt_infer.input_spec(), preprocessor=args.preprocessor)
130 for batch, images in batcher.get_batch():
131 classes, scores, top = trt_infer.infer(batch)
132 for i in range(len(images)):
133 if args.top == 1:
134 print(images[i], classes[i], scores[i], sep=args.separator)
135 else:
136 line = [images[i]]
137 assert args.top <= top[0].shape[1]
138 for t in range(args.top):
139 line.append(str(top[0][i][t]))
140 for t in range(args.top):
141 line.append(str(top[1][i][t]))
142 print(args.separator.join(line))
143
144
145if __name__ == "__main__":

Callers 1

infer.pyFile · 0.70

Calls 7

input_specMethod · 0.95
get_batchMethod · 0.95
inferMethod · 0.95
ImageBatcherClass · 0.90
printFunction · 0.85
TensorRTInferClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected