SafeAI is a school security system that uses computer vision to detect weapons in security camera feeds and alert authorities in real-time.
SafeAI provides a comprehensive solution for school safety by leveraging AI-powered weapon detection to identify potential threats before they escalate. The system processes camera feeds in real-time, displaying alerts and threat information on an intuitive dashboard interface.
- Real-time weapon detection in camera feeds
- Threat level categorization (NORMAL, LOW, MEDIUM, HIGH)
- Interactive map interface showing camera locations and status
- Security personnel dispatch and response management
- Multi-campus monitoring capabilities
Frontend:
- Next.js
- React & TypeScript
- Tailwind CSS
- Framer Motion
Backend:
- Flask
- Python
AI/ML:
- Moondream 2 model for image processing
- PyTorch (CUDA-optimized)
- Hardware acceleration for Apple Silicon (MPS), CUDA GPU, with CPU fallback
- Misc: OpenCV, Pillow, HF-Transfer, Gemini
- Node.js
- Python 3.8+
- CUDA-capable GPU (optional but recommended)
- Clone this repository
- Install frontend dependencies:
cd frontend
npm install- Install backend dependencies:
cd backend
pip install -r requirements.txtIMPORTANT NOTE: If you are running on GPU, after installing requirements.txt, remove the default torch and install the torch for CUDA with:
pip uninstall torch torchvision torchaudio
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118- Start the backend:
cd backend
python app.py- In a separate terminal, start the frontend:
cd frontend
npm run dev- Open http://localhost:3000 with your browser to see the application.
Developed by:
- Vihaan Sharma
- Rikhil Tanugula
- Jason Shnaper