soccernet-calibration-sportlight

SoccerNet@CVPR | 1st place solution for Camera Calibration Challenge 2023

https://github.com/nikolasent/soccernet-calibration-sportlight

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 6 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org, acm.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.2%) to scientific vocabulary

Keywords

calibration camera-calibration camera-pose-estimation computer-vision cvpr2023 deep-learning ellipse keypoint-detection soccernet
Last synced: 6 months ago · JSON representation ·

Repository

SoccerNet@CVPR | 1st place solution for Camera Calibration Challenge 2023

Basic Info
  • Host: GitHub
  • Owner: NikolasEnt
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 1.49 MB
Statistics
  • Stars: 47
  • Watchers: 3
  • Forks: 4
  • Open Issues: 1
  • Releases: 1
Topics
calibration camera-calibration camera-pose-estimation computer-vision cvpr2023 deep-learning ellipse keypoint-detection soccernet
Created about 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme Citation

README.md

SoccerNet Camera Callibration 2023

An image and predictions visualization overlayed

[![arXiv](https://img.shields.io/badge/arXiv-2410.07401-b31b1b.svg)](https://arxiv.org/abs/2410.07401) [![ACMMM 2024](https://img.shields.io/badge/ACMMM2024-10.1145/3689061.3689074-blue)](https://doi.org/10.1145/3689061.3689074)

The repository contains the 1st place solution for SoccerNet Camera Calibration 2023, which was a part of CVPR 2023.

The solution was developed by Sportlight Technology team: Nikolay Falaleev and Ruilong Chen.

Technical details of the approach are available in Top-1 solution of SoccerNet Camera Calibration Challenge 2023. A brief video presentation of the solution is available on YouTube. The details on the challenge are available on the SoccerNet task page.

For a detailed video overview of the solution, please refer to our YouTube video, which was prepared as an illustration to ACM MMSports'24 publication.

Key features of the solution:

  • The raw pitch annotation is processed by geometry algorithms, resulting in more accurate and comprehensive annotations that include additional keypoints such as tangent points for ellipses (57 points in total).
  • The perception system consists of two models: keypoints and lines detection.
  • Heuristic rules are applied to the predictions to derive the most plausible camera calibration parameters.

Prerequirements

  • Linux-powered computer with an Nvidia GPU. The code was tested on OpenSUSE 15.5 and Ubuntu 22.04.
  • Nvidia GPU with at least 24GB of memory. Nvidia RTX 3090 and RTX 4090 GPUs were used during the challenge. Nvidia Driver version >= 535.
  • Docker and NVIDIA Container Toolkit.

Quick start guide

The environment is provided as a Docker image; build it with make build. To start the container, use the command make run. All the following commands, describing how to train models or make predictions, should be executed within the docker container.

Project structure

  • src - The project's source directory.
  • notebooks - Jupyter notebooks. It contains a notebook with the annotatio exploration and a notebook with ellipses geometry-related algorithms visualization.
  • data - The project's storage for required files.
    • data/experiments/ - Folder with individual experiments results and artifacts (each experiment has its individual folder in this location).
    • data/dataset/ - Folder with challenge, test, train and valid data from the challenge organizers. Use the official development kit to get the datasets.
  • baseline - The code of the baseline, adopted from the official development kit. It is used for data handling and evaluation metrics.

Keypoints model

The HRNet based model code is in src/models/hrnet/. The model training is configured by Hydra config file src/models/hrnet/train_config.yaml. Run python src/models/hrnet/train.py to train the model in the docker container environment.

Details on the model architecture are in the model README.md.

Optimize prediction model hyperparameters

In order to run the hyperparameter search with Optuna: 1. Specify the trained model path in src/models/hrnet/val_config.yaml. Make sure the rest of parameters for model and data_params section are the same to the values used during the model training. 2. Set initial guess and default values for the camera calibration heuristical algorithm in src/models/hrnet/val_config.yaml camera section. Specify parameters seach space in src/models/hrnet/optimize_valid.yaml in hydra.sweeper.params (see Hydra docs for details on the sweeper configuratiuon). The provided parameters in the files represent the actual final used values during the course of experiments for the Challenge. 3. Run optimization: cd src/models/hrnet/ and python validate.py --config-name optimize_valid --multirun.

Line model

The Line detection based model code is in src/models/line/. The model training is configured by Hydra config file src/models/line/train_config.yaml. Run python src/models/line/train.py to train the model in the docker container environment.

Details on the model architecture are in the model README.md.

Once the model is trained, prediction file should be prepared as described in README.md, section Assemble line model result.

Final predictions and submit file creation

The final step is the submit file preparation. It can be created by a provided script: python src/utils/make_submit.py. Update paths to actual model files in the accordingly. The file contains heuristics params used in the actual winning submission.

In fact, actual calibration algorithms and relevant heuristics are implemented in src/models/hrnet/prediction.py. The proposed code can indeed be adapted for use in other applications, related to camera calibration.

Code navigation

Some key code files, which could be interesting to explore to grasp the fundamental concepts behind the solution, as well as the interesting aspects that may be adapted for other applications or techniques:

Cite

If you use this work in your research, please cite our paper by using the following BibTeX entry:

latex @inproceedings{10.1145/3689061.3689074, author = {Falaleev, Nikolay S. and Chen, Ruilong}, title = {Enhancing Soccer Camera Calibration Through Keypoint Exploitation}, year = {2024}, isbn = {9798400711985}, publisher = {Association for Computing Machinery}, address = {New York, NY, USA}, doi = {10.1145/3689061.3689074}, booktitle = {Proceedings of the 7th ACM International Workshop on Multimedia Content Analysis in Sports}, pages = {65–73}, series = {MMSports '24} }

Useful links

Owner

  • Name: Nikolay Falaleev
  • Login: NikolasEnt
  • Kind: user
  • Location: London, UK

Citation (CITATION.cff)

cff-version: 1.2.0
title: "Solution for SoccerNet Camera Calibration Challenge 2023"
message: "If you use this code, please cite it as below."
authors:
- family-names: Falaleev
  given-names: Nikolay
  email: nikolasent@gmail.com
  orcid: "https://orcid.org/0000-0002-9398-5261"
- family-names: Chen
  given-names: Ruilong
  email: ruilongcv@gmail.com
  orcid: "https://orcid.org/0000-0002-7855-4711"
version: 1.0.0
doi: 10.5281/zenodo.13119663
date-released: 2024-01-28
url: "https://github.com/NikolasEnt/soccernet-calibration-sportlight"
preferred-citation:
  type: proceedings
  authors:
  - family-names: Falaleev
    given-names: Nikolay
    email: nikolay.falaleev@sportlight.ai
    orcid: "https://orcid.org/0000-0002-9398-5261"
  - family-names: Chen
    given-names: Ruilong
    email: ruilong.chen@sportlight.ai
    orcid: "https://orcid.org/0000-0002-7855-4711"
  doi: "10.1145/3689061.3689074"
  journal: "Proceedings of the 7th ACM International Workshop on Multimedia Content Analysis in Sports"
  start: 65
  end: 73
  title: "Enhancing Soccer Camera Calibration Through Keypoint Exploitation"
  year: 2024

GitHub Events

Total
  • Issues event: 4
  • Watch event: 14
  • Issue comment event: 2
  • Push event: 2
  • Fork event: 1
Last Year
  • Issues event: 4
  • Watch event: 14
  • Issue comment event: 2
  • Push event: 2
  • Fork event: 1

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 35
  • Total Committers: 2
  • Avg Commits per committer: 17.5
  • Development Distribution Score (DDS): 0.143
Past Year
  • Commits: 35
  • Committers: 2
  • Avg Commits per committer: 17.5
  • Development Distribution Score (DDS): 0.143
Top Committers
Name Email Commits
Nikolay Falaleev n****t@g****m 30
Ruilong Chen r****n@s****i 5
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 9
  • Total pull requests: 2
  • Average time to close issues: 26 days
  • Average time to close pull requests: less than a minute
  • Total issue authors: 8
  • Total pull request authors: 1
  • Average comments per issue: 1.89
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 0
  • Average time to close issues: about 1 month
  • Average time to close pull requests: N/A
  • Issue authors: 5
  • Pull request authors: 0
  • Average comments per issue: 1.2
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Wang-Yu-Qing (2)
  • goktugyildirim4d (1)
  • petem24 (1)
  • VictorVatt (1)
  • Thunderltx (1)
  • eshafeeqe (1)
  • azishabibi (1)
  • dorbittonn (1)
Pull Request Authors
  • NikolasEnt (2)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

Dockerfile docker
  • nvidia/cuda ${CUDA_VERSION}-cudnn8-devel-ubuntu22.04 build
requirements.txt pypi
  • SoccerNet ==0.1.51
  • hydra-core ===1.3.2
  • hydra-optuna-sweeper ==1.2.0
  • lsq-ellipse ==2.2.1
  • matplotlib ==3.7.1
  • notebook ==6.5.3
  • numpy ==1.24.2
  • opencv-python ==4.7.0.72
  • optuna <3.0.0
  • pandas ==1.5.3
  • pytorch-argus ==1.0.0
  • scikit-learn ==1.2.2
  • scipy ==1.10.1
  • tqdm ==4.65.0