-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalpr-vit.jsonnet
More file actions
74 lines (66 loc) · 2.15 KB
/
alpr-vit.jsonnet
File metadata and controls
74 lines (66 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{
local defaultAlprSettings = {
AORP_MODULE_PATH:"/opt/vodi/libexec/aorp/modules:/opt/edge/libexec/unity/aorp/modules",
thread_max: 1,
plate_width_min: 0.045,
},
alprSettings: {
kz: {
country_code: 398,
modules: ["vpwi-kz"]
},
uz: {
country_code: 860,
modules: ["vpwi-uz"]
},
},
local defaultAlprEnv = [
["LD_LIBRARY_PATH", "/opt/vodi/lib:/opt/vodi/lib/openvino:/opt/edge/lib:/opt/edge/lib/openvino"],
["VPW_PLATECANDS_METHODS", "4"],
["VPW_PLATECANDS_BY_DNN_VARIATE", "0"],
["VPW_PLATE_ANALYSE_METHODS", "32"],
["KMP_AFFINITY", "granularity=fine,compact,1,0"],
["OMP_NUM_THREADS", "1"],
["VPW_LOG_SETTINGS", "1"],
],
dnnDevices: {
npu: "[pd-2:npu+ncaps4,lsd:npu+ncaps2,ssd:npu+ncaps2,cd:npu+ncaps4]",
cpu: "CPU",
cpu2: "[pd-2:сpu,lsd:сpu,ssd:сpu,cd:сpu]",
},
mk_alpr_object_name (cid, id): "alpr_" + cid + "_" + id,
mk_alpr_object (name, renderer_name, dnnDevices, alprSettings): {
type: "process",
name: name,
executable: "/usr/lib/vnxlpr/vit-alpr",
cwd: "/",
env: defaultAlprEnv + [
["VPW_DNN_DEVICES", dnnDevices],
],
restart: true,
timeout: 10,
init: defaultAlprSettings + alprSettings + {
video_source: renderer_name,
}
},
mk_rtms_export_script_object(name, alprName, videoSource, orig, app): {
type: "script",
name: name,
inline: "require('vnx-script-instance')('rtms-kz.js');",
init: {
alpr_name: alprName,
video_source: orig.camName,
local origId = if orig.substreamOf != null then orig.substreamOf else orig.id,
origin_id: origId,
origin_name: if "name" in orig.meta then orig.meta.name else origId,
origin_serial_number: if "serial_number" in orig.meta then orig.meta.serial_number else origId,
origin_address: if "address" in orig.meta
then orig.meta.address
else (if "desc" in orig.meta
then orig.meta.desc
else origId),
location: if "location" in orig.meta then orig.meta.location else null,
endpoint: app.rtmsEndpoint
}
},
}