Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jk_edge_code_api_integration
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
jk_edge_code_api_integration
Commits
d47db010
Commit
d47db010
authored
May 04, 2023
by
Sikhin VC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added engine file
parent
1a7a0d4e
Pipeline
#69091
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
scripts/cement_counter.py
scripts/cement_counter.py
+9
-6
No files found.
scripts/cement_counter.py
View file @
d47db010
...
...
@@ -20,6 +20,7 @@ from scripts.utils.tracker import Tracker
from
scripts.utils.yolov5_trt
import
YoloV5TRT
from
scipy.optimize
import
linear_sum_assignment
as
linear_assignment
from
edge_engine.common.config
import
EDGE_CONFIG
import
requests
class
CementBagCounter
(
ModelWrapper
):
...
...
@@ -326,12 +327,14 @@ class CementBagCounter(ModelWrapper):
elif
object_id
in
self
.
uncounted_objects
:
self
.
uncounted_objects
.
pop
(
object_id
,
None
)
self
.
count
+=
1
self
.
send_payload
(
resize_to_64_64
(
frame
=
frame
),
bag_type
=
"cement_bag"
,
message
=
"cement_bag"
,
count
=
self
.
count
,
)
url
=
"http://192.168.2.228:2325/events/add_event"
img2
=
frame
.
copy
()
img2
=
cv2
.
resize
(
img2
,
(
64
,
64
))
bs64
=
str
(
base64
.
b64encode
(
img2
)
.
decode
(
'utf-8'
))
# Changed this line. converted byte to string
json
=
{
"eventId"
:
"123"
,
"cameraId"
:
"12"
,
"cameraName"
:
"12"
,
"timestamp"
:
"123"
,
"frame"
:
bs64
}
response
=
requests
.
post
(
url
=
url
,
json
=
json
)
logger
.
info
(
f
"response is : {response.text}"
)
logger
.
info
(
f
"Count: {self.count}"
)
frame
=
draw_circles_on_frame
(
...
...
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