Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Secure smart parking solution
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
2021-122
Secure smart parking solution
Commits
faf9deff
Commit
faf9deff
authored
Jul 06, 2021
by
Dilitha A.G.A.D.
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement live and overall persons counter
parent
aaa4ba43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
personDetection/main.py
personDetection/main.py
+15
-0
No files found.
personDetection/main.py
View file @
faf9deff
...
...
@@ -67,6 +67,9 @@ def main():
fps_start_time
=
datetime
.
datetime
.
now
()
fps
=
0
total_frames
=
0
lpc_count
=
0
opc_count
=
0
object_id_list
=
[]
dtime
=
dict
()
...
...
@@ -108,6 +111,9 @@ def main():
x2
=
int
(
x2
)
y2
=
int
(
y2
)
# if objectId not in object_id_list:
# object_id_list.append(objectId)
if
objectId
not
in
object_id_list
:
object_id_list
.
append
(
objectId
)
dtime
[
objectId
]
=
datetime
.
datetime
.
now
()
...
...
@@ -141,6 +147,15 @@ def main():
cv2
.
putText
(
frame
,
fps_text
,
(
5
,
30
),
cv2
.
FONT_HERSHEY_COMPLEX_SMALL
,
1
,
(
0
,
0
,
255
),
1
)
lpc_count
=
len
(
objects
)
opc_count
=
len
(
object_id_list
)
lpc_txt
=
"LPC: {}"
.
format
(
lpc_count
)
opc_txt
=
"OPC: {}"
.
format
(
opc_count
)
cv2
.
putText
(
frame
,
lpc_txt
,
(
5
,
60
),
cv2
.
FONT_HERSHEY_COMPLEX_SMALL
,
1
,
(
0
,
0
,
255
),
1
)
cv2
.
putText
(
frame
,
opc_txt
,
(
5
,
90
),
cv2
.
FONT_HERSHEY_COMPLEX_SMALL
,
1
,
(
0
,
0
,
255
),
1
)
cv2
.
imshow
(
"Application"
,
frame
)
# print("Detected" + text)
key
=
cv2
.
waitKey
(
1
)
...
...
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