Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2020-101
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sachith Fernando
2020-101
Commits
47de1008
Commit
47de1008
authored
Nov 05, 2020
by
sachith.fernando
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get two frames out by naming them 0 and 1 to identify whats the first and whats the second
parent
0457e6bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
AttendanceApp/camera.py
AttendanceApp/camera.py
+4
-2
No files found.
AttendanceApp/camera.py
View file @
47de1008
...
@@ -24,6 +24,7 @@ maskNet = load_model(os.path.join(settings.BASE_DIR,'face_detector/mask_detector
...
@@ -24,6 +24,7 @@ maskNet = load_model(os.path.join(settings.BASE_DIR,'face_detector/mask_detector
class
IPWebCam
(
object
):
class
IPWebCam
(
object
):
def
__init__
(
self
):
def
__init__
(
self
):
self
.
url
=
"http://192.168.8.100:8080/shot.jpg"
self
.
url
=
"http://192.168.8.100:8080/shot.jpg"
self
.
_count
=
0
def
__del__
(
self
):
def
__del__
(
self
):
cv2
.
destroyAllWindows
()
cv2
.
destroyAllWindows
()
...
@@ -44,9 +45,10 @@ class IPWebCam(object):
...
@@ -44,9 +45,10 @@ class IPWebCam(object):
resize
=
cv2
.
resize
(
img
,
(
640
,
480
),
interpolation
=
cv2
.
INTER_LINEAR
)
resize
=
cv2
.
resize
(
img
,
(
640
,
480
),
interpolation
=
cv2
.
INTER_LINEAR
)
frame_flip
=
cv2
.
flip
(
resize
,
1
)
frame_flip
=
cv2
.
flip
(
resize
,
1
)
ret
,
jpeg
=
cv2
.
imencode
(
'.jpg'
,
frame_flip
)
ret
,
jpeg
=
cv2
.
imencode
(
'.jpg'
,
frame_flip
)
count
=
random
.
randint
(
0
,
9
)
# capture frame and save on a given time in order to run the face recognition
# capture frame and save on a given time in order to run the face recognition
sleep
(
3
);
cv2
.
imwrite
(
"lecture
%
d.jpg"
%
count
,
img
)
sleep
(
3
);
cv2
.
imwrite
(
"
%
d.jpg"
%
self
.
_count
,
img
)
self
.
_count
=+
1
return
jpeg
.
tobytes
()
return
jpeg
.
tobytes
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment