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
36ca7407
Commit
36ca7407
authored
May 08, 2023
by
Sikhin VC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added datetime change API
parent
2e50b6d0
Pipeline
#69370
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
41 deletions
+3
-41
scripts/cement_counter.py
scripts/cement_counter.py
+3
-41
No files found.
scripts/cement_counter.py
View file @
36ca7407
...
@@ -13,12 +13,9 @@ from scripts.utils.image_utils import draw_circles_on_frame
...
@@ -13,12 +13,9 @@ from scripts.utils.image_utils import draw_circles_on_frame
from
scripts.utils.tracker
import
Tracker
from
scripts.utils.tracker
import
Tracker
from
scripts.utils.yolov5_trt
import
YoloV5TRT
from
scripts.utils.yolov5_trt
import
YoloV5TRT
from
scipy.optimize
import
linear_sum_assignment
as
linear_assignment
from
scipy.optimize
import
linear_sum_assignment
as
linear_assignment
from
edge_engine.common.config
import
EDGE_CONFIG
,
LAST_COUNT
,
MONGO_URI_ADD_EVENTLOGS
,
DATE_TIME
from
edge_engine.common.config
import
EDGE_CONFIG
,
LAST_COUNT
,
MONGO_URI_ADD_EVENTLOGS
import
requests
import
requests
from
uuid
import
uuid1
from
uuid
import
uuid1
import
ctypes
import
ctypes.util
import
time
class
CementBagCounter
(
ModelWrapper
):
class
CementBagCounter
(
ModelWrapper
):
...
@@ -58,43 +55,8 @@ class CementBagCounter(ModelWrapper):
...
@@ -58,43 +55,8 @@ class CementBagCounter(ModelWrapper):
self
.
frame_count
=
0
self
.
frame_count
=
0
self
.
frame
=
None
self
.
frame
=
None
self
.
centroid_distance
=
10
self
.
centroid_distance
=
10
self
.
set_time
(
DATE_TIME
)
def
set_time
(
self
,
time_tuple
):
time_tuple
=
(
2012
,
# Year
9
,
# Month
6
,
# Day
0
,
# Hour
38
,
# Minute
0
,
# Second
0
,
# Millisecond
)
# /usr/include/linux/time.h:
#
# define CLOCK_REALTIME 0
CLOCK_REALTIME
=
0
# /usr/include/time.h
#
# struct timespec
# {
# __time_t tv_sec; /* Seconds. */
# long int tv_nsec; /* Nanoseconds. */
# };
class
timespec
(
ctypes
.
Structure
):
_fields_
=
[(
"tv_sec"
,
ctypes
.
c_long
),
(
"tv_nsec"
,
ctypes
.
c_long
)]
librt
=
ctypes
.
CDLL
(
ctypes
.
util
.
find_library
(
"rt"
))
ts
=
timespec
()
ts
.
tv_sec
=
int
(
time
.
mktime
(
datetime
(
*
time_tuple
[:
6
])
.
timetuple
()
)
)
ts
.
tv_nsec
=
time_tuple
[
6
]
*
1000000
# Millisecond to nanosecond
# http://linux.die.net/man/3/clock_settime
librt
.
clock_settime
(
CLOCK_REALTIME
,
ctypes
.
byref
(
ts
))
logger
.
info
(
f
"Time set to {DATE_TIME}"
)
def
_pre_process
(
self
,
x
):
def
_pre_process
(
self
,
x
):
"""
"""
Do preprocessing here, if any
Do preprocessing here, if any
...
...
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