Cycling Power Calculator is an interactive application for analyzing cycling ride data from .fit
and .gpx
files. It allows you to visualize ride metrics, map your route, and estimate your cycling power output using a physics-based model. The app is built with Gradio and Plotly, and is intended for cyclists, coaches, and enthusiasts who want to explore and compare real and calculated power data.
Values for important physical constants like air density and drag coefficients are mostly chosen arbitrarily. The accuracy of the physics model may suffer under certain conditions.
This app was developed using a personal fit file. Assumptions about data field existence, units, and sample rate are engrained into the code. Your ride data may vary and the app may not work as expected. If you encounter issues, please open an issue on GitHub.
- Upload and analyze
.fit
and.gpx
ride files - Visualize ride metrics (heart rate, cadence, speed, power, altitude) over time
- Interactive ride map plotting GPS data
- Histograms for power and heart rate distributions
- Physics-based power estimation using customizable rider and bike parameters
- Compare real (measured) and calculated (estimated) power output
-
Clone the repository:
git clone https://github.com/royceschultz/Cycling-Power-Calculator.git cd Cycling-Power-Calculator
-
Install Python dependencies: Ensure python is installed on your system. This app was developed using Python 3.12.9.
pip install -r requirements.txt
-
Run the Gradio app:
python gradio_app.py
Alternatively, gradio supports hot reloading (great for development) with this command:
gradio app gradio_app.py
This will start a local web server and provide a link in your terminal (e.g.,
http://127.0.0.1:7860/
). -
Using the App:
- Upload your
.fit
or.gpx
ride file, or select one from therides
folder. - Explore your ride data with interactive plots and maps.
- Use the "Calculate Estimated Power" section to estimate your power output based on rider/bike parameters and compare it to your real power data.
- Upload your
gradio_app.py
- Main Gradio app interfaceutils/
- Helper modules for loading rides, calculating metrics, and power estimationgradio_components.py
- Plotly graph generation functionsrequirements.txt
- Python dependencies
Details about previous iterations of this project can be found in README.old.md.
- GPX loading is not implemented
- Define more accurate and customizable physical coefficients