A comprehensive golf swing analysis application with real-time feedback, featuring a React frontend and FastAPI backend powered by computer vision and pose estimation.
golf-feedback-system/
├── frontend/
│ └── swing-better/ # React application
├── src/
│ ├── app/ # Backend FastAPI application
│ └── s3_NAM_model/ # S3 NAM model package
├── requirements.txt # Python dependencies
└── README.md
- Python 3.8 or higher
- Node.js 16.x or higher
- npm or yarn package manager
Navigate to your project root directory and create a virtual environment:
python -m venv venvOr if you're using Python 3 specifically:
python3 -m venv venvActivate the virtual environment based on your operating system:
On Windows:
venv\Scripts\activateOn macOS/Linux:
source venv/bin/activateYou should see (venv) appear at the beginning of your command line prompt, indicating the virtual environment is active.
With the virtual environment activated, install the required packages:
pip install -r requirements.txtNavigate to the S3 NAM model directory and install it in editable mode:
cd src/s3_NAM_model
pip install -e .
cd ../..The -e flag installs the package in editable/development mode, which means changes to the source code will be reflected without reinstalling.
Before running the application, you need to download the required model files:
Download Link: Model Files on Google Drive
Installation Instructions:
- Download the
modelsfolder from the Google Drive link - Place the downloaded
modelsfolder in the root directory - Download the
golfpose-checkpointsfolder from the Google Drive link - Place the downloaded
golfpose-checkpointsfolder in thesrc/golfpose/directory- Final path should be:
src/golfpose/golfpose-checkpoints/
- Final path should be:
Your directory structure should look like this after downloading:
models/ # Downloaded model files
src/
├── app/
├── golfpose/
│ └── golfpose-checkpoints/ # Downloaded checkpoint files
├── s3_NAM_model/ # S3 NAM model package
└── ...
Development Mode (with auto-reload):
uvicorn src.app.main:app --reloadProduction Mode:
uvicorn src.app.main:app --host 0.0.0.0 --port 8000The backend API will be available at http://localhost:8000
cd frontend/swing-betternpm installOr if you're using yarn:
yarn installDevelopment Mode:
npm run devOr with yarn:
yarn devProduction Build:
npm run buildOr with yarn:
yarn buildThe frontend application will typically be available at http://localhost:3000 (or the port specified in your configuration).
To run both frontend and backend simultaneously:
-
Terminal 1 - Backend:
# From project root source venv/bin/activate # or venv\Scripts\activate on Windows uvicorn src.app.main:app --reload
-
Terminal 2 - Frontend:
# From project root cd frontend/swing-better npm run dev
For a quick setup from scratch:
# 1. Setup backend
python -m venv venv
source venv/bin/activate # or venv\Scripts\activate on Windows
pip install -r requirements.txt
cd src/s3_NAM_model && pip install -e . && cd ../..
# 2. Download models from Google Drive and place them correctly
# 3. Setup frontend
cd frontend/swing-better
npm install
cd ../..
# 4. Run backend (Terminal 1)
uvicorn src.app.main:app --reload
# 5. Run frontend (Terminal 2)
cd frontend/swing-better && npm run devThis project is based on the following research papers: