katkarrohit203 commited on
Commit
49f1168
·
verified ·
1 Parent(s): ea1b48d

Upload 11 files

Browse files
.gitattributes CHANGED
@@ -1,35 +1,36 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ alarm.wav filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # PyPI configuration file
171
+ .pypirc
LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Rohit-katkar2003
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
README.md CHANGED
@@ -1,12 +1,12 @@
1
- ---
2
- title: Drowsiness Detector
3
- emoji: 🐢
4
- colorFrom: pink
5
- colorTo: yellow
6
- sdk: streamlit
7
- sdk_version: 1.41.1
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+ ---
2
+ title: Drowsiness Detector
3
+ emoji: 🐢
4
+ colorFrom: pink
5
+ colorTo: yellow
6
+ sdk: streamlit
7
+ sdk_version: 1.41.1
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
alarm.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5787cf28ed4728fd26c5c7c4c4b658ee0869c3124a36a6a20e404d1046d52f65
3
+ size 1019502
app.py ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import cv2 as cv
2
+ import numpy as np
3
+ import time
4
+ import pygame
5
+ import streamlit as st
6
+
7
+ classes = ['Closed', 'Open'] # Class labels for eyes only
8
+
9
+ # Load face and eye cascade classifiers
10
+ face_cascade = cv.CascadeClassifier("haarcascade files/haarcascade_frontalface_default.xml")
11
+ eye_cascade = cv.CascadeClassifier("haarcascade files/haarcascade_eye.xml")
12
+
13
+ # Initialize alarm
14
+ pygame.mixer.init()
15
+ pygame.mixer.music.load("alarm.wav")
16
+
17
+ # Track eye closure duration
18
+ closed_start_time = None
19
+ alarm_triggered = False
20
+
21
+ # Prepare the frame for eye detection
22
+ def prepare_frame(frame):
23
+ global closed_start_time, alarm_triggered
24
+ gray_frame = cv.cvtColor(frame, cv.COLOR_BGR2GRAY) # Convert to grayscale for better detection
25
+ faces = face_cascade.detectMultiScale(gray_frame, scaleFactor=1.1, minNeighbors=5)
26
+ eye_status = 'Closed'
27
+
28
+ for (x, y, w, h) in faces:
29
+ face_roi = frame[y:y+h, x:x+w]
30
+ roi_gray = gray_frame[y:y+h, x:x+w]
31
+ eyes = eye_cascade.detectMultiScale(roi_gray, scaleFactor=1.1, minNeighbors=5)
32
+
33
+ # If two or more eyes detected, classify as 'Open'
34
+ if len(eyes) >= 2:
35
+ eye_status = 'Open'
36
+ if alarm_triggered:
37
+ pygame.mixer.music.stop()
38
+ alarm_triggered = False
39
+ closed_start_time = None
40
+ else:
41
+ if closed_start_time is None:
42
+ closed_start_time = time.time()
43
+ elif time.time() - closed_start_time >= 3:
44
+ if not alarm_triggered:
45
+ pygame.mixer.music.play()
46
+ alarm_triggered = True
47
+
48
+ # Draw a rectangle around the entire face
49
+ cv.rectangle(frame, (x, y), (x+w, y+h), (255, 0, 0), 2)
50
+ break # Stop after detecting the first face to avoid multiple rectangles
51
+
52
+ cv.putText(frame, eye_status, (20, 50), cv.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)
53
+ return frame, eye_status
54
+
55
+ # Streamlit interface
56
+ st.title("Real-time Eye Detection and Drowsiness Alert")
57
+ st.markdown("**Close your eyes for 3 seconds to trigger the alarm.**")
58
+
59
+ FRAME_WINDOW = st.image([])
60
+ run = st.button("Start Detection")
61
+ stop = st.button("Stop Detection")
62
+
63
+ cap = cv.VideoCapture(0)
64
+
65
+ while run:
66
+ ret, frame = cap.read()
67
+ if not ret:
68
+ st.warning("Failed to access webcam.")
69
+ break
70
+
71
+ frame = cv.flip(frame, 1) # Flip frame horizontally
72
+ frame, eye_status = prepare_frame(frame)
73
+ frame = cv.cvtColor(frame, cv.COLOR_BGR2RGB)
74
+ FRAME_WINDOW.image(frame)
75
+
76
+ if stop:
77
+ cap.release()
78
+ cv.destroyAllWindows()
79
+ break
80
+
81
+ cap.release()
82
+ cv.destroyAllWindows()
haarcascade_files/haarcascade_eye.xml ADDED
The diff for this file is too large to render. See raw diff
 
