A hackathon proof-of-concept for a surgical AR guidance system that enables remote experts to guide rural surgeons by annotating 3D reconstructions that appear as AR overlays on live video.
- Backend: FastAPI, WebSockets, Python
- AI Orchestration: Dedalus Labs (multi-model support)
- 3D Processing: OpenCV, NumPy
- Frontend: React, Three.js, React Three Fiber (to be added)
# Create virtual environment (already done)
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies (already done)
pip install -r requirements.txtEdit .env file and add your Dedalus API key:
DEDALUS_API_KEY=your_key_here
Get your API key from dedaluslabs.ai
Place GLB format 3D models in assets/models/:
bottle_small.glbbottle_medium.glbbottle_large.glb
You can:
- Use Polycam app to scan objects
- Download from Sketchfab (free models)
- Create in Blender and export as GLB
# Activate virtual environment
source venv/bin/activate
# Start the server
uvicorn backend.api.server:app --reloadServer will run at http://localhost:8000
# Test Dedalus connection
python test_dedalus.py
# Run integration tests
python tests/integration_test.py
# Run performance benchmark
python tests/performance_test.pysurgical-ar-demo/
├── backend/
│ ├── agents/
│ │ ├── reconstruction_agent.py # 3D reconstruction with fallback
│ │ └── medical_agent.py # AI medical guidance
│ ├── api/
│ │ └── server.py # FastAPI server with WebSockets
│ ├── tools/
│ │ ├── video_tools.py # Video processing utilities
│ │ └── measurement_tools.py # 3D measurement calculations
│ └── utils/
│ └── demo_monitor.py # Demo logging and monitoring
├── assets/
│ ├── models/ # 3D models (.glb files)
│ └── videos/ # Test videos
├── tests/
│ ├── integration_test.py # End-to-end tests
│ └── performance_test.py # Performance benchmarks
├── temp/ # Temporary files
├── logs/ # Demo logs
└── frontend/ # React app (to be created)
GET /health- Health checkPOST /upload-video- Upload surgical videoPOST /reconstruct/{job_id}- Start 3D reconstructionPOST /analyze- Get AI medical guidancePOST /suggest-entry-point- Get optimal entry point suggestionWS /ws/{client_id}- WebSocket for real-time updates
- Phase 0: Foundation Setup
- Phase 1: Backend Infrastructure
- Phase 2: Dedalus Agent - Video Reconstruction
- Phase 3: 3D Model Fallback System (placeholder)
- Phase 6: AI Medical Guidance
- Phase 4: Frontend 3D Viewer (React + Three.js)
- Phase 5: AR Video Overlay
- Phase 7: End-to-End Integration
- Phase 8: Polish & Demo Preparation
- Add actual 3D models
- Record demo video
- Add your Dedalus API key to
.env - Add 3D models to
assets/models/ - Build the frontend:
npx create-react-app frontend cd frontend npm install three @react-three/fiber @react-three/drei - Test the backend with the integration tests
- Create demo video for backup
See instructions.md Phase 8 for the complete demo script (2 minutes).
- Check your API key in
.env - System automatically falls back to mock responses for demo reliability
- Ensure GLB files are in
assets/models/ - Files should be under 10MB each
- Validate GLB format
- Check CORS settings in server.py
- Ensure frontend is connecting to correct URL
Hackathon POC - Educational purposes only