Skip to content

Repository files navigation

Rockfall Prediction API

Simple FastAPI app that loads a scikit-learn pipeline from full_rockfall_pipeline.pkl and exposes a /predict endpoint.

Quick start

  1. Create a virtual environment and install dependencies:
python -m venv .venv; .\.venv\Scripts\Activate.ps1; pip install -r requirements.txt
  1. Set an API key (optional) and run on port 8002 (default):
$env:API_KEY = "changeme"; python .\main.py
  1. Example request (replace with your feature JSON):
Invoke-RestMethod -Method Post -Uri http://localhost:8002/predict -Headers @{"access_token"="changeme"} -Body (@{data=@{feature1=1; feature2=2}} | ConvertTo-Json)

Notes

  • Place full_rockfall_pipeline.pkl next to main.py.
  • Set API_PORT to change the local port. Defaults to 8002 to avoid conflicts with other APIs.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages