YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

YOLOv11 Soccer Detection & Keypoints

Inference pipeline for soccer match images using two YOLOv11 models:

  • Player / Ball / Referee detection β€” yolov11_sahi_1280
  • Field keypoint detection β€” yolov11_keypoints_29 (29 pitch keypoints)

Project Structure

yolo26_ball_player_keypoint_detection/
β”œβ”€β”€ inference.py
β”œβ”€β”€ original.jpg              # default input image
β”œβ”€β”€ output.jpg                # annotated output (generated)
β”œβ”€β”€ yolov11_sahi_1280/
β”‚   └── Model/weights/best.pt
└── yolov11_keypoints_29/
    └── Model/weights/best.pt

Requirements

pip install ultralytics opencv-python

Usage

Place your input image in the project folder (or update INPUT_IMAGE in inference.py), then run:

python inference.py

The script will:

  1. Run object detection at 1280px resolution (Player, Ball, Referee)
  2. Run keypoint detection (29 field keypoints)
  3. Draw both results on the image
  4. Save the annotated image to output.jpg

Example output:

Input:  .../original.jpg
Output: .../output.jpg
Detections: {'Referee': 2, 'Player': 14, 'Ball': 1}
Keypoint sets: 1
Keypoints per set: 29

Configuration

Edit the constants at the top of inference.py:

Constant Default Description
INPUT_IMAGE original.jpg Path to the input image
OUTPUT_IMAGE output.jpg Path to save the annotated output
PLAYER_CONF 0.57 Minimum confidence for player detections
DEFAULT_CONF 0.25 Minimum confidence for ball and referee

Models

Detection (yolov11_sahi_1280)

Class ID
Player 0
Ball 1
Referee 2

Trained with SAHI-style slicing at 1280px resolution for better small-object detection (e.g. the ball).

Keypoints (yolov11_keypoints_29)

Pose model that detects 29 field keypoints per image (pitch lines, corners, penalty areas, etc.).


Goldenboy

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support