- 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/
models/VballNetFastV1_155_h288_w512.onnx
models/VballNetFastV1_seq9_grayscale_233_h288_w512.onnx
models/VballNetV1_150_h288_w512.onnx
models/VballNetV1_seq9_grayscale_148_h288_w512.onnx
models/VballNetV1_seq9_grayscale_204_h288_w512.onnx
models/VballNetV1_seq9_grayscale_330_h288_w512.onnx
models/VballNetV1b_seq9_grayscale_best.onnx
models/VballNetV1c_seq9_grayscale_best.onnx
models/VballNetV2_seq9_grayscale_320_h288_w512.onnx
onnxruntimecan run on CPU if CUDA provider is unavailable.- All scripts support
--helpand can be launched throughuv run.