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

Function main

samples/python/efficientdet/compare_tf.py:109–120  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

107
108
109def main(args):
110 tf_infer = TensorFlowInfer(args.saved_model)
111 trt_infer = TensorRTInfer(args.engine)
112
113 trt_batcher = ImageBatcher(args.input, *trt_infer.input_spec(), max_num_images=args.num_images)
114 tf_infer.override_input_shape(0, [1, trt_batcher.height, trt_batcher.width, 3]) # Same size input in TF as TRT
115 tf_batcher = ImageBatcher(args.input, *tf_infer.input_spec(), max_num_images=args.num_images)
116
117 tf_images, tf_detections = run(tf_batcher, tf_infer, "TensorFlow", args.nms_threshold)
118 trt_images, trt_detections = run(trt_batcher, trt_infer, "TensorRT", args.nms_threshold)
119
120 compare_images(tf_images, tf_detections, trt_images, trt_detections, args.output, args.annotations, args.labels)
121
122
123if __name__ == "__main__":

Callers 1

compare_tf.pyFile · 0.70

Calls 8

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

Tested by

no test coverage detected