Home

Awesome

Sports Field Registration via Keypoints-aware Label Condition

This is an official implementation of Sports Field Registration via Keypoints-aware Label Condition.

Yen-Jui Chu, Jheng-Wei Su, Kai-Wen Hsiao, Chi-Yu Lien, Shu-Ho Fan, Min-Chun Hu, Ruen-Rone Lee, Chih-Yuan Yao, Hung-Kuo Chu

8th International Workshop on Computer Vision in Sports (CVsports) at CVPR 2022

[Paper] [Webpage]

<p align='center'> <img src='imgs/teaser.png' width=1000> </p>

We propose a novel deep learning framework for sports field registration. The typical algorithmic flow for sports field registration involves extracting field-specific features (e.g., corners, lines, etc.) from field image and estimating the homography matrix between a 2D field template and the field image using the extracted features. Unlike previous methods that strive to extract sparse field features from field images with uniform appearance, we tackle the problem differently. First, we use a grid of uniformly distributed keypoints as our field-specific features to increase the likelihood of having sufficient field features under various camera poses. Then we formulate the keypoints detection problem as an instance segmentation with dynamic filter learning. In our model, the convolution filters are generated dynamically, conditioned on the field image and associated keypoint identity, thus improving the robustness of prediction results. To extensively evaluate our method, we introduce a new soccer dataset, called TS-WorldCup, with detailed field markings on 3812 time-sequence images from 43 videos of Soccer World Cup 2014 and 2018. The experimental results demonstrate that our method outperforms state-of-the-arts on the TS-WorldCup dataset in both quantitative and qualitative evaluations.

Requirements

Getting Started

  1. Clone this repo:
git clone https://github.com/ericsujw/KpSFR
cd KpSFR/
  1. Install miniconda
  2. Install all the dependencies
conda env create -f environment.yml
  1. Switch to the conda environment
conda activate kpsfr

Pretrained Models

  1. Download pretrained weight on WorldCup dataset.
  2. Now the pretrained models would place in checkpoints.
  3. Download public WorldCup dataset.
  4. Download TS-WorldCup dataset.
  5. Now the WorldCup dataset would place in dataset/soccer_worldcup_2014 and TS-WorldCup in dataset/WorldCup_2014_2018.

Inference

Please use robust model first to get the preprocess results before running the inference command below.

Inference command

python inference.py <path/param_text_file>

param_text_file as follows,

Note:

Evaluation

Please use robust model first to get the preprocess results before running the evaluation command below.

Evaluation command

python eval_testset.py <path/param_text_file>

param_text_file as follows,

We will save heatmap results and corresponding homography matrix into /checkpoints/path of experimental name, which set --name in param_text_file.

Train model

Train command

python train_nn.py <path/param_text_file>

param_text_file as follows,

We will save visualize results and weights into /checkpoints/path of experimental name, which set --name in param_text_file.

Note: Please check the following arguments to set correct before training every time.

Details refer to options.py.

License

This work is licensed under MIT License. See LICENSE for details.

Citation

If you find our code/models useful, please consider citing our paper:

@InProceedings{Chu_2022_CVPR,
    author    = {Chu, Yen-Jui and Su, Jheng-Wei and Hsiao, Kai-Wen and Lien, Chi-Yu and Fan, Shu-Ho and Hu, Min-Chun and Lee, Ruen-Rone and Yao, Chih-Yuan and Chu, Hung-Kuo},
    title     = {Sports Field Registration via Keypoints-Aware Label Condition},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
    year      = {2022}
}