-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_status.py
More file actions
71 lines (62 loc) · 2.08 KB
/
check_status.py
File metadata and controls
71 lines (62 loc) · 2.08 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
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python3
"""
Driver Monitoring System - Status Check
Quick verification that everything is working correctly.
"""
import sys
import os
import subprocess
def check_venv():
"""Check if virtual environment is activated"""
if hasattr(sys, 'real_prefix') or (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix):
print("✅ Virtual environment is activated")
print(f" Python: {sys.executable}")
return True
else:
print("❌ Virtual environment is not activated")
print(" Please run: source venv/bin/activate")
return False
def check_packages():
"""Check if required packages are installed"""
required_packages = ['cv2', 'mediapipe', 'numpy', 'PIL', 'scipy', 'tkinter']
for package in required_packages:
try:
__import__(package)
print(f"✅ {package} is available")
except ImportError:
print(f"❌ {package} is not available")
return False
return True
def check_camera():
"""Check if camera is accessible"""
try:
import cv2
cap = cv2.VideoCapture(0)
if cap.isOpened():
print("✅ Camera is accessible")
cap.release()
return True
else:
print("❌ Camera is not accessible")
return False
except Exception as e:
print(f"❌ Camera check failed: {e}")
return False
def main():
print("🚗 Driver Monitoring System - Status Check")
print("==========================================")
checks = [
check_venv(),
check_packages(),
check_camera()
]
if all(checks):
print("\n🎉 All checks passed! System is ready to use.")
print("\n📋 Next steps:")
print(" ./run_system.sh gui - Start with GUI")
print(" ./run_system.sh console - Start in console mode")
print(" ./run_system.sh test - Run comprehensive tests")
else:
print("\n❌ Some checks failed. Please fix the issues above.")
if __name__ == "__main__":
main()