An intelligent vehicle safety system that combines computer vision, machine learning, and advanced voice interaction for real-time collision prediction and driver assistance.
- Real-time Vehicle Detection: YOLO-based object detection and tracking
- Collision Risk Prediction: LSTM neural networks for risk assessment
- Multi-sensor Integration: Distance sensors, weather monitoring, speed analysis
- Alert System: SMS, email, and voice notifications
- Time-to-Collision (TTC) Analysis: Advanced headway and velocity estimation
- Continuous Listening: "Hey Rhino" wake word activation
- Context-Aware Responses: Uses live vehicle data for intelligent assistance
- Multi-LLM Support: Google Gemini & Local Ollama integration
- Emergency Assistance: Immediate help during crash detection
- Navigation Support: Voice-guided route planning
- Real-time Status: Speed, distance, weather, and risk level inquiries
- Natural Conversation: General driving assistance and safety tips
git clone https://github.com/Kabilash01/RHINO-collision_Prediction-_Warning_system.git
cd RHINO-CAR# Run automated setup (Windows)
setup_voice.bat
# Or install manually
pip install -r requirements.txt
# Install audio dependencies (may require system audio drivers)
pip install pyaudio- Download from: https://ollama.ai/
- Install phi3 model:
ollama pull phi3
# Copy example configuration
cp .env.example .env
# Edit .env file with your API keys:
# - GEMINI_API_KEY (Google AI)
# - GOOGLE_MAPS_API_KEY (Navigation)
# - Serial port settings
# - Video stream URLcd yolo
python rhinomain.pyVoice Controls:
- Say "Hey Rhino" for hands-free interaction
- Press 'v' key for manual voice command
- Press 'q' to quit
cd yolo
python voice_demo.pyDemo Options:
- Interactive Demo (live voice input)
- Automated Demo (predefined commands)
- Feature Testing (comprehensive test suite)
- Driving Scenarios (simulated conditions)
Emergency:
- "Help! I need emergency assistance"
- "Accident detected, what should I do?"
Status Inquiry:
- "What's my current speed?"
- "How's the following distance?"
- "What's the weather visibility?"
Navigation:
- "Navigate to the nearest hospital"
- "Get directions to the gas station"
General:
- "Is it safe to overtake?"
- "Tell me about road safety"
- "How should I drive in fog?"
RHINO-CAR/
โโโ yolo/ # Main application & voice assistant
โ โโโ rhinomain.py # Main application with integrated voice
โ โโโ llm_handler.py # Enhanced LLM & voice processing
โ โโโ voice_demo.py # Voice assistant demonstration
โ โโโ *.py # Detection, routing, testing
โโโ utils/ # Prediction models & algorithms
โโโ training/ # Model training scripts
โโโ models/ # Trained neural network models
โโโ alerts/ # SMS & email notification system
โโโ sensors/ # Serial communication for hardware
โโโ test_videos/ # Video files for testing
- Speech-to-Text: Google Speech Recognition API
- Natural Language Processing: Google Gemini + Local Ollama LLM
- Text-to-Speech: pyttsx3 (offline) + Google Cloud TTS (optional)
- Wake Word Detection: Continuous background listening
- Context Integration: Real-time vehicle data integration
# LLM Configuration
GEMINI_API_KEY=your_gemini_api_key
GOOGLE_MAPS_API_KEY=your_maps_api_key
# Hardware Configuration
SERIAL_PORT=COM14
VIDEO_URL=http://192.168.82.137:8080/video
# Alert Configuration
TWILIO_ACCOUNT_SID=your_twilio_sid
EMAIL_USERNAME=your_email@gmail.com- Camera: IP webcam or USB camera for video input
- Microphone: For voice input (built-in or external)
- Speakers: For voice output
- Optional: Arduino with distance/weather sensors
- GPU: Recommended for YOLO inference (CUDA support)
python yolo/voice_demo.pypython yolo/test_voice.py # Video + voice interaction
python yolo/test_llm.py # LLM integration testpython training/train_risk_model.py # Train collision models
python utils/detect_crash.py # Test crash detection
python alerts/email_alert.py # Test alert systemVoice Recognition Not Working:
- Check microphone permissions
- Install/update audio drivers
- Verify internet connection for Google STT
LLM Errors:
- Ensure Ollama is installed and running
- Check Gemini API key in .env file
- Test with:
ollama run phi3
Serial Port Issues:
- Verify COM port in device manager
- Check baud rate (115200)
- Test with Arduino IDE serial monitor
Video Stream Issues:
- Verify IP webcam URL
- Check network connectivity
- Test with VLC media player
- Detection Accuracy: 95%+ vehicle detection
- Response Time: <200ms voice processing
- Risk Prediction: 90%+ accuracy for collision scenarios
- Voice Recognition: 85%+ accuracy in vehicle environment
- Advanced wake word training
- Multi-language voice support
- Integration with vehicle CAN bus
- Cloud-based model updates
- Advanced driver behavior analysis
- Smartphone app integration
This project is licensed under the MIT License - see LICENSE file for details.
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
Developer: Kabilash01
Repository: RHINO-collision_Prediction-_Warning_system
- YOLO for object detection
- Google AI for Gemini LLM
- Ollama for local LLM inference
- OpenCV for computer vision
- PyTorch for neural networks