Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Saroj Dhiman
/
face_recognition
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f8f49a75
authored
Nov 21, 2023
by
Saroj Dhiman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update main.py
1 parent
2d816a7d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
main.py
main.py
View file @
f8f49a7
...
...
@@ -26,22 +26,24 @@ def findEncodings(images):
img
=
cv2
.
cvtColor
(
img
,
cv2
.
COLOR_BGR2RGB
)
encode
=
face_recognition
.
face_encodings
(
img
)[
0
]
encodeList
.
append
(
encode
)
return
encodeList
def
markAttendance
(
name
):
with
open
(
'Attendance.csv'
,
'r
+
'
)
as
f
:
with
open
(
'Attendance.csv'
,
'r'
)
as
f
:
myDataList
=
f
.
readlines
()
nameList
=
[]
for
line
in
myDataList
:
entry
=
line
.
split
(
','
)
nameList
.
append
(
entry
[
0
])
if
name
not
in
nameList
:
now
=
datetime
.
now
()
dtString
=
now
.
strftime
(
'
%
H:
%
M:
%
S'
)
f
.
writelines
(
f
'
\n
{name},{dtString}'
)
with
open
(
'Attendance.csv'
,
'w'
)
as
f
:
if
name
not
in
nameList
:
now
=
datetime
.
now
()
dtString
=
now
.
strftime
(
'
%
H:
%
M:
%
S'
)
f
.
writelines
(
f
'
\n
{name},{dtString}'
)
#### FOR CAPTURING SCREEN RATHER THAN WEBCAM
# def captureScreen(bbox=(300,300,690+300,530+300)):
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment