- VPS: Tracking - ball
- Hugging Face: Tracking - ball
High-speed pipeline for volleyball ball detection, rally extraction, and automatic generation of 9:16 reels.
src/inference_onnx_seq_gray_v2.py-> detects ball and writesball.csv(and optionalpredict.mp4).src/track_calculator.py-> convertsball.csvto rally tracks (track_*.json).src/track_processor.py-> creates combined video (combined.mp4) or split rally clips.src/make_reels.py-> creates vertical 9:16 reels centered around ball trajectory.
git clone https://github.com/asigatchov/fast-volleyball-tracking-inference.git
cd fast-volleyball-tracking-inference
uv syncFor visualization (using --visualize parameter):
uv sync --extra devExample input:
- video:
examples/gtu_20250316_002.mp4 - model:
models/VballNetV1_seq9_grayscale_330_h288_w512.onnx
VIDEO="examples/gtu_20250316_002.mp4"
MODEL="models/VballNetV1_seq9_grayscale_330_h288_w512.onnx"
OUT="output"
# 1) Detection -> ball.csv
uv run src/inference_onnx_seq_gray_v2.py \
--video_path "$VIDEO" \
--model_path "$MODEL" \
--output_dir "$OUT" \
--only_csv
# 2) Tracks from CSV -> track_*.json
uv run src/track_calculator.py \
--csv_path "$OUT/gtu_20250316_002/ball.csv" \
--output_dir "$OUT"
# 3) Optional: combined horizontal rally video
uv run src/track_processor.py \
--video_path "$VIDEO" \
--output_dir "$OUT"
# 4) Vertical reels from tracks
uv run src/make_reels.py \
--video_path "$VIDEO" \
--json_dir "$OUT/gtu_20250316_002/tracks" \
--output_dir "$OUT"output/gtu_20250316_002/
├── ball.csv
├── tracks/
│ └── track_0000.json
├── combined.mp4
└── reels/
└── reel_gtu_20250316_002_0000.mp4
--confidence_threshold- heatmap threshold for detection postprocess.--visualize- show live preview.--only_csv- skip writing output video.
--court_json_path- optional court annotation JSON. If passed, net/court-aware rally filtering is enabled.--fps,--max_distance,--min_duration_sec- main tracking/filtering params.
--output_dir- auto-resolvestracksandcombined.mp4by video basename.--json_dir- explicit tracks folder.--split_dir- export each rally into a separate clip.
--smoothing {none,moving_avg,savitzky_golay,kalman}--interpolation {hold,linear}--margin- lead offset in movement direction.--padding {none,mirror,black}
--model_xml ./ov/VballNetV2_seq9_grayscale_ov.xml--video_path ./examples/gtu_20250316_002.mp4--only_csv--output_dir ./demo-result/
Benchmark setup:
- runner:
src/inference_onnx_seq_gray_v2.py - video:
match9/video/woman_transhmash_2_00004.mp4 - ground truth:
match9/csv/woman_transhmash_2_00004_ball.csv - runtime: local
onnxruntimeon CPU (CPUExecutionProvider) Acc@5px (all)= frame is correct if ball is visible and predicted within 5 px, or if both GT and prediction mark frame as invisibleAcc@5px (visible)= only GT-visible frames are evaluated, prediction must be within 5 px
| Model | FPS | Acc@5px (all) | Acc@5px (visible) |
|---|---|---|---|
VballNetV1_seq9_grayscale_148_h288_w512.onnx |
138.68 | 87.25% | 86.43% |
VballNetV1_seq9_grayscale_204_h288_w512.onnx |
138.39 | 85.95% | 84.88% |
VballNetV2_seq9_grayscale_320_h288_w512.onnx |
114.22 | 83.01% | 82.56% |
VballNetV1_seq9_grayscale_330_h288_w512.onnx |
141.04 | 82.35% | 81.78% |
VballNetV1c_seq9_grayscale_best.onnx |
142.17 | 76.80% | 74.81% |
VballNetGridV1b_seq9_grayscale_20260319_193937.onnx |
117.55 | 75.49% | 74.03% |
VballNetFastV1_seq9_grayscale_233_h288_w512.onnx |
271.86 | 73.20% | 68.99% |
VballNetV1b_seq9_grayscale_best.onnx |
142.56 | 72.88% | 70.16% |
VballNetGridV1c_seq9_grayscale_20260317.onnx |
185.85 | 64.05% | 62.02% |
VballNetFastV1_155_h288_w512.onnx |
307.56 | 15.03% | 0.00% |
VballNetV1_150_h288_w512.onnx |
149.88 | 10.13% | 0.00% |
onnxruntimecan run on CPU if CUDA provider is unavailable.- All scripts support
--helpand can be launched throughuv run.