A comprehensive walking route safety and accessibility platform that uses machine learning to detect and analyze road hazards, providing intelligent routing based on safety and accessibility needs.
GroundTruth combines computer vision, geospatial analysis, and intelligent routing to help users navigate urban environments safely. The platform detects hazards like potholes using YOLOv8, calculates their severity through depth estimation, and provides optimized walking routes that prioritize safety and accessibility.
- AI-Powered Hazard Detection: Real-time pothole detection and dimensional analysis using YOLOv8 segmentation
- Intelligent Routing: A* algorithm-based pathfinding with customizable weights for safety and accessibility
- Interactive Map Interface: Real-time visualization of routes and hazards using Leaflet
- Hazard Reporting: Community-driven hazard reporting and verification system
- Accessibility Routing: Specialized route calculations for wheelchair users and those with mobility challenges
- User Authentication: Secure OAuth2-based authentication system
- Geospatial Analysis: PostgreSQL with PostGIS for efficient spatial queries
- Framework: Spring Boot 4.0.2 (Java 25)
- Security: Spring Security with OAuth2
- Database: PostgreSQL with Hibernate Spatial (PostGIS)
- AI Integration: Spring AI with OpenAI
- Geospatial: JTS Topology Suite, Hibernate Spatial
- Framework: React 18 with TypeScript
- Build Tool: Vite 5
- Mapping: Leaflet + React Leaflet
- Styling: Modern responsive design
- Framework: FastAPI (Python)
- ML Models:
- YOLOv8m for pothole segmentation
- Depth estimation for dimensional analysis
- Computer Vision: OpenCV, PyTorch
┌─────────────────┐
│ React Frontend │
│ (TypeScript) │
└────────┬────────┘
│
│ REST API
▼
┌─────────────────┐ ┌──────────────────┐
│ Spring Boot │ │ FastAPI ML │
│ Backend │─────▶│ Inference API │
│ (Java 25) │ │ (Python) │
└────────┬────────┘ └──────────────────┘
│
▼
┌─────────────────┐
│ PostgreSQL │
│ with PostGIS │
└─────────────────┘
- Java 25
- Node.js 18+
- Python 3.8+
- PostgreSQL with PostGIS extension
- Docker (optional, for containerized deployment)
- Navigate to the backend directory:
cd backend-
Configure your
application.propertieswith database credentials and OAuth2 settings -
Run the Spring Boot application:
./gradlew bootRunThe backend will start on http://localhost:8080
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run devThe frontend will start on http://localhost:5173
- Navigate to the inference directory:
cd inference- Install Python dependencies:
pip install -r requirements.txt- Download the YOLOv8 model (if not already present):
# The model will be automatically downloaded on first run- Start the FastAPI server:
uvicorn inference:app --reloadThe inference API will start on http://localhost:8000
POST /api/routing/route- Calculate optimal walking routePOST /api/walksafe/route- Calculate safety-optimized routePOST /api/accessibility/route- Calculate accessibility-optimized routePOST /api/hazards/report- Report a new hazardGET /api/hazards- Get hazards in areaPOST /api/auth/login- User authentication
POST /analyze-potholes- Analyze uploaded image for potholes- Returns: pothole count, dimensions (width, depth), and distance from camera
- Image Upload: User submits an image through the API
- Segmentation: YOLOv8m model identifies pothole regions with instance segmentation
- Depth Analysis: Depth estimation model creates a depth map of the scene
- Dimensional Calculation:
- Road surface depth is calculated from surrounding pixels
- Pothole depth is measured relative to road surface
- Width is calculated using camera focal length and distance
- Results: Returns structured data with pothole locations, dimensions, and severity
- Uses A* pathfinding for optimal route calculation
- Customizable edge weights based on:
- Road surface quality
- Reported hazards
- Accessibility features (curb cuts, ramps, etc.)
- Historical safety data
Frontend:
cd frontend
npm run buildBackend:
cd backend
./gradlew buildBackend:
cd backend
./gradlew testGroundTruth/
├── backend/ # Spring Boot application
│ ├── src/
│ │ ├── main/
│ │ │ └── java/com/team/GroundTruth/
│ │ │ ├── Controller/ # REST endpoints
│ │ │ ├── services/ # Business logic
│ │ │ ├── routing/ # A* routing engine
│ │ │ └── models/ # JPA entities
│ │ └── test/
│ └── build.gradle
├── frontend/ # React application
│ ├── src/
│ ├── package.json
│ └── vite.config.ts
└── inference/ # ML inference service
├── inference.py # FastAPI endpoints
├── segmentation.py # YOLOv8 detection
├── depth.py # Depth estimation
└── input/ # Sample images
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- YOLOv8 model by Ultralytics
- OpenStreetMap for mapping data
- Spring Boot and React communities
- All contributors and testers
For questions or support, please open an issue on GitHub.