Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Ping Pong Sport Analytics

Computer vision pipeline for table tennis analysis β€” player tracking with persistent identity, ball tracking, and bounce detection.

⚠️ This repository showcases the methodology and results. Source code and trained models are not included.

Demo


Pipeline

Video Input
    β”‚
    β”œβ”€β”€ Players ──── YOLO (fine-tuned) β†’ ByteTrack β†’ OSNet ReID
    β”œβ”€β”€ Ball ─────── YOLO (fine-tuned) + CVAT correction for demo
    β”œβ”€β”€ Table ────── YOLO-Seg (fine-tuned)
    └── Bounces ──── scipy.signal.find_peaks + table polygon filter

How It Works

Player Re-Identification β€” ByteTrack handles frame-to-frame tracking. When a player exits the frame and re-enters (or switches sides), OSNet compares appearance embeddings against a gallery of known players to restore the correct identity. A position-based fallback and anti-duplicate enforcement guarantee stable IDs throughout the video.

Ball Detection β€” A fine-tuned YOLO model detects the ball. Missing detections were pre-annotated by the model then manually corrected in CVAT to achieve full coverage for the demo.

Bounce Detection β€” Peak detection (find_peaks) on the ball's Y-coordinate trajectory, filtered by whether the bounce point falls within the table polygon (cv2.pointPolygonTest).

Table Detection β€” A fine-tuned YOLOv8-seg model detects the table surface. For the final output, a 4-corner polygon calibration is used.

Stack

Component Tool
Player detection YOLOv8n (fine-tuned on 2.3k images)
Player tracking ByteTrack
Player ReID OSNet x1_0 (torchreid)
Ball detection YOLOv8n (fine-tuned on 15k images)
Table detection YOLOv8n-seg (fine-tuned on 1K images)
Bounce detection scipy.signal.find_peaks
Annotation CVAT

Future Work

  • Homography-based mini-map for top-down tactical visualization
  • Serve detection and point scoring
  • Player movement heatmaps

Built by @IIIllllIlIlllII

About

πŸ“ AI-powered table tennis analytics | Player tracking, ball detection, and bounce point analysis

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors