-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
60 lines (49 loc) · 1.7 KB
/
install.sh
File metadata and controls
60 lines (49 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Driver Monitoring System Installer
# This script sets up the virtual environment and installs all dependencies
echo "🚗 Driver Monitoring System - Installer"
echo "========================================"
# Set working directory
cd "$(dirname "$0")"
# Check if Python is available
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is not installed. Please install Python 3.8 or newer."
exit 1
fi
# Create virtual environment if it doesn't exist
if [ ! -d "venv" ]; then
echo "📦 Creating virtual environment..."
python3 -m venv venv
fi
# Activate virtual environment
echo "🔄 Activating virtual environment..."
source venv/bin/activate
# Install dependencies
echo "📥 Installing dependencies..."
pip install --upgrade pip
pip install -r requirements.txt
# Check if camera is available
echo "📹 Checking camera availability..."
python -c "import cv2; cap = cv2.VideoCapture(0); print('Camera available:', cap.isOpened()); cap.release()"
# Download models if needed
if [ ! -f "models/shape_predictor_68_face_landmarks.dat" ] || [ ! -f "models/haarcascade_frontalface_default.xml" ]; then
echo "🧠 Downloading required models..."
python download_models.py
fi
# Create required directories
echo "📁 Creating data directories..."
mkdir -p data/logs
mkdir -p data/recordings
mkdir -p data/screenshots
mkdir -p data/history
mkdir -p data/driver_profiles
# Make run script executable
chmod +x run_system.sh
echo ""
echo "✅ Installation complete!"
echo ""
echo "To start the system:"
echo " ./run_system.sh gui - Start with GUI (recommended)"
echo " ./run_system.sh console - Start in console mode"
echo " ./run_system.sh test - Run system checks"
echo ""