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
c2e66c36
Commit
c2e66c36
authored
May 05, 2023
by
Sikhin VC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added server API endpoints
parent
7ebb7aef
Pipeline
#69221
canceled with stage
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
scripts/cement_counter.py
scripts/cement_counter.py
+1
-0
No files found.
scripts/cement_counter.py
View file @
c2e66c36
...
@@ -332,6 +332,7 @@ class CementBagCounter(ModelWrapper):
...
@@ -332,6 +332,7 @@ class CementBagCounter(ModelWrapper):
img2
=
cv2
.
resize
(
img2
,
(
64
,
64
))
img2
=
cv2
.
resize
(
img2
,
(
64
,
64
))
bs64
=
str
(
base64
.
b64encode
(
img2
)
.
decode
(
'utf-8'
))
# Changed this line. converted byte to string
bs64
=
str
(
base64
.
b64encode
(
img2
)
.
decode
(
'utf-8'
))
# Changed this line. converted byte to string
json
=
{
"eventId"
:
str
(
uuid1
())
.
split
(
'-'
)[
0
],
"cameraId"
:
EDGE_CONFIG
[
'deviceId'
],
"cameraName"
:
EDGE_CONFIG
[
'deviceId'
],
"timestamp"
:
datetime
.
isoformat
(
datetime
.
now
()),
"frame"
:
bs64
,
"cement_bag_count"
:
self
.
count
}
json
=
{
"eventId"
:
str
(
uuid1
())
.
split
(
'-'
)[
0
],
"cameraId"
:
EDGE_CONFIG
[
'deviceId'
],
"cameraName"
:
EDGE_CONFIG
[
'deviceId'
],
"timestamp"
:
datetime
.
isoformat
(
datetime
.
now
()),
"frame"
:
bs64
,
"cement_bag_count"
:
self
.
count
}
logger
.
info
(
f
"json is {json}"
)
response
=
requests
.
post
(
url
=
MONGO_URI_ADD_EVENTLOGS
,
json
=
json
)
response
=
requests
.
post
(
url
=
MONGO_URI_ADD_EVENTLOGS
,
json
=
json
)
logger
.
info
(
f
"response is : {response.text}"
)
logger
.
info
(
f
"response is : {response.text}"
)
logger
.
info
(
f
"Count: {self.count}"
)
logger
.
info
(
f
"Count: {self.count}"
)
...
...
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