본문으로 건너뛰기
cccskills
무료GitHub에 공개

soccer-field-keypoints-yolo

Treino Ultralytics YOLO pose para keypoints do campo de futebol (32 kp), export ONNX, e inferência em vídeo com vaila.soccerfield_keypoints_ai (CSV getpixelvideo + overlay). Use quando o usuário fala em football pitch keypoints, YOLO26 pose, treino Roboflow/HF dataset martinjolif, field_keypoints_getpixelvideo, calibração FIFA, ou soccerfield_keypoints_ai.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md6.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Soccer field keypoints — YOLO pose + inferência vailá

Esta skill resume o que foi implementado e como retomar em outra IDE ou LLM sem perder o fio: leia este ficheiro, depois AGENTS.md (secção de handoff) e o módulo vaila/soccerfield_keypoints_ai.py.

Regra manutenção vailá (version/date)

Sempre que editar qualquer *.py no repo (ex.: vaila/soccerfield_keypoints_ai.py), também atualizar:

  • header do script: Update Date (hoje) + Version (global, do vaila.py header/banner)
  • README.md (raiz): linha Last updated: YYYY-MM-DD
  • helps: vaila/help/soccerfield_keypoints_ai.md + .html e vaila/help/index.md + .html (“Generated on”)
  • installers / vaila.py se mudança impactar install/run UX

Checklist referência: AGENTS.md (“Mandatory: Update metadata on any script change”).

Handoff rápido (outro agente)

  1. Abrir este SKILL.md.
  2. Abrir vaila/soccerfield_keypoints_ai.py — CLI/GUI, backends roboflow e ultralytics, vídeo frame-a-frame.
  3. Dataset YOLO local (pequeno, dentro do repo): vaila/models/hf_datasets/football-pitch-detection/data/data.yaml (kpt_shape: [32, 3]).
  4. Dataset externo unificado (multi-fonte / FIFA pitch): árvore …/unified/data.yaml gerada por vaila.fifa_dataset_builder — ver docs/fifa_workflow.md §4.5 e os módulos fifa_check_labels_dedupe, fifa_dataset_train_readiness.
  5. Referência 3D vailá (nomes de pontos): vaila/models/soccerfield_ref3d.csv — mapeamento semântico kp_00..31 → nomes ainda é trabalho futuro se os IDs do dataset não coincidirem com a vailá.

O que existe no código

  • Módulo: vaila/soccerfield_keypoints_ai.py

    • --mode frame|video, --weights, --imgsz, --conf, --draw-min-conf, --device, --stride, --max-frames, --overlay-video.
    • Saídas numa pasta processed_field_kps_<timestamp>/ sob -o:
      • field_keypoints_video.csv (longo: frame, name, x, y, conf)
      • field_keypoints_getpixelvideo.csv (wide: frame, p1_x, p1_y, …)
      • field_keypoints_overlay_markers.csv (mesmo schema do getpixelvideo; mesmo filtro draw_min_conf; comparação no mesmo run)
      • field_keypoints_overlay.mp4 se --overlay-video
    • Resolver de pesos: se --weights aponta para .../<run_name>/weights/best.pt mas o Ultralytics criou .../<run_name>-N/, o código procura candidatos por glob no repo e escolhe o mais recente.
  • GUI: botão em vaila.py que chama este módulo (run_vaila_module("vaila.soccerfield_keypoints_ai", ...)).

Treino (Ultralytics YOLO pose) — receita que funcionou melhor

Problema observado com treino “ingênuo” (yolo26x-pose, imgsz=640, mosaic=1.0): o modelo colapsava os 32 keypoints num cluster ~20–30 px dentro do bbox (métricas OKS enganosas com bbox enorme).

Receita mais estável para campo broadcast:

  • model=yolo26s-pose.pt (ou m; x só com muito mais dados/regularização)
  • imgsz=1280
  • mosaic=0.0, mixup=0.0, close_mosaic=0, erasing=0.0
  • pose=25.0, kobj=2.0
  • epochs alto (ex. 800) com patience ajustável; se aparecer Loss NaN/Inf, o Ultralytics tenta recuperar; estabilizar com lr0 mais baixo ou amp=False se necessário.

Exemplo (ajustar project/name para não duplicar segmentos runs/pose no caminho):

uv run yolo pose train \
  model=yolo26s-pose.pt \
  data=vaila/models/hf_datasets/football-pitch-detection/data/data.yaml \
  epochs=800 imgsz=1280 batch=8 \
  mosaic=0.0 mixup=0.0 close_mosaic=0 erasing=0.0 \
  pose=25.0 kobj=2.0 \
  project=vaila/models/runs/pose/vaila/models/training \
  name=football_pitch_prod

Atenção ao caminho de saída: se project= já contiver runs/pose/..., o Ultralytics pode prefixar outro runs/pose/, gerando caminhos longos duplicados. Verificar sempre o log Results saved to ... e usar esse caminho absoluto nos comandos seguintes.

Treino em dataset externo (unified/ fora do git)

Use data= absoluto para o data.yaml que o merger escreveu (ex. /data/FIFA/dataset_vaila_fifa/unified/data.yaml). Fluxo típico:

  1. uv run python -m vaila.fifa_dataset_builder --out-root /data/FIFA/dataset_vaila_fifa …
  2. Export QA: --export-label-check-to …/check_all_labels
  3. Revisão humana dos overlays; opcional: uv run python -m vaila.fifa_check_labels_dedupe --bundle …/check_all_labels
  4. Alinhar unified/ ao flat deduplicado: uv run python -m vaila.fifa_dataset_train_readiness --unified …/unified --prune-unified-to-flat …/check_all_labels --apply-prune
  5. Verificar: …train_readiness --unified …/unified --compare-flat …/check_all_labels (exit ≠ 0 se contagens divergirem)
  6. uv run yolo pose train data=/ABS/.../unified/data.yaml … project=/ABS/.../runs name=…

Documentação: docs/fifa_workflow.md §4.5.

Export ONNX

Usar o caminho absoluto do best.pt que o treino gravou:

uv run yolo pose export \
  model=/ABS/PARA/.../weights/best.pt \
  format=onnx

Pode aparecer um UserWarning sobre aten::index no export — em geral o ONNX continua utilizável; validar com yolo predict ou com o módulo vailá.

Inferência no vídeo de teste (frame a frame + overlay)

uv run python -m vaila.soccerfield_keypoints_ai \
  --mode video \
  -i tests/sport_fields/ENG_FRA_224512.mp4 \
  -o tests/sport_fields/ \
  --backend ultralytics \
  --weights /ABS/PARA/.../weights/best.pt \
  --imgsz 1280 --conf 0.3 --draw-min-conf 0.05 \
  --device 0 --start 0 --stride 1 --overlay-video

Para teste rápido: --max-frames 200 ou --stride 2.

Dependências relevantes

  • ultralytics, opencv-python, pandas, numpy
  • Opcional Roboflow: inference, supervision + ROBOFLOW_API_KEY (backend remoto).

Próximos passos (fora desta skill)

  • Auto-mapping dos índices YOLO (0..31) para point_name em soccerfield_ref3d.csv (transfer learning geométrico / homografia).
  • Rotular frames FIFA e fine-tune a partir do best.pt atual.

Exemplos de prompts que devem acionar esta skill

  • “Treinar YOLO pose no dataset football-pitch-detection e exportar ONNX”
  • “Rodar inferência de keypoints do campo no MP4 e gerar CSV no formato getpixelvideo”
  • “O export diz FileNotFoundError no best.pt”
  • “Os keypoints estão todos no mesmo pixel / colapsados”

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Configures best-practice alerting policies for AI agents using OpenTelemetry (OTel) metrics, generating output as Terraform (.tf) configuration files. Use when analyzing, writing, or deploying alerting policies to monitor agent latency, error rates, token usage, and quality metrics. Don't use for standard infrastructure monitoring unrelated to AI agents, or when the agent is not instrumented with OpenTelemetry (for Reliability, Cost, Safety, Security alerts). NOTE: Reliability, Cost, Safety, and Security alerts use generic OTel metrics and work across runtimes (such as Cloud Run, Vertex AI). Quality alerts rely on Vertex AI Online Monitors and are strictly bound to Vertex AI deployments.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vaila-multimodaltoolbox/vaila212026년 10월 24일 업데이트

Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up resources by undeploying models and deleting endpoints. Use when asked to actively deploy a model, list the Model Garden CATALOG of available models, check if a specific model is deployable (`gcloud ai model-garden models list-deployment-config`), query deployment cost, troubleshoot deployment errors (like quota limits), or undeploy/clean up endpoints. Also use when copying and deploying a 1P Tuned Model. Don't use for pure listing/discovery questions of the form "is X deployed?", "list my endpoints", or "which regions have models running?" — for those use `agent-platform-endpoint-management`. Don't use for public Vertex AI deployments (use the `vertex-deploy` skill) or for running model evaluations (use the `agent-platform-eval-flywheel` skill).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vaila-multimodaltoolbox/vaila212026년 10월 24일 업데이트

Manages Agent Platform serving endpoints. Use when you need to create, list, describe, update, or delete serving endpoints for model deployment on Agent Platform. Also use when troubleshooting endpoint permission, quota, or resource busy errors. Don't use for deploying models to endpoints or for running model evaluations.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vaila-multimodaltoolbox/vaila212026년 10월 24일 업데이트

Measures and improves the quality of AI models and agents on Google Cloud using the Eval Quality Flywheel methodology. Use when evaluating an agent or model, building an eval dataset, picking or writing evaluation metrics, analyzing failures, comparing results before and after a fix, or when guidance is needed on Agent Platform eval methodology — including dataset schema, LLM-as-judge scoring, and common failure causes. For fine-tuning, use agent-platform-tuning. For general production deployment, use agent-platform-deploy.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vaila-multimodaltoolbox/vaila212026년 10월 24일 업데이트

Connects to and performs inference with Google Cloud Agent Platform GenAI models, including First-Party Gemini models and Third-Party OpenMaaS models (Llama, DeepSeek, Qwen, etc.). Use when asked to perform inference, ask a model a question, run a test prompt, execute chat completions, or generate code for calling Gemini or OpenMaaS models, authenticate with GenAI SDK, OpenAI SDK, or legacy Agent Platform SDK, configure base URLs and global/regional endpoints, or troubleshoot 429 Resource Exhausted (DSQ), 400 User Validation, or 404 Not Found errors. Don't use for deploying models to endpoints or for running model evaluations.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vaila-multimodaltoolbox/vaila212026년 10월 24일 업데이트

Guides agents and users through migrating from Gemini API in Google AI Studio to Gemini Enterprise Agent Platform (formerly Vertex AI). Use this skill when moving applications to Google Cloud, to leverage Cloud credits, or to unify inferencing with other Cloud infrastructure (IAM, billing, telemetry).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vaila-multimodaltoolbox/vaila212026년 10월 24일 업데이트

vaila-multimodaltoolbox의 스킬 모두 보기

이 스킬의 문제 신고