(args)
| 107 | |
| 108 | |
| 109 | def 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 | |
| 123 | if __name__ == "__main__": |
no test coverage detected