haarcascade_files/haarcascade_frontalface_default.xml ADDED
The diff for this file is too large to render. See raw diff
 
requirements.txt ADDED
File without changes
research/CV.ipynb ADDED
@@ -0,0 +1,539 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {},
7
+ "outputs": [],
8
+ "source": [
9
+ "import os \n",
10
+ "import numpy as np \n",
11
+ "import pandas as pd \n",
12
+ "import matplotlib.pyplot as plt \n",
13
+ "import matplotlib.image as mimage \n",
14
+ "import cv2 as cv \n",
15
+ "import random \n",
16
+ "from PIL import Image\n",
17
+ " \n",
18
+ "import warnings \n",
19
+ "warnings.filterwarnings(\"ignore\")"
20
+ ]
21
+ },
22
+ {
23
+ "cell_type": "code",
24
+ "execution_count": 2,
25
+ "metadata": {},
26
+ "outputs": [
27
+ {
28
+ "data": {
29
+ "text/plain": [
30
+ "'d:\\\\Final _proj\\\\Driver Drawsines\\\\research'"
31
+ ]
32
+ },
33
+ "execution_count": 2,
34
+ "metadata": {},
35
+ "output_type": "execute_result"
36
+ }
37
+ ],
38
+ "source": [
39
+ "%pwd"
40
+ ]
41
+ },
42
+ {
43
+ "cell_type": "code",
44
+ "execution_count": 3,
45
+ "metadata": {},
46
+ "outputs": [],
47
+ "source": [
48
+ "os.chdir(\"..\")"
49
+ ]
50
+ },
51
+ {
52
+ "cell_type": "code",
53
+ "execution_count": 4,
54
+ "metadata": {},
55
+ "outputs": [
56
+ {
57
+ "data": {
58
+ "text/plain": [
59
+ "'d:\\\\Final _proj\\\\Driver Drawsines'"
60
+ ]
61
+ },
62
+ "execution_count": 4,
63
+ "metadata": {},
64
+ "output_type": "execute_result"
65
+ }
66
+ ],
67
+ "source": [
68
+ "%pwd"
69
+ ]
70
+ },
71
+ {
72
+ "cell_type": "code",
73
+ "execution_count": 11,
74
+ "metadata": {},
75
+ "outputs": [
76
+ {
77
+ "name": "stderr",
78
+ "output_type": "stream",
79
+ "text": [
80
+ "WARNING:absl:Compiled the loaded model, but the compiled metrics have yet to be built. `model.compile_metrics` will be empty until you train or evaluate the model.\n"
81
+ ]
82
+ }
83
+ ],
84
+ "source": [
85
+ "from tensorflow.keras.models import load_model \n",
86
+ "model = load_model(\"drowiness_new6.h5\")"
87
+ ]
88
+ },
89
+ {
90
+ "cell_type": "markdown",
91
+ "metadata": {},
92
+ "source": [
93
+ "## Final"
94
+ ]
95
+ },
96
+ {
97
+ "cell_type": "code",
98
+ "execution_count": null,
99
+ "metadata": {},
100
+ "outputs": [],
101
+ "source": [
102
+ "###"
103
+ ]
104
+ },
105
+ {
106
+ "cell_type": "markdown",
107
+ "metadata": {},
108
+ "source": [
109
+ "### For Yawn , no-Yawn"
110
+ ]
111
+ },
112
+ {
113
+ "cell_type": "code",
114
+ "execution_count": null,
115
+ "metadata": {},
116
+ "outputs": [
117
+ {
118
+ "name": "stdout",
119
+ "output_type": "stream",
120
+ "text": [
121
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 137ms/step\n",
122
+ "[[0.5339012 0.15986206 0.22364037 0.08259626]]\n",
123
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 147ms/step\n",
124
+ "[[0.55441564 0.16944881 0.19709249 0.07904309]]\n",
125
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 118ms/step\n",
126
+ "[[0.4521452 0.13079698 0.31140834 0.10564953]]\n",
127
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 111ms/step\n",
128
+ "[[0.5303667 0.16052838 0.22346936 0.08563555]]\n",
129
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 112ms/step\n",
130
+ "[[0.5102811 0.15651394 0.24725401 0.08595096]]\n",
131
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 96ms/step\n",
132
+ "[[0.39522764 0.5094784 0.08734289 0.00795105]]\n",
133
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 125ms/step\n",
134
+ "[[0.4849061 0.5083012 0.00610906 0.0006836 ]]\n",
135
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 124ms/step\n",
136
+ "[[4.9457058e-01 4.9904898e-01 6.0036671e-03 3.7674789e-04]]\n",
137
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 113ms/step\n",
138
+ "[[4.9783722e-01 4.9717689e-01 4.6812119e-03 3.0464309e-04]]\n",
139
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 112ms/step\n",
140
+ "[[5.2321953e-01 4.6852756e-01 7.8288494e-03 4.2414822e-04]]\n",
141
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 107ms/step\n",
142
+ "[[4.9153149e-01 5.0222409e-01 5.8816043e-03 3.6273352e-04]]\n",
143
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 113ms/step\n",
144
+ "[[0.54127944 0.44826204 0.00961303 0.00084548]]\n",
145
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 104ms/step\n",
146
+ "[[0.50393206 0.4863479 0.00865785 0.0010622 ]]\n",
147
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 118ms/step\n",
148
+ "[[5.4283851e-01 4.5033500e-01 6.4291335e-03 3.9734103e-04]]\n",
149
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 110ms/step\n",
150
+ "[[5.2413237e-01 4.7132316e-01 4.3296791e-03 2.1475746e-04]]\n",
151
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 102ms/step\n",
152
+ "[[5.1084113e-01 4.8559844e-01 3.2412172e-03 3.1920703e-04]]\n",
153
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 121ms/step\n",
154
+ "[[5.7073164e-01 4.2556059e-01 3.4928408e-03 2.1485660e-04]]\n",
155
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 105ms/step\n",
156
+ "[[5.5285156e-01 4.4224325e-01 4.5622713e-03 3.4294103e-04]]\n",
157
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 107ms/step\n",
158
+ "[[0.5427735 0.44871727 0.00793501 0.00057425]]\n",
159
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 120ms/step\n",
160
+ "[[5.4114133e-01 4.5342380e-01 5.1169088e-03 3.1804194e-04]]\n",
161
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 120ms/step\n",
162
+ "[[5.7159519e-01 4.2561889e-01 2.5791947e-03 2.0669916e-04]]\n",
163
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 117ms/step\n",
164
+ "[[5.7468766e-01 4.2153805e-01 3.5532070e-03 2.2111020e-04]]\n",
165
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 110ms/step\n",
166
+ "[[5.3590161e-01 4.5808852e-01 5.6171627e-03 3.9265043e-04]]\n",
167
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 101ms/step\n",
168
+ "[[5.5657232e-01 4.3508846e-01 7.7924151e-03 5.4685154e-04]]\n",
169
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 106ms/step\n",
170
+ "[[0.49480158 0.49675417 0.00781286 0.00063132]]\n",
171
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 116ms/step\n",
172
+ "[[5.5822819e-01 4.3658417e-01 4.8851566e-03 3.0245088e-04]]\n",
173
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 97ms/step\n",
174
+ "[[0.53632814 0.4521163 0.01081774 0.00073785]]\n",
175
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 122ms/step\n",
176
+ "[[0.5257215 0.4666978 0.00665365 0.00092702]]\n",
177
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 113ms/step\n",
178
+ "[[0.56758076 0.42414907 0.00691421 0.00135598]]\n",
179
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 101ms/step\n",
180
+ "[[0.5783753 0.41040668 0.01005661 0.00116142]]\n",
181
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 123ms/step\n",
182
+ "[[0.61831737 0.37240994 0.00795365 0.00131897]]\n",
183
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 126ms/step\n",
184
+ "[[0.6174236 0.37296996 0.0084237 0.00118283]]\n",
185
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 101ms/step\n",
186
+ "[[0.53627264 0.4550183 0.00787264 0.00083647]]\n",
187
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 109ms/step\n",
188
+ "[[6.3499963e-01 3.6145884e-01 3.0721761e-03 4.6933253e-04]]\n",
189
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 110ms/step\n",
190
+ "[[0.59015673 0.3910087 0.01667546 0.00215918]]\n",
191
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 121ms/step\n",
192
+ "[[0.547751 0.43992066 0.01099813 0.00133022]]\n",
193
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 94ms/step\n",
194
+ "[[6.1030549e-01 3.8535413e-01 3.9123669e-03 4.2805608e-04]]\n",
195
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 116ms/step\n",
196
+ "[[0.5895906 0.39260563 0.01642497 0.00137877]]\n",
197
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 104ms/step\n",
198
+ "[[0.4235793 0.56652987 0.00914386 0.00074703]]\n",
199
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 119ms/step\n",
200
+ "[[4.8226121e-01 5.0990009e-01 7.3582488e-03 4.8048754e-04]]\n",
201
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 139ms/step\n",
202
+ "[[0.47468084 0.49073824 0.03259087 0.00199007]]\n",
203
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 100ms/step\n",
204
+ "[[0.48702973 0.5029544 0.00944369 0.00057216]]\n",
205
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 106ms/step\n",
206
+ "[[0.46537527 0.5274027 0.0066941 0.00052791]]\n",
207
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 93ms/step\n",
208
+ "[[0.425588 0.5606394 0.01319939 0.00057326]]\n",
209
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 110ms/step\n",
210
+ "[[4.6433157e-01 5.3061748e-01 4.6703219e-03 3.8065348e-04]]\n",
211
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 104ms/step\n",
212
+ "[[5.0271779e-01 4.9165285e-01 5.3839809e-03 2.4538283e-04]]\n",
213
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 95ms/step\n",
214
+ "[[4.9817729e-01 4.9809283e-01 3.4314308e-03 2.9849299e-04]]\n",
215
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 92ms/step\n",
216
+ "[[0.4323189 0.55639476 0.01058941 0.00069697]]\n",
217
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 112ms/step\n",
218
+ "[[4.9058634e-01 5.0517666e-01 3.8562843e-03 3.8071233e-04]]\n",
219
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 98ms/step\n",
220
+ "[[4.6864349e-01 5.2765518e-01 3.3698247e-03 3.3153337e-04]]\n",
221
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 101ms/step\n",
222
+ "[[4.7328150e-01 5.1489401e-01 1.1425589e-02 3.9892178e-04]]\n",
223
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 96ms/step\n",
224
+ "[[5.6844020e-01 4.2386171e-01 7.2170394e-03 4.8100951e-04]]\n",
225
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 122ms/step\n",
226
+ "[[4.7888020e-01 5.1815802e-01 2.7156596e-03 2.4622082e-04]]\n",
227
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 107ms/step\n",
228
+ "[[4.4938755e-01 5.4168677e-01 8.4247021e-03 5.0095661e-04]]\n",
229
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 97ms/step\n",
230
+ "[[4.8189956e-01 5.1445591e-01 3.2346470e-03 4.0994020e-04]]\n",
231
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 114ms/step\n",
232
+ "[[4.3830103e-01 5.5796260e-01 3.5162044e-03 2.2019379e-04]]\n",
233
+ "\u001b[1m1/1\u001b[0m \u001b[32m���━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 103ms/step\n",
234
+ "[[3.8675940e-01 6.1051351e-01 2.5933362e-03 1.3384310e-04]]\n",
235
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 122ms/step\n",
236
+ "[[4.7633487e-01 5.1811528e-01 5.2490053e-03 3.0079822e-04]]\n",
237
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 110ms/step\n",
238
+ "[[0.5355513 0.4560149 0.00782073 0.00061306]]\n",
239
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 97ms/step\n",
240
+ "[[4.9573547e-01 5.0054139e-01 3.4869814e-03 2.3615584e-04]]\n",
241
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 98ms/step\n",
242
+ "[[4.6156302e-01 5.3393996e-01 4.1647437e-03 3.3234234e-04]]\n",
243
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 104ms/step\n",
244
+ "[[0.52708125 0.46093372 0.01130558 0.00067942]]\n",
245
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 109ms/step\n",
246
+ "[[4.4243312e-01 5.5234385e-01 4.9254801e-03 2.9754813e-04]]\n",
247
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 101ms/step\n",
248
+ "[[4.3317986e-01 5.6243598e-01 4.1413051e-03 2.4284663e-04]]\n",
249
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 115ms/step\n",
250
+ "[[0.52935624 0.46102938 0.00886495 0.00074939]]\n",
251
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 101ms/step\n",
252
+ "[[4.8261899e-01 5.1293612e-01 4.1731801e-03 2.7175286e-04]]\n",
253
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 116ms/step\n",
254
+ "[[4.4055092e-01 5.5352402e-01 5.6604608e-03 2.6452570e-04]]\n",
255
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 110ms/step\n",
256
+ "[[4.2110297e-01 5.7347727e-01 5.1973891e-03 2.2236633e-04]]\n",
257
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 114ms/step\n",
258
+ "[[3.9519185e-01 5.9414124e-01 1.0202706e-02 4.6415642e-04]]\n",
259
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 104ms/step\n",
260
+ "[[0.52715486 0.42906848 0.04193437 0.00184232]]\n",
261
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 121ms/step\n",
262
+ "[[0.4206979 0.55904144 0.01885335 0.00140733]]\n",
263
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 103ms/step\n",
264
+ "[[0.544774 0.14541742 0.25587305 0.05393547]]\n",
265
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 104ms/step\n",
266
+ "[[0.4370813 0.49844724 0.06200609 0.00246527]]\n",
267
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 119ms/step\n",
268
+ "[[0.4528224 0.52911925 0.01663947 0.00141889]]\n",
269
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 96ms/step\n",
270
+ "[[0.3819743 0.5466778 0.06750397 0.00384389]]\n",
271
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 113ms/step\n",
272
+ "[[0.40970472 0.5569316 0.03105194 0.00231172]]\n",
273
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 94ms/step\n",
274
+ "[[0.6114612 0.19729745 0.1383356 0.0529057 ]]\n",
275
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 135ms/step\n",
276
+ "[[0.45113012 0.50088024 0.04475248 0.00323708]]\n",
277
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━���━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 108ms/step\n",
278
+ "[[0.45435527 0.53013545 0.01427606 0.00123324]]\n",
279
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 106ms/step\n",
280
+ "[[0.47971782 0.5001755 0.01883741 0.00126928]]\n",
281
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 99ms/step\n",
282
+ "[[0.54685706 0.43772423 0.01460937 0.00080937]]\n",
283
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 119ms/step\n",
284
+ "[[0.43435532 0.51326823 0.04905771 0.00331874]]\n",
285
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 107ms/step\n",
286
+ "[[0.4691491 0.51138616 0.01782178 0.00164296]]\n",
287
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 132ms/step\n",
288
+ "[[0.36563382 0.609435 0.02245951 0.00247164]]\n",
289
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 93ms/step\n",
290
+ "[[0.4674584 0.51042354 0.0199133 0.00220476]]\n",
291
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 134ms/step\n",
292
+ "[[0.35535875 0.62192243 0.02078114 0.0019377 ]]\n",
293
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 118ms/step\n",
294
+ "[[0.35675234 0.5971697 0.04377323 0.00230471]]\n",
295
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 108ms/step\n",
296
+ "[[0.32445276 0.6365426 0.03643773 0.00256694]]\n",
297
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 118ms/step\n",
298
+ "[[0.44510007 0.5342694 0.01953486 0.00109567]]\n",
299
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 100ms/step\n",
300
+ "[[0.30969 0.60378057 0.07928306 0.00724639]]\n",
301
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 107ms/step\n",
302
+ "[[0.56752884 0.35713732 0.07257319 0.00276066]]\n",
303
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 120ms/step\n",
304
+ "[[0.34694657 0.5160776 0.13258497 0.00439083]]\n",
305
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 111ms/step\n",
306
+ "[[0.4539524 0.46011406 0.08372305 0.00221045]]\n",
307
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 105ms/step\n",
308
+ "[[5.1272041e-01 4.3961889e-01 4.7271658e-02 3.8900448e-04]]\n",
309
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 115ms/step\n",
310
+ "[[0.67923796 0.2438758 0.07580444 0.00108182]]\n",
311
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 108ms/step\n",
312
+ "[[0.5821022 0.27528477 0.13952196 0.00309112]]\n",
313
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 115ms/step\n",
314
+ "[[0.4618073 0.35787314 0.16838866 0.01193077]]\n",
315
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 100ms/step\n",
316
+ "[[0.5675023 0.3495956 0.07748043 0.0054217 ]]\n",
317
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 126ms/step\n",
318
+ "[[0.45714724 0.42329356 0.11500251 0.00455673]]\n",
319
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 101ms/step\n",
320
+ "[[0.5857304 0.38192827 0.0309583 0.00138313]]\n",
321
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 116ms/step\n",
322
+ "[[0.5372635 0.43943352 0.02258803 0.00071496]]\n",
323
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 106ms/step\n",
324
+ "[[0.5059755 0.46730185 0.02545177 0.00127086]]\n",
325
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 97ms/step\n",
326
+ "[[0.5287636 0.436619 0.03319615 0.00142124]]\n",
327
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 122ms/step\n",
328
+ "[[0.5353085 0.3997285 0.0617837 0.0031793]]\n",
329
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 100ms/step\n",
330
+ "[[0.50711626 0.45882738 0.03308126 0.00097504]]\n",
331
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 125ms/step\n",
332
+ "[[0.47909027 0.4863685 0.03269366 0.00184744]]\n",
333
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 104ms/step\n",
334
+ "[[0.40050444 0.5718929 0.02541785 0.00218476]]\n",
335
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 101ms/step\n",
336
+ "[[0.3778685 0.5632252 0.05708069 0.00182558]]\n",
337
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 150ms/step\n",
338
+ "[[0.57108206 0.40179658 0.02321302 0.00390833]]\n",
339
+ "\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 109ms/step\n",
340
+ "[[0.53513265 0.41831055 0.0419606 0.00459616]]\n"
341
+ ]
342
+ }
343
+ ],
344
+ "source": [
345
+ "import cv2 as cv\n",
346
+ "import numpy as np\n",
347
+ "import matplotlib.pyplot as plt\n",
348
+ "\n",
349
+ "classes = ['no_yawn', 'yawn', 'Closed', 'Open'] # Class labels\n",
350
+ "IMG_SIZE = 145 # Image size for resizing\n",
351
+ "face_cascade = cv.CascadeClassifier(\"C:/Users/rohit/Downloads/haarcascade_frontalface_default.xml\")\n",
352
+ "\n",
353
+ "# Prepare the frame for prediction\n",
354
+ "def prepare_frame(frame):\n",
355
+ " gray_frame = cv.cvtColor(frame, cv.COLOR_BGR2GRAY) # Convert to grayscale for better detection\n",
356
+ " faces = face_cascade.detectMultiScale(gray_frame, scaleFactor=1.1, minNeighbors=5)\n",
357
+ " face_list = []\n",
358
+ " coords = []\n",
359
+ " \n",
360
+ " if len(faces) > 0:\n",
361
+ " # Select the face with the maximum area\n",
362
+ " f = max(faces, key=lambda x: x[2] * x[3])\n",
363
+ " x, y, w, h = f\n",
364
+ " face = frame[y:y+h, x:x+w] # Crop the detected face\n",
365
+ " resized_face = cv.resize(face, (IMG_SIZE, IMG_SIZE)) # Resize to match model input\n",
366
+ " resized_face = resized_face / 255.0 # Normalize\n",
367
+ " face_list.append(resized_face.reshape(-1, IMG_SIZE, IMG_SIZE, 3))\n",
368
+ " coords.append((x, y, w, h))\n",
369
+ " \n",
370
+ " return face_list, coords\n",
371
+ "\n",
372
+ "# Start video capture\n",
373
+ "cap = cv.VideoCapture(0)\n",
374
+ "\n",
375
+ "while True:\n",
376
+ " ret, frame = cap.read()\n",
377
+ " if not ret:\n",
378
+ " break\n",
379
+ "\n",
380
+ " frame = cv.flip(frame, 1) # Flip frame horizontally\n",
381
+ " processed_frames, coords = prepare_frame(frame)\n",
382
+ " \n",
383
+ " if processed_frames:\n",
384
+ " for i, processed_frame in enumerate(processed_frames):\n",
385
+ " prediction = model.predict(processed_frame) \n",
386
+ " print(prediction)\n",
387
+ " predicted_class = np.argmax(prediction) \n",
388
+ " class_label = classes[predicted_class]\n",
389
+ " x, y, w, h = coords[i]\n",
390
+ "\n",
391
+ " # Draw rectangle around the face\n",
392
+ " cv.rectangle(frame, (x, y), (x+w, y+h), (255, 0, 0), 2)\n",
393
+ " \n",
394
+ " # Display predicted label on frame\n",
395
+ " cv.putText(frame, f'{class_label}', (x, y-10), cv.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)\n",
396
+ "\n",
397
+ " # Smoothen video quality by applying a Gaussian blur\n",
398
+ " frame = cv.GaussianBlur(frame, (5, 5), 0)\n",
399
+ "\n",
400
+ " cv.imshow('Real-time Emotion Detection', frame)\n",
401
+ "\n",
402
+ " # Press 'q' to quit\n",
403
+ " if cv.waitKey(1) & 0xFF == ord('q'):\n",
404
+ " break\n",
405
+ "\n",
406
+ "cap.release()\n",
407
+ "cv.destroyAllWindows()\n"
408
+ ]
409
+ },
410
+ {
411
+ "cell_type": "code",
412
+ "execution_count": 23,
413
+ "metadata": {},
414
+ "outputs": [],
415
+ "source": [
416
+ "cap.release()\n",
417
+ "cv.destroyAllWindows()"
418
+ ]
419
+ },
420
+ {
421
+ "cell_type": "markdown",
422
+ "metadata": {},
423
+ "source": [
424
+ "### For Eye open or close"
425
+ ]
426
+ },
427
+ {
428
+ "cell_type": "code",
429
+ "execution_count": 22,
430
+ "metadata": {},
431
+ "outputs": [
432
+ {
433
+ "name": "stdout",
434
+ "output_type": "stream",
435
+ "text": [
436
+ "pygame 2.6.1 (SDL 2.28.4, Python 3.11.4)\n",
437
+ "Hello from the pygame community. https://www.pygame.org/contribute.html\n"
438
+ ]
439
+ }
440
+ ],
441
+ "source": [
442
+ "import cv2 as cv\n",
443
+ "import numpy as np\n",
444
+ "import time\n",
445
+ "import pygame\n",
446
+ "\n",
447
+ "classes = ['Closed', 'Open'] # Class labels for eyes only\n",
448
+ "\n",
449
+ "# Load face and eye cascade classifiers\n",
450
+ "face_cascade = cv.CascadeClassifier(\"C:/Users/rohit/Downloads/haarcascade_frontalface_default.xml\")\n",
451
+ "eye_cascade = cv.CascadeClassifier(\"C:/Users/rohit/Downloads/haarcascade_eye.xml\")\n",
452
+ "\n",
453
+ "# Initialize alarm\n",
454
+ "pygame.mixer.init()\n",
455
+ "pygame.mixer.music.load(\"research/alarm.wav\")\n",
456
+ "\n",
457
+ "# Track eye closure duration\n",
458
+ "closed_start_time = None\n",
459
+ "alarm_triggered = False\n",
460
+ "\n",
461
+ "# Prepare the frame for eye detection\n",
462
+ "def prepare_frame(frame):\n",
463
+ " global closed_start_time, alarm_triggered\n",
464
+ " gray_frame = cv.cvtColor(frame, cv.COLOR_BGR2GRAY) # Convert to grayscale for better detection\n",
465
+ " faces = face_cascade.detectMultiScale(gray_frame, scaleFactor=1.1, minNeighbors=5)\n",
466
+ " eye_status = 'Closed'\n",
467
+ " \n",
468
+ " for (x, y, w, h) in faces:\n",
469
+ " face_roi = frame[y:y+h, x:x+w]\n",
470
+ " roi_gray = gray_frame[y:y+h, x:x+w]\n",
471
+ " eyes = eye_cascade.detectMultiScale(roi_gray, scaleFactor=1.1, minNeighbors=5)\n",
472
+ " \n",
473
+ " # If two or more eyes detected, classify as 'Open'\n",
474
+ " if len(eyes) >= 2:\n",
475
+ " eye_status = 'Open'\n",
476
+ " if alarm_triggered:\n",
477
+ " pygame.mixer.music.stop()\n",
478
+ " alarm_triggered = False\n",
479
+ " closed_start_time = None\n",
480
+ " else:\n",
481
+ " if closed_start_time is None:\n",
482
+ " closed_start_time = time.time()\n",
483
+ " elif time.time() - closed_start_time >= 3:\n",
484
+ " if not alarm_triggered:\n",
485
+ " pygame.mixer.music.play()\n",
486
+ " alarm_triggered = True\n",
487
+ " \n",
488
+ " # Draw a rectangle around the entire face\n",
489
+ " cv.rectangle(frame, (x, y), (x+w, y+h), (255, 0, 0), 2)\n",
490
+ " break # Stop after detecting the first face to avoid multiple rectangles\n",
491
+ "\n",
492
+ " cv.putText(frame, eye_status, (20, 50), cv.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 0), 2)\n",
493
+ " return eye_status\n",
494
+ "\n",
495
+ "# Start video capture\n",
496
+ "cap = cv.VideoCapture(0)\n",
497
+ "\n",
498
+ "while True:\n",
499
+ " ret, frame = cap.read()\n",
500
+ " if not ret:\n",
501
+ " break\n",
502
+ "\n",
503
+ " frame = cv.flip(frame, 1) # Flip frame horizontally\n",
504
+ " eye_status = prepare_frame(frame)\n",
505
+ "\n",
506
+ " # Display the frame with eye detection\n",
507
+ " cv.imshow('Real-time Eye Detection', frame)\n",
508
+ "\n",
509
+ " # Press 'q' to quit\n",
510
+ " if cv.waitKey(1) & 0xFF == ord('q'):\n",
511
+ " break\n",
512
+ "\n",
513
+ "cap.release()\n",
514
+ "cv.destroyAllWindows()\n"
515
+ ]
516
+ }
517
+ ],
518
+ "metadata": {
519
+ "kernelspec": {
520
+ "display_name": "chatbot",
521
+ "language": "python",
522
+ "name": "python3"
523
+ },
524
+ "language_info": {
525
+ "codemirror_mode": {
526
+ "name": "ipython",
527
+ "version": 3
528
+ },
529
+ "file_extension": ".py",
530
+ "mimetype": "text/x-python",
531
+ "name": "python",
532
+ "nbconvert_exporter": "python",
533
+ "pygments_lexer": "ipython3",
534
+ "version": "3.11.4"
535
+ }
536
+ },
537
+ "nbformat": 4,
538
+ "nbformat_minor": 2
539
+ }
research/train.ipynb ADDED
The diff for this file is too large to render. See raw diff