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

Function main

samples/python/tensorflow_object_detection_api/compare_tf.py:233–244  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

231
232
233def main(args):
234 tf_infer = TensorFlowInfer(args.saved_model, args.preprocessor, args.detection_type, args.iou_threshold)
235 trt_infer = TensorRTInfer(args.engine, args.preprocessor, args.detection_type, args.iou_threshold)
236
237 trt_batcher = ImageBatcher(args.input, *trt_infer.input_spec(), max_num_images=args.num_images, preprocessor=args.preprocessor)
238 tf_infer.override_input_shape(0, [1, trt_batcher.height, trt_batcher.width, 3]) # Same size input in TF as TRT
239 tf_batcher = ImageBatcher(args.input, *tf_infer.input_spec(), max_num_images=args.num_images, preprocessor=args.preprocessor)
240
241 tf_images, tf_detections = run(tf_batcher, tf_infer, "TensorFlow", args.nms_threshold)
242 trt_images, trt_detections = run(trt_batcher, trt_infer, "TensorRT", args.nms_threshold)
243
244 compare_images(tf_images, tf_detections, trt_images, trt_detections, args.output, args.annotations, args.labels, args.detection_type)
245
246
247if __name__ == "__main__":

Callers 1

compare_tf.pyFile · 0.70

Calls 8

input_specMethod · 0.95
override_input_shapeMethod · 0.95
input_specMethod · 0.95
TensorRTInferClass · 0.90
ImageBatcherClass · 0.90
TensorFlowInferClass · 0.70
runFunction · 0.70
compare_imagesFunction · 0.70

Tested by

no test coverage detected