Last update: 2026-06-01
Working clone: ~/data/vaila
Companion repo: ~/data/FIFA/FIFA-Skeletal-Tracking-Starter-Kit-2026
Use vailá modules (vaila_sam.py, soccerfield_keypoints_ai.py,
soccerfield_calib.py, plus the fifa_* pipeline) to improve the
FIFA Skeletal Tracking Light 2026 baseline that runs from the
official starter kit at ~/data/FIFA.
Strategy:
- Run SAM 3 to get clean per-player video masks (
vaila_sam.py). - Detect soccer pitch keypoints per frame to refine camera
calibration on broadcast footage (
soccerfield_keypoints_ai.py). - Convert FIFA
cameras/*.npz→ per-frame DLT2D/DLT3D and feed the reconstruction pipeline (vaila/fifa_to_dlt.py,rec2d.py/rec3d.py). - Optionally run the SAM 3D Body branch (
fifa baseline) and pack the official submission.
- Active template:
pyproject_linux_cuda12.toml(CUDA 12.8, PyTorch 2.9.1+cu128). .venvat~/data/vaila/.venvis healthy:torch.cuda.is_available() == True(RTX class GPU detected)sam3package importableultralytics,inference,supervisioninstalled
- Extras synced:
--extra gpu --extra sam. - SAM 3 weights present:
vaila/models/sam3/sam3.ptvaila/models/sam3/sam3.1_multiplex.pt
- Fix applied during the session:
opencv-python==4.10.0.84reinstalled (previous cv2 install was missingcv2.VideoCapture). - Smoke test SAM 3 succeeded on 1 video, 32 frames:
- input :
data/videos/ARG_CRO_000737.mp4(FIFA starter kit) - output :
~/data/FIFA/outputs_sam3_smoke/processed_sam_20260425_183925/
- input :
-
--extra fifanot yet synced (needed forfifa baseline,fifa preprocess, SAM 3D Body). Run when ready:bash bin/setup_fifa_sam3d.sh # clones sam_3d_body + downloads gated weights uv sync --extra gpu --extra sam --extra fifa -
A local YOLO-pose model does exist at
vaila/models/soccerfield_keypoints_yolo/football_pitch32_best.pt(.pt6.8 MB,.onnx13 MB), task=pose, kpt=[32,3]. It is collapsed (sanity test 2026-04-25 21:30): boxes are fine but every one of the 32 keypoints sits in a ~30 px cluster near the box centre. Symptom matches thesoccer-field-keypoints-yoloSKILL collapse warning (mosaic=1 + small imgsz). -
Vendored training dataset is on disk and ready for retraining:
vaila/models/hf_datasets/football-pitch-detection/data/data.yaml(kpt_shape[32, 3],flip_idxdefined; 255 train + 34 val). -
Hugging Face CLI (
hf) is broken in this venv (missingtyperdep when invoked throughuv run).vaila_sam.py --download-weightsworks around it for SAM 3 video; for SAM 3D Body / FIFA you still need a working HF auth — easiest is to log in once with the user's global Python env or setHF_TOKENin.env.
- Verified
~/data/vailaalready ships:vaila/vaila_sam.py(SAM 3 video segmentation +fifasubcommands)vaila/soccerfield_keypoints_ai.py(Ultralytics + Roboflow backend, video CSV export)vaila/soccerfield_calib.py(manual / DLT2D pitch calibration)vaila/fifa_skeletal_pipeline.py,vaila/fifa_to_dlt.py,vaila/fifa_bootstrap.py,vaila/fifa_starter_lib/
- Switched
pyproject.tomlto the Linux CUDA template. - Synced GPU + SAM extras with
uv sync --extra gpu --extra sam. - Downloaded SAM 3 video weights via
vaila/vaila_sam.py --download-weights. - Fixed a broken OpenCV install with
uv pip install --reinstall opencv-python==4.10.0.84. - Ran a successful SAM 3 smoke test on one FIFA video.
-
hf auth loginfails inside the venv (No module named 'typer').uv add typerdid not actually exposetypertouv run. For SAM 3 video weights this is irrelevant (the loader handles it), but for SAM 3D Body you must authenticate beforebash bin/setup_fifa_sam3d.sh. Recommended workaround:pipx install huggingface_hub # or use system Python hf auth login # paste HF token (read access ok) # then re-run uv sync if needed
-
soccerfield_calib.pyexpects semantic keypoint names (center_field,left_penalty_spot, …). Detector outputs genericp1, p2, …. For now, manual calibration is the safer path until you publish a mapping or train a YOLO-pose model with the vendored 32-keypoint schema.
-
Wait for the 400-epoch retrain (PID 2070719, ETA ~50 min). Monitor with:
tail -1 vaila/models/runs/pose_fifa/pitch32_recipeA_400ep/results.csv \ | awk -F',' '{printf "epoch=%s box_mAP50=%s pose_mAP50=%s\n",$1,$11,$15}'
Final
best.ptwill land atvaila/models/runs/pose_fifa/pitch32_recipeA_400ep/weights/best.pt. -
Once training is done (GPU free), run SAM 3 in batch over all 20 FIFA videos:
uv run vaila/vaila_sam.py \ -i ~/data/FIFA/FIFA-Skeletal-Tracking-Starter-Kit-2026/data/videos \ -o ~/data/FIFA/outputs_sam3 \ -t person --max-frames 64 --max-input-long-edge 1280 \ --postprocess-points foot
-
Re-run keypoints on every video with the new
best.pt:for f in ~/data/FIFA/FIFA-Skeletal-Tracking-Starter-Kit-2026/data/videos/*.mp4; do uv run python -m vaila.soccerfield_keypoints_ai \ --mode video -i "$f" -o ~/data/FIFA/outputs_pitch_kps_final \ --backend ultralytics \ --weights vaila/models/runs/pose_fifa/pitch32_recipeA_400ep/weights/best.pt \ --imgsz 1280 --conf 0.30 --draw-min-conf 0.40 \ --device 0 --stride 1 --overlay-video done
-
Map detector indices
kp_00..kp_31→ semantic point names fromvaila/models/soccerfield_ref3d.csv(usevaila/models/hf_datasets/football-pitch-detection/pitch_keypoints.pngas reference layout). -
Feed mapped points to
soccerfield_calib.pyto fit per-frame DLT2D, thenvaila/vaila_sam.py fifa dlt-exportforrec2d.py / rec3d.py. -
Only then attack
fifa baseline(needsbash bin/setup_fifa_sam3d.sh && uv sync --extra fifa).
See HISTORY.md for the chronological log and
.claude/skills/fifa-vaila-continuation/SKILL.md for ready-to-run
command blocks.
This update is outside the FIFA-specific pipeline, but matters for future agents touching GUI/video-image tools.
vaila/crop_faces_atletas.pyis now a full vailá module for athlete face photo cropping. It keeps Abel Gonçalves Chinaglia as creator.- GUI workflow: input directory first, output directory second, then automatic
download of the official MediaPipe BlazeFace short-range model into Git-ignored
vaila/models/crop_face/face_detector.task. Manual.task/.tfliteselection remains fallback when network download fails. Provision explicitly withuv run python vaila/crop_faces_atletas.py --download-model. - Main GUI integration: Frame C -> Video and Image -> C_B_r1_c2 - Crop Face.
- Documentation added:
vaila/help/crop_faces_atletas.mdvaila/help/crop_faces_atletas.html- index updates in
vaila/help/index.mdand.html
- Main Help button bug fixed in
vaila.py: usewebbrowser.open_new_tab(Path(...).as_uri())forvaila/help/index.html. Avoid shellopen/xdg-openviaos.systemthere, because user file associations can open an IDE/editor instead of a browser.
Validation run:
python3 -m py_compile vaila/crop_faces_atletas.py tests/test_crop_faces_atletas.py vaila.py
uv run ruff check vaila/crop_faces_atletas.py tests/test_crop_faces_atletas.py vaila.py
uv run ruff format --check vaila/crop_faces_atletas.py tests/test_crop_faces_atletas.py
uv run pytest tests/test_crop_faces_atletas.py -v
uv run python vaila/crop_faces_atletas.py --help
uv run python vaila/crop_faces_atletas.py --download-model