Skip to content

FanChiMao/Competition-2023-PyTorch-Badminton

Repository files navigation

[AICUP 2023] Competition-2023-Pytorch-Badminton

🎉 This work has earned a place in the top 25% of winners!

Award winners list (Click to expand)

TEAM_2970: Jonathan, Joe, Dodo, Edward, Harry

report Visitors

Model architectures

model

Overall pipeline

MVD
(Video Distillation)

DSNet
(Video Summarization)

TrackNetv2
(Video Segmentation)

Each model purpose

  • MVD (to predict the ball type)
  • DSNet (to predict the shot frame number)
  • TrackNetv2 (to predict the shuttlecock position, ball height)
  • YOLOv8-Detection (to predict the player position)
  • YOLOv8-PoseEstimation (to predict the toe position)
  • YOLOv8-Classification (to predict the round head, backhand)

Installation

  • Clone the code from repository

    git clone https://github.com/FanChiMao/Competition-2023-PyTorch-Badminton
    
  • Install submodule

    cd Competition-2023-PyTorch-Badminton
    git submodule update --init
    
  • Build the environment

    cd Competition-2023-PyTorch-Badminton
    pip install -r requirements.txt
    
  • Download the TrackNetv2

    git clone https://nol.cs.nctu.edu.tw:234/open-source/TrackNetv2
    python utils\predict_process\TrackNet_import.py
    

Datasets

Inference

  • Download our YOLOv8 trained weights by following commands, or you can directly download from here.

    cd trained_weights
    python download_trained_weights.py
    
  • Check the configuration path from ./inference.yaml

    # Path setting
    PATH:
      VIDEO: D:\AICUP\datasets\test\video
      HIT_CSV: D:\AICUP\datasets\test\predict_csv
      RESULT: .\predict_result
      OPENPOSE: .\for_openpose
    
    # Pretrained weights path
    WEIGHTS:
      PLAYER: D:\AICUP\Competition-2023-PyTorch-Badminton\trained_weights\yolov8s-players_detection_2.pt
      COURT: D:\AICUP\Competition-2023-PyTorch-Badminton\trained_weights\yolov8s-seg_net_detection.pt
      NET: D:\AICUP\Competition-2023-PyTorch-Badminton\trained_weights\yolov8s-players_detection.pt
      ROUNDHEAD: D:\AICUP\Competition-2023-PyTorch-Badminton\trained_weights\yolov8n-cls_roundhead.pt
      BACKHAND: D:\AICUP\Competition-2023-PyTorch-Badminton\trained_weights\yolov8n-cls_backhand.pt
      BALLTYPE: D:\AICUP\Competition-2023-PyTorch-Badminton\trained_weights\yolov8s-cls_balltypes.pt
      START: D:\AICUP\Competition-2023-PyTorch-Badminton\trained_weights\yolov8n-cls_balltypes_start.pt
      AFTER: D:\AICUP\Competition-2023-PyTorch-Badminton\trained_weights\yolov8n-cls_balltypes_after.pt
    
  • After setting the configuration, to predict the video input, simply run

    python main_predict.py
    

Reference

Contact us