Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-115
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-115
2021-115
Commits
a894545c
Commit
a894545c
authored
Nov 13, 2021
by
Maduranga Jayakody
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Electric Fan detection
parent
753d71c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
Child_detection/electricalObject-detection.py
Child_detection/electricalObject-detection.py
+14
-0
No files found.
Child_detection/electricalObject-detection.py
View file @
a894545c
...
...
@@ -266,6 +266,20 @@ for fno in range(0, total_frames):
else
:
no_intersection
=
True
if
label
==
"Fan"
and
float
(
confidence
)
>=
CONFIDENCE_FAN
:
left
,
top
,
right
,
bottom
=
bbox2points
(
bbox
)
left
,
top
,
right
,
bottom
=
int
(
left
*
width_ratio2
),
int
(
top
*
height_ratio2
),
int
(
right
*
width_ratio2
),
int
(
bottom
*
height_ratio2
)
cv2
.
rectangle
(
frame
,
(
left
,
top
),
(
right
,
bottom
),
class_colors2
[
str
(
label
)],
2
)
cv2
.
putText
(
frame
,
"{} [{:.2f}]"
.
format
(
label
,
float
(
confidence
)),
(
left
,
top
-
5
),
cv2
.
FONT_HERSHEY_SIMPLEX
,
0.5
,
class_colors2
[
str
(
label
)],
2
)
# Person - A (Left1,Bottom1) (x1,y1) # B (Right1,Top1) (x2,y2)
# Fan - C (Left,Bottom) (x3,y3) # D (Right,Top) (x4,y4)
if
(
intersection
([
left
,
top
,
right
,
bottom
],
[
left1
,
top1
,
right1
,
bottom1
])):
warning_message
+=
"Child is too close to the Fan
\n
"
else
:
no_intersection
=
True
#import libries
#Define new libries for Darkent
...
...
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