Tennis ball detection based on YOLOv5 with tensorrt

Sci Rep. 2025 Jul 1;15(1):21011. doi: 10.1038/s41598-025-06365-3.

Abstract

Tennis, as a popular competitive sport, has complex rules and requires high accuracy and fairness in penalization. To improve the accuracy and speed of the penalty, the study proposes a hawk eye detection method for tennis games based on YOLOv5 and TensorRT. First, YOLOv5 is used for target detection to achieve efficient tennis feature extraction. Second, TensorRT is introduced for inference acceleration to improve the real-time performance of the model through layer fusion and memory optimization. The experimental results show that the model achieves 94% mean average precision in the tennis ball detection task, with a combined detection error of 0.39 m and a minimum computing time of 2.28 s. The study shows that this method can significantly improve the accuracy and speed of tennis ball drop detection, which provides reliable technical support for the penalization of tennis matches.

Keywords: Hawk eye system; Object detection; Tennis; TensorRT; YOLOv5.