Downloads · 30 days
0
Simon9/football-field-detection-roboflow
football-field-detection-roboflow is a keypoint detection model from Simon9. Use it for the keypoint detection task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
YOLOv8 keypoint detection model for identifying field lines and key points on a football/soccer pitch.
Downloads · 30 days
0
Access
Public
Updated Nov 5, 2025
Repo size
—
Likes
2
Public
Click a slice to open those files.
.md2.5 KB · 38%
From the Hugging Face model README
YOLOv8 keypoint detection model for identifying field lines and key points on a football/soccer pitch.
football-field-detection-f07vi/14pip install inference-gpu # or inference for CPU
pip install supervision
from inference import get_model
import supervision as sv
# Initialize model
api_key = "YOUR_ROBOFLOW_API_KEY"
model = get_model(
model_id="football-field-detection-f07vi/14",
api_key=api_key
)
# Run inference
result = model.infer("image.jpg", confidence=0.3)[0]
key_points = sv.KeyPoints.from_inference(result)
print(f"Detected {len(key_points.xy[0])} keypoints")
from field_inference import FootballFieldDetector
import os
detector = FootballFieldDetector(api_key=os.getenv("ROBOFLOW_API_KEY"))
results = detector.predict("image.jpg", confidence=0.3)
import numpy as np
from sports.common.view import ViewTransformer
from sports.configs.soccer import SoccerPitchConfiguration
# Get field keypoints
result = model.infer(frame, confidence=0.3)[0]
key_points = sv.KeyPoints.from_inference(result)
# Filter confident keypoints
filter = key_points.confidence[0] > 0.5
frame_points = key_points.xy[0][filter]
# Create transformer
config = SoccerPitchConfiguration()
pitch_points = np.array(config.vertices)[filter]
transformer = ViewTransformer(
source=frame_points,
target=pitch_points
)
# Transform player positions to pitch coordinates
pitch_xy = transformer.transform_points(player_xy)
You need a Roboflow API key to use this model. Get one at roboflow.com.
@misc{football-field-detection,
title={Football Field Detection},
author={Roboflow},
year={2024},
url={https://universe.roboflow.com/roboflow-jvuqo/football-field-detection-f07vi}
}