This project is an attempt to perceive changes in the position of the human buttocks and head during golf through AI. It mainly relies on the densepose project in Detectron2, a project package of Facebook AI Research, and also uses Flask to write a visual webpage connecting the front-end and server back-end.It is forked from Flode-Labs/vid2densepose.
To utilize this tool, ensure the installation of:
- Python 3.8 or later
- PyTorch (preferably with CUDA for GPU support)
-
Create a virtual environment for your anaconda or miniconda:
conda create -n your_env_name python=3.9 conda activate your_env_nameInstall the right pytorch version and able to use cuda. You can use "nvcc -V" to see your cuda version
-
Clone the repository:
git clone https://github.com/Asadashino-o/golf-human.git cd golf-human -
Install necessary Python packages:
pip install -r requirements.txt conda install opencv -c conda-forge
-
Clone the Detectron repository:
git clone https://github.com/facebookresearch/detectron2.git
-
Download the pkl weight file to human-golf/ Download URL: densepose-R50_FPN_six
Run the script:
python main.py -i sample_videos/input_video.mp4 -o sample_videos/output_video.mp4The script processes the input video and generates an output video with the draw-line format.
You can also use the flask to run the web with an interface. To do so, run the following command:
cd flaskk
python server.pyAfter it runs in linux command-line. You can open your browser and input your URL.
Thanks to:
- Facebook AI Research (FAIR) for the development of DensePose.
- The contributors of the Detectron2 project.
- Gonzalo Vidal for the sample videos.
- Sylvain Filoni for the deployment of the Gradio Space in Hugging Face.
- https://github.com/Flode-Labs
- yolov8
It is just a copy-learning project.
For any inquiries or support, please file an issue in GitHub repository's issue tracker.
