Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Group-16-IoT
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yash Shah
Group-16-IoT
Commits
f4ad2637
Commit
f4ad2637
authored
2 years ago
by
Yash Shah
Browse files
Options
Downloads
Patches
Plain Diff
Minor fix made to facial req
parent
6c1617c7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dht2.py
+4
-4
4 additions, 4 deletions
dht2.py
facial_recognition/facial_req.py
+7
-6
7 additions, 6 deletions
facial_recognition/facial_req.py
with
11 additions
and
10 deletions
dht2.py
+
4
−
4
View file @
f4ad2637
...
@@ -30,13 +30,13 @@ white = 1 # The White colored sensor.
...
@@ -30,13 +30,13 @@ white = 1 # The White colored sensor.
def
temp
():
def
temp
():
try
:
try
:
# This example uses the blue colored sensor.
# This example uses the blue colored sensor.
# The first parameter is the port, the second parameter is the type of sensor.
# The first parameter is the port, the second parameter is the type of sensor.
[
temp
,
humidity
]
=
grovepi
.
dht
(
sensor
,
blue
)
[
temp
,
humidity
]
=
grovepi
.
dht
(
sensor
,
blue
)
x
=
json
.
dumps
({
'
temperature
'
:
temp
,
'
humidity
'
:
humidity
})
x
=
json
.
dumps
({
"
temperature
"
:
temp
,
"
humidity
"
:
humidity
})
if
math
.
isnan
(
temp
)
is
False
and
math
.
isnan
(
humidity
)
is
False
:
if
math
.
isnan
(
temp
)
is
False
and
math
.
isnan
(
humidity
)
is
False
:
print
(
"
we are here
"
)
#
print("we are here")
return
x
return
x
else
:
else
:
print
(
"
No data.
"
)
print
(
"
No data.
"
)
...
...
This diff is collapsed.
Click to expand it.
facial_recognition/facial_req.py
+
7
−
6
View file @
f4ad2637
...
@@ -26,7 +26,7 @@ def facial_rec(email):
...
@@ -26,7 +26,7 @@ def facial_rec(email):
# Setting up Mail
# Setting up Mail
SMTP_USERNAME
=
"
iotg16@outlook.com
"
# Mail id of the sender
SMTP_USERNAME
=
"
iotg16@outlook.com
"
# Mail id of the sender
SMTP_PASSWORD
=
"
Group16!
"
# Password of the sender
SMTP_PASSWORD
=
"
Group16!
"
# Password of the sender
SMTP_RECIPIENT
=
"
yashshahq@gmail.com
"
# Mail id of the receiver
SMTP_RECIPIENT
=
email
# Mail id of the receiver
SMTP_SERVER
=
"
smtp.office365.com
"
# Address of the SMTP server
SMTP_SERVER
=
"
smtp.office365.com
"
# Address of the SMTP server
SSL_PORT
=
587
SSL_PORT
=
587
...
@@ -37,9 +37,8 @@ def facial_rec(email):
...
@@ -37,9 +37,8 @@ def facial_rec(email):
# load the known faces and embeddings along with OpenCV's Haar
# load the known faces and embeddings along with OpenCV's Haar
# cascade for face detection
# cascade for face detection
print
(
"
Loading the facial recognition technology
.
"
)
print
(
"
[INFO] loading encodings + face detector..
.
"
)
data
=
pickle
.
loads
(
open
(
encodingsP
,
"
rb
"
).
read
())
data
=
pickle
.
loads
(
open
(
encodingsP
,
"
rb
"
).
read
())
# initialize the video stream and allow the camera sensor to warm up
# initialize the video stream and allow the camera sensor to warm up
# Set the ser to the followng
# Set the ser to the followng
...
@@ -47,6 +46,7 @@ def facial_rec(email):
...
@@ -47,6 +46,7 @@ def facial_rec(email):
# src = 2 : I had to set it to 2 inorder to use the USB webcam attached to my laptop
# src = 2 : I had to set it to 2 inorder to use the USB webcam attached to my laptop
# vs = VideoStream(src=2,framerate=10).start()
# vs = VideoStream(src=2,framerate=10).start()
vs
=
VideoStream
(
usePiCamera
=
True
).
start
()
vs
=
VideoStream
(
usePiCamera
=
True
).
start
()
time
.
sleep
(
2.0
)
# start the FPS counter
# start the FPS counter
fps
=
FPS
().
start
()
fps
=
FPS
().
start
()
...
@@ -94,7 +94,7 @@ def facial_rec(email):
...
@@ -94,7 +94,7 @@ def facial_rec(email):
# If someone in your dataset is identified, print their name on the screen
# If someone in your dataset is identified, print their name on the screen
if
currentname
!=
name
:
if
currentname
!=
name
:
currentname
=
name
currentname
=
name
print
(
currentname
)
# update the list of names
# update the list of names
names
.
append
(
name
)
names
.
append
(
name
)
...
@@ -125,7 +125,7 @@ def facial_rec(email):
...
@@ -125,7 +125,7 @@ def facial_rec(email):
if
out
[
2
]
==
"
6
"
:
if
out
[
2
]
==
"
6
"
:
print
(
"
Shutdown detected
"
)
print
(
"
Shutdown detected
"
)
exit
(
0
)
exit
(
0
)
print
(
"
Connected to mail
"
)
# Create the container (outer) email message
# Create the container (outer) email message
TO
=
SMTP_RECIPIENT
TO
=
SMTP_RECIPIENT
...
@@ -170,7 +170,8 @@ def facial_rec(email):
...
@@ -170,7 +170,8 @@ def facial_rec(email):
# stop the timer and display FPS information
# stop the timer and display FPS information
fps
.
stop
()
fps
.
stop
()
print
(
"
[INFO] elasped time: {:.2f}
"
.
format
(
fps
.
elapsed
()))
print
(
"
[INFO] approx. FPS: {:.2f}
"
.
format
(
fps
.
fps
()))
# do a bit of cleanup
# do a bit of cleanup
cv2
.
destroyAllWindows
()
cv2
.
destroyAllWindows
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment