Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aart_ppe_detection
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
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikhin.vc
aart_ppe_detection
Commits
310b078e
Commit
310b078e
authored
Jan 25, 2023
by
Sikhin VC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtsp changed
parent
28552503
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1223 additions
and
16 deletions
+1223
-16
app.py
app.py
+1
-1
logs/ilens-edge_engine.log
logs/ilens-edge_engine.log
+1196
-0
output/recorded_video_list.txt
output/recorded_video_list.txt
+10
-0
scripts/__pycache__/ppe.cpython-39.pyc
scripts/__pycache__/ppe.cpython-39.pyc
+0
-0
scripts/ppe.py
scripts/ppe.py
+16
-15
No files found.
app.py
View file @
310b078e
import
os
import
os
# os.environ["config"]="{\"TZ\": \"Asia/Kolkata\", \"MONGO_URI\": \"mongodb://svc-ilens:svc2345@192.168.3.220:21017\", \"MONGO_DATABASE\": \"ilens_wps\", \"MONGO_COLLECTION\": \"janusDeployment\", \"MONGO_KEY\": \"deploymentId\", \"MONGO_VALUE\": \"rahul_12345\", \"MONGO_COLL\": \"serviceConfiguration\", \"MONGO_DB\": \"ilens_wps\"}"
# os.environ["config"]="{\"TZ\": \"Asia/Kolkata\", \"MONGO_URI\": \"mongodb://svc-ilens:svc2345@192.168.3.220:21017\", \"MONGO_DATABASE\": \"ilens_wps\", \"MONGO_COLLECTION\": \"janusDeployment\", \"MONGO_KEY\": \"deploymentId\", \"MONGO_VALUE\": \"rahul_12345\", \"MONGO_COLL\": \"serviceConfiguration\", \"MONGO_DB\": \"ilens_wps\"}"
# os.environ["config"]="{\"TZ\": \"Asia/Kolkata\", \"MONGO_URI\": \"mongodb://admin:iLens$HPCLv605@10.5.2.91:2717\", \"MONGO_DATABASE\": \"ilens_ai\", \"MONGO_COLLECTION\": \"janusDeployment\", \"MONGO_KEY\": \"deploymentId\", \"MONGO_VALUE\": \"hpcl_cctv_ppe\", \"MONGO_COLL\": \"serviceConfiguration\", \"MONGO_DB\": \"ilens_ai\"}"
# os.environ["config"]="{\"TZ\": \"Asia/Kolkata\", \"MONGO_URI\": \"mongodb://admin:iLens$HPCLv605@10.5.2.91:2717\", \"MONGO_DATABASE\": \"ilens_ai\", \"MONGO_COLLECTION\": \"janusDeployment\", \"MONGO_KEY\": \"deploymentId\", \"MONGO_VALUE\": \"hpcl_cctv_ppe\", \"MONGO_COLL\": \"serviceConfiguration\", \"MONGO_DB\": \"ilens_ai\"}"
os
.
environ
[
"config"
]
=
"{
\"
TZ
\"
:
\"
Asia/Kolkata
\"
,
\"
MONGO_URI
\"
:
\"
mongodb://admin:iLens$1234@192.168.3.181:2717/admin
\"
,
\"
MONGO_DATABASE
\"
:
\"
ilens_ai
\"
,
\"
MONGO_COLLECTION
\"
:
\"
janusDeployment
\"
,
\"
MONGO_KEY
\"
:
\"
deploymentId
\"
,
\"
MONGO_VALUE
\"
:
\"
aarti_ppe
\"
,
\"
MONGO_COLL
\"
:
\"
serviceConfiguration
\"
,
\"
MONGO_DB
\"
:
\"
ilens_ai
\"
}"
#
os.environ["config"]="{\"TZ\": \"Asia/Kolkata\", \"MONGO_URI\": \"mongodb://admin:iLens$1234@192.168.3.181:2717/admin\", \"MONGO_DATABASE\": \"ilens_ai\", \"MONGO_COLLECTION\": \"janusDeployment\", \"MONGO_KEY\": \"deploymentId\", \"MONGO_VALUE\": \"aarti_ppe\", \"MONGO_COLL\": \"serviceConfiguration\", \"MONGO_DB\": \"ilens_ai\"}"
from
edge_engine.edge_processor
import
ExecutePipeline
from
edge_engine.edge_processor
import
ExecutePipeline
from
edge_engine.edge_processor
import
Pubs
from
edge_engine.edge_processor
import
Pubs
from
scripts
import
Ppe
from
scripts
import
Ppe
...
...
logs/ilens-edge_engine.log
View file @
310b078e
This source diff could not be displayed because it is too large. You can
view the blob
instead.
output/recorded_video_list.txt
View file @
310b078e
...
@@ -40,3 +40,13 @@ cba5d9e8-2138-4a53-b845-600ffd9ac6c41673945027.7105763.webm
...
@@ -40,3 +40,13 @@ cba5d9e8-2138-4a53-b845-600ffd9ac6c41673945027.7105763.webm
3291b3cf-0b04-48f8-993a-c754176c6ca81673945088.4803202.webm
3291b3cf-0b04-48f8-993a-c754176c6ca81673945088.4803202.webm
20a8f4c9-c315-4f3b-b4c7-5028856290ce1673945118.7755.webm
20a8f4c9-c315-4f3b-b4c7-5028856290ce1673945118.7755.webm
13159e47-a9e3-46c2-a611-24eda50329171673945149.1806812.webm
13159e47-a9e3-46c2-a611-24eda50329171673945149.1806812.webm
4667ce2e-598f-4974-9568-2523a03937cf1674613867.1548927.webm
427204c0-7231-47d2-a754-f6495db4dee61674614099.3403118.webm
93dd7783-f0d3-448f-8939-f1279ca908851674614129.876808.webm
341bd053-6817-4d90-a935-0d28c69707201674614160.6690917.webm
1d4fb86c-d147-4b43-a9c3-34d8d1c29cf01674614191.5612426.webm
eae32a35-16aa-4411-a0a5-453a090e3aee1674614222.4885771.webm
4eabe757-497e-476d-83ba-f99d6e0677051674614253.061201.webm
ed6e86fb-391f-4f81-94e8-ce04aca0a93f1674614442.5539196.webm
cbb8ecea-5a6b-4303-9464-dc1acacf10891674614473.4363682.webm
0f4aa969-1ae3-4e6d-b524-29a9e29fe3851674614504.0250866.webm
scripts/__pycache__/ppe.cpython-39.pyc
View file @
310b078e
No preview for this file type
scripts/ppe.py
View file @
310b078e
...
@@ -94,7 +94,8 @@ class Ppe(ModelWrapper):
...
@@ -94,7 +94,8 @@ class Ppe(ModelWrapper):
self
.
reported_violation_ids
=
{}
self
.
reported_violation_ids
=
{}
self
.
violation_count
=
{
"Air Breathing Mask"
:
[]
,
"Safety helmet"
:
[],
"Hand gloves"
:
[],
"coverall suit"
:
[]}
self
.
violation_count
=
{
"Air Breathing Mask"
:
[]
,
"Safety helmet"
:
[],
"Hand gloves"
:
[],
"coverall suit"
:
[]}
self
.
uri
=
"postgres://postgres:postgres@192.168.3.181:5432/postgres?sslmode=disable"
#self.uri = "postgres://postgres:postgres@192.168.3.181:5432/postgres?sslmode=disable"
self
.
uri
=
"postgres://vision_user:Vision#4321@192.168.0.237:30009/ilens_vision_aarti?sslmode=disable"
self
.
payload_classes
=
{
"Air Breathing Mask"
:
"air_breathing_mask_violation"
,
"Safety helmet"
:
"helmet_violation"
,
"Hand gloves"
:
"glove_violation"
,
"coverall suit"
:
"coverall_suit_violation"
}
self
.
payload_classes
=
{
"Air Breathing Mask"
:
"air_breathing_mask_violation"
,
"Safety helmet"
:
"helmet_violation"
,
"Hand gloves"
:
"glove_violation"
,
"coverall suit"
:
"coverall_suit_violation"
}
# connect to the PostgreSQL server
# connect to the PostgreSQL server
...
@@ -447,7 +448,7 @@ class Ppe(ModelWrapper):
...
@@ -447,7 +448,7 @@ class Ppe(ModelWrapper):
# rec_inf[1].release()
# rec_inf[1].release()
temp_v_list
=
rec_inf
[
3
]
temp_v_list
=
rec_inf
[
3
]
print
(
temp_v_list
)
print
(
temp_v_list
)
cv2
.
waitKey
(
1
)
#
cv2.waitKey(1)
for
v
in
temp_v_list
:
for
v
in
temp_v_list
:
# try:
# try:
...
@@ -502,7 +503,7 @@ class Ppe(ModelWrapper):
...
@@ -502,7 +503,7 @@ class Ppe(ModelWrapper):
# result = self.video_write(frame, unique_id)
# result = self.video_write(frame, unique_id)
requests
.
post
(
'http://192.168.3.181:2328/items/'
,
json
=
{
requests
.
post
(
'http://192.168.3.181:2328/items/'
,
json
=
{
"rtsp"
:
"rtsp://
192.168.3.181:8554/stream
"
,
"rtsp"
:
"rtsp://
admin:Admin@123@117.222.36.90:10556
"
,
"name"
:
str
(
unique_id
)
"name"
:
str
(
unique_id
)
})
})
...
@@ -522,7 +523,7 @@ class Ppe(ModelWrapper):
...
@@ -522,7 +523,7 @@ class Ppe(ModelWrapper):
cur
=
self
.
conn
.
cursor
()
cur
=
self
.
conn
.
cursor
()
# cur.execute("ROLLBACK")
# cur.execute("ROLLBACK")
frame_count
=
self
.
frame_id
frame_count
=
self
.
frame_id
cur
.
execute
(
sql
,
[
4
,
frame_count
,
datetime
.
datetime
.
now
(),
v
])
cur
.
execute
(
sql
,
[
1
,
frame_count
,
datetime
.
datetime
.
now
(),
v
])
self
.
conn
.
commit
()
self
.
conn
.
commit
()
cur
.
close
()
cur
.
close
()
...
@@ -534,7 +535,7 @@ class Ppe(ModelWrapper):
...
@@ -534,7 +535,7 @@ class Ppe(ModelWrapper):
cur
=
self
.
conn
.
cursor
()
cur
=
self
.
conn
.
cursor
()
frame_count
=
self
.
frame_id
frame_count
=
self
.
frame_id
file_path
=
"/home/administrator/aarti_violation_videos/"
+
str
(
unique_id
)
+
".webm"
file_path
=
"/home/administrator/aarti_violation_videos/"
+
str
(
unique_id
)
+
".webm"
cur
.
execute
(
sql
,
[
frame_count
,
4
,
str
(
unique_id
),
datetime
.
datetime
.
now
(),
file_path
,
v
])
cur
.
execute
(
sql
,
[
frame_count
,
1
,
str
(
unique_id
),
datetime
.
datetime
.
now
(),
file_path
,
v
])
self
.
conn
.
commit
()
self
.
conn
.
commit
()
cur
.
close
()
cur
.
close
()
except
:
except
:
...
@@ -593,7 +594,7 @@ class Ppe(ModelWrapper):
...
@@ -593,7 +594,7 @@ class Ppe(ModelWrapper):
# rec_inf[1].release()
# rec_inf[1].release()
temp_v_list
=
rec_inf
[
3
]
temp_v_list
=
rec_inf
[
3
]
print
(
temp_v_list
)
print
(
temp_v_list
)
cv2
.
waitKey
(
1
)
#
cv2.waitKey(1)
for
v
in
temp_v_list
:
for
v
in
temp_v_list
:
# # try:
# # try:
#
#
...
@@ -654,7 +655,7 @@ class Ppe(ModelWrapper):
...
@@ -654,7 +655,7 @@ class Ppe(ModelWrapper):
# f.write("\n")
# f.write("\n")
# result = self.video_write(frame, unique_id)
# result = self.video_write(frame, unique_id)
requests
.
post
(
'http://192.168.3.181:2328/items/'
,
json
=
{
requests
.
post
(
'http://192.168.3.181:2328/items/'
,
json
=
{
"rtsp"
:
"rtsp://
192.168.3.181:8554/stream
"
,
"rtsp"
:
"rtsp://
admin:Admin@123@117.222.36.90:10556
"
,
"name"
:
str
(
unique_id
)
"name"
:
str
(
unique_id
)
})
})
print
(
"unique id is:: "
,
str
(
unique_id
))
print
(
"unique id is:: "
,
str
(
unique_id
))
...
@@ -670,7 +671,7 @@ class Ppe(ModelWrapper):
...
@@ -670,7 +671,7 @@ class Ppe(ModelWrapper):
# present_event_id = 'SELECT "event_id" FROM aarti_violation_event_table'
# present_event_id = 'SELECT "event_id" FROM aarti_violation_event_table'
cur
=
self
.
conn
.
cursor
()
cur
=
self
.
conn
.
cursor
()
frame_count
=
self
.
frame_id
frame_count
=
self
.
frame_id
cur
.
execute
(
sql
,
[
4
,
frame_count
,
datetime
.
datetime
.
now
(),
v
])
cur
.
execute
(
sql
,
[
1
,
frame_count
,
datetime
.
datetime
.
now
(),
v
])
self
.
conn
.
commit
()
self
.
conn
.
commit
()
cur
.
close
()
cur
.
close
()
try
:
try
:
...
@@ -682,7 +683,7 @@ class Ppe(ModelWrapper):
...
@@ -682,7 +683,7 @@ class Ppe(ModelWrapper):
# cur.execute("ROLLBACK")
# cur.execute("ROLLBACK")
frame_count
=
self
.
frame_id
frame_count
=
self
.
frame_id
file_path
=
"/home/administrator/aarti_violation_videos/"
+
str
(
unique_id
)
+
".webm"
file_path
=
"/home/administrator/aarti_violation_videos/"
+
str
(
unique_id
)
+
".webm"
cur
.
execute
(
sql
,
[
frame_count
,
4
,
str
(
unique_id
),
datetime
.
datetime
.
now
(),
file_path
,
v
])
cur
.
execute
(
sql
,
[
frame_count
,
1
,
str
(
unique_id
),
datetime
.
datetime
.
now
(),
file_path
,
v
])
self
.
conn
.
commit
()
self
.
conn
.
commit
()
cur
.
close
()
cur
.
close
()
except
:
except
:
...
@@ -698,7 +699,7 @@ class Ppe(ModelWrapper):
...
@@ -698,7 +699,7 @@ class Ppe(ModelWrapper):
# rec_inf[1].release()
# rec_inf[1].release()
temp_v_list
=
rec_inf
[
3
]
temp_v_list
=
rec_inf
[
3
]
print
(
temp_v_list
)
print
(
temp_v_list
)
cv2
.
waitKey
(
1
)
#
cv2.waitKey(1)
for
v
in
temp_v_list
:
for
v
in
temp_v_list
:
# try:
# try:
...
@@ -798,7 +799,7 @@ class Ppe(ModelWrapper):
...
@@ -798,7 +799,7 @@ class Ppe(ModelWrapper):
# f.write("\n")
# f.write("\n")
# result = self.video_write(frame, unique_id)
# result = self.video_write(frame, unique_id)
requests
.
post
(
'http://192.168.3.181:2328/items/'
,
json
=
{
requests
.
post
(
'http://192.168.3.181:2328/items/'
,
json
=
{
"rtsp"
:
"rtsp://
192.168.3.181:8554/stream
"
,
"rtsp"
:
"rtsp://
admin:Admin@123@117.222.36.90:10556
"
,
"name"
:
str
(
unique_id
)
"name"
:
str
(
unique_id
)
})
})
print
(
"unique id is:: "
,
str
(
unique_id
))
print
(
"unique id is:: "
,
str
(
unique_id
))
...
@@ -814,7 +815,7 @@ class Ppe(ModelWrapper):
...
@@ -814,7 +815,7 @@ class Ppe(ModelWrapper):
# present_event_id = 'SELECT "event_id" FROM aarti_violation_event_table'
# present_event_id = 'SELECT "event_id" FROM aarti_violation_event_table'
cur
=
self
.
conn
.
cursor
()
cur
=
self
.
conn
.
cursor
()
frame_count
=
self
.
frame_id
frame_count
=
self
.
frame_id
cur
.
execute
(
sql
,
[
4
,
frame_count
,
datetime
.
datetime
.
now
(),
v
])
cur
.
execute
(
sql
,
[
1
,
frame_count
,
datetime
.
datetime
.
now
(),
v
])
self
.
conn
.
commit
()
self
.
conn
.
commit
()
cur
.
close
()
cur
.
close
()
try
:
try
:
...
@@ -826,7 +827,7 @@ class Ppe(ModelWrapper):
...
@@ -826,7 +827,7 @@ class Ppe(ModelWrapper):
# cur.execute("ROLLBACK")
# cur.execute("ROLLBACK")
frame_count
=
self
.
frame_id
frame_count
=
self
.
frame_id
file_path
=
"/home/administrator/aarti_violation_videos/"
+
str
(
unique_id
)
+
".webm"
file_path
=
"/home/administrator/aarti_violation_videos/"
+
str
(
unique_id
)
+
".webm"
cur
.
execute
(
sql
,
[
frame_count
,
4
,
str
(
unique_id
),
datetime
.
datetime
.
now
(),
file_path
,
v
])
cur
.
execute
(
sql
,
[
frame_count
,
1
,
str
(
unique_id
),
datetime
.
datetime
.
now
(),
file_path
,
v
])
self
.
conn
.
commit
()
self
.
conn
.
commit
()
cur
.
close
()
cur
.
close
()
except
:
except
:
...
@@ -1085,8 +1086,8 @@ class Ppe(ModelWrapper):
...
@@ -1085,8 +1086,8 @@ class Ppe(ModelWrapper):
# frame = cv2.polylines(frame, self.polygon,
# frame = cv2.polylines(frame, self.polygon,
# True, (255, 255, 255), 2)
# True, (255, 255, 255), 2)
bbox
,
frame
,
class_name
,
other_class_name
,
other_centroid
=
self
.
inference
(
frame
,
class_list
)
bbox
,
frame
,
class_name
,
other_class_name
,
other_centroid
=
self
.
inference
(
frame
,
class_list
)
cv2
.
imshow
(
"out"
,
cv2
.
resize
(
frame
,
(
900
,
600
)))
#
cv2.imshow("out", cv2.resize(frame, (900, 600)))
cv2
.
waitKey
(
1
)
#
cv2.waitKey(1)
# frame = self.draw_line_over_image(frame)
# frame = self.draw_line_over_image(frame)
# if [True for e in dets if e['class'] == 'cement_bag']:
# if [True for e in dets if e['class'] == 'cement_bag']:
...
...
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