ckcl commited on
Commit
1f651ee
·
verified ·
1 Parent(s): 775b356

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +76 -74
README.md CHANGED
@@ -1,74 +1,76 @@
1
- ---
2
- language: en
3
- license: mit
4
- library_name: tensorflow
5
- tags:
6
- - computer-vision
7
- - drowsiness-detection
8
- - driver-safety
9
- - cnn
10
- - tensorflow
11
- datasets:
12
- - custom
13
- metrics:
14
- - accuracy
15
- - binary-crossentropy
16
- pipeline_tag: image-classification
17
- ---
18
-
19
- # Driver Drowsiness Detection Model
20
-
21
- This model is designed to detect driver drowsiness from facial images using a CNN architecture.
22
-
23
- ## Model Details
24
- - Architecture: CNN
25
- - Input: Facial images (64x64x3)
26
- - Output: Binary classification (drowsy/not drowsy)
27
-
28
- ## Usage
29
- ```python
30
- import tensorflow as tf
31
- import cv2
32
- import numpy as np
33
-
34
- # Load model
35
- model = tf.keras.models.load_model('drowsiness_model.h5')
36
-
37
- # Preprocess image
38
- img = cv2.imread('face.jpg')
39
- img = cv2.resize(img, (64, 64))
40
- img = img / 255.0
41
- img = np.expand_dims(img, axis=0)
42
-
43
- # Make prediction
44
- prediction = model.predict(img)
45
- is_drowsy = prediction[0][0] > 0.5
46
- ```
47
-
48
- ## Training Details
49
- - Dataset: Custom driver drowsiness dataset
50
- - Training method: Binary cross-entropy loss with Adam optimizer
51
- - Validation split: 20%
52
- - Early stopping with patience=3
53
-
54
- ## Model Architecture
55
- - Input Layer: 64x64x3 images
56
- - Convolutional Layers:
57
- - Conv2D(32, 3x3) + BatchNorm + ReLU
58
- - MaxPooling2D(2x2)
59
- - Conv2D(64, 3x3) + BatchNorm + ReLU
60
- - MaxPooling2D(2x2)
61
- - Conv2D(128, 3x3) + BatchNorm + ReLU
62
- - MaxPooling2D(2x2)
63
- - Dense Layers:
64
- - Dense(128) + BatchNorm + ReLU
65
- - Dropout(0.5)
66
- - Dense(1) + Sigmoid
67
-
68
- ## Performance
69
- - Binary classification for drowsiness detection
70
- - Optimized for real-time inference
71
- - Suitable for embedded systems and edge devices
72
-
73
- ## License
74
- This model is released under the MIT License.
 
 
 
1
+ ---
2
+ language: en
3
+ license: mit
4
+ library_name: tensorflow
5
+ tags:
6
+ - computer-vision
7
+ - drowsiness-detection
8
+ - driver-safety
9
+ - cnn
10
+ - tensorflow
11
+ model_name: driver-drowsiness-detector
12
+ datasets:
13
+ - ckcl/drowsiness_dataset
14
+ - custom
15
+ metrics:
16
+ - accuracy
17
+ - binary-crossentropy
18
+ pipeline_tag: image-classification
19
+ ---
20
+
21
+ # Driver Drowsiness Detection Model
22
+
23
+ This model is designed to detect driver drowsiness from facial images using a CNN architecture.
24
+
25
+ ## Model Details
26
+ - Architecture: CNN
27
+ - Input: Facial images (64x64x3)
28
+ - Output: Binary classification (drowsy/not drowsy)
29
+
30
+ ## Usage
31
+ ```python
32
+ import tensorflow as tf
33
+ import cv2
34
+ import numpy as np
35
+
36
+ # Load model
37
+ model = tf.keras.models.load_model('drowsiness_model.h5')
38
+
39
+ # Preprocess image
40
+ img = cv2.imread('face.jpg')
41
+ img = cv2.resize(img, (64, 64))
42
+ img = img / 255.0
43
+ img = np.expand_dims(img, axis=0)
44
+
45
+ # Make prediction
46
+ prediction = model.predict(img)
47
+ is_drowsy = prediction[0][0] > 0.5
48
+ ```
49
+
50
+ ## Training Details
51
+ - Dataset: Custom driver drowsiness dataset
52
+ - Training method: Binary cross-entropy loss with Adam optimizer
53
+ - Validation split: 20%
54
+ - Early stopping with patience=3
55
+
56
+ ## Model Architecture
57
+ - Input Layer: 64x64x3 images
58
+ - Convolutional Layers:
59
+ - Conv2D(32, 3x3) + BatchNorm + ReLU
60
+ - MaxPooling2D(2x2)
61
+ - Conv2D(64, 3x3) + BatchNorm + ReLU
62
+ - MaxPooling2D(2x2)
63
+ - Conv2D(128, 3x3) + BatchNorm + ReLU
64
+ - MaxPooling2D(2x2)
65
+ - Dense Layers:
66
+ - Dense(128) + BatchNorm + ReLU
67
+ - Dropout(0.5)
68
+ - Dense(1) + Sigmoid
69
+
70
+ ## Performance
71
+ - Binary classification for drowsiness detection
72
+ - Optimized for real-time inference
73
+ - Suitable for embedded systems and edge devices
74
+
75
+ ## License
76
+ This model is released under the MIT License.