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
663fd942
Commit
663fd942
authored
May 05, 2023
by
Sikhin VC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added server API endpoints
parent
fad7506f
Pipeline
#69157
failed with stage
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
34 deletions
+6
-34
edge_engine/common/config.py
edge_engine/common/config.py
+3
-31
scripts/cement_counter.py
scripts/cement_counter.py
+3
-3
No files found.
edge_engine/common/config.py
View file @
663fd942
import
os
import
sys
from
edge_engine.common.constants
import
LicenseModule
from
dateutil
import
parser
from
datetime
import
datetime
from
pymongo
import
MongoClient
from
copy
import
deepcopy
import
json
import
requests
...
...
@@ -22,22 +19,6 @@ def licence_validator(payload):
return
False
# """
# {
# "MONGO_URI": "mongodb://192.168.3.220:21017",
# "MONGO_DATABASE": "ilens_thermal_app",
# "MONGO_COLLECTION": "janus_deployment_details",
# "MONGO_KEY": "deploymentId",
# "MONGO_VALUE": "ddd"
# }
# """
LOG_LEVEL
=
os
.
environ
.
get
(
"LOG_LEVEL"
,
default
=
"INFO"
)
.
upper
()
LOG_HANDLER_NAME
=
os
.
environ
.
get
(
"LOG_HANDLER_NAME"
,
default
=
"ilens-edge_engine"
)
...
...
@@ -48,23 +29,14 @@ if not os.path.isdir(BASE_LOG_PATH):
os
.
mkdir
(
BASE_LOG_PATH
)
CONFIG_ENV
=
json
.
loads
(
os
.
environ
.
get
(
'config'
,
default
=
None
))
# sys.stdout.write("config->{} \n".format(json.dumps(CONFIG_ENV)))
# MONGO_URI = CONFIG_ENV.get('MONGO_URI', None)
# MONGO_DATABASE = CONFIG_ENV.get('MONGO_DATABASE', None)
# MONGO_COLLECTION = CONFIG_ENV.get('MONGO_COLLECTION', None)
# MONGO_KEY = CONFIG_ENV.get('MONGO_KEY', None)
DEPLOYMENT_ID
=
CONFIG_ENV
.
get
(
'MONGO_VALUE'
,
None
)
# deployment_id = "jkoverlappingremoval_e4958a70"
# deployment_id = os.environ.get('deployment_id')
# print("deployment id", DEPLOYMENT_ID)
url
=
f
'http://192.168.2.228:2325/custom/get_janus?deploymentId={DEPLOYMENT_ID}'
url
=
f
'http://192.168.3.181/camera_api/custom/get_janus?deploymentId={DEPLOYMENT_ID}'
EDGE_CONFIG
=
requests
.
get
(
url
)
.
json
()[
"data"
]
LAST_COUNT
=
requests
.
get
(
url
)
.
json
()[
"latest_count"
]
print
(
"EDGE CONFIG"
)
print
(
EDGE_CONFIG
)
# print("edge config2 , : ", EDGE_CONFIG)
DEVICE_ID
=
EDGE_CONFIG
[
"deviceId"
]
DATA_PATH
=
EDGE_CONFIG
[
"inputConf"
]
.
get
(
'dataPath'
,
os
.
path
.
join
(
os
.
getcwd
(),
"data"
.
format
()))
...
...
scripts/cement_counter.py
View file @
663fd942
...
...
@@ -19,7 +19,7 @@ from scripts.utils.infocenter import MongoLogger
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
from
edge_engine.common.config
import
EDGE_CONFIG
,
LAST_COUNT
import
requests
from
uuid
import
uuid1
...
...
@@ -47,7 +47,7 @@ class CementBagCounter(ModelWrapper):
self
.
ct1
=
CentroidTracker
(
maxDisappeared
=
5
)
self
.
ct2
=
CentroidTracker
(
maxDisappeared
=
5
)
self
.
count
=
0
self
.
count
=
int
(
LAST_COUNT
)
self
.
tracker_list
=
[]
self
.
max_age
=
3
self
.
min_hits
=
0
...
...
@@ -328,7 +328,7 @@ class CementBagCounter(ModelWrapper):
elif
object_id
in
self
.
uncounted_objects
:
self
.
uncounted_objects
.
pop
(
object_id
,
None
)
self
.
count
+=
1
url
=
"http://192.168.
2.228:2325
/events/add_event"
url
=
"http://192.168.
3.181/camera_api
/events/add_event"
img2
=
frame
.
copy
()
img2
=
cv2
.
resize
(
img2
,
(
64
,
64
))
...
...
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