|
|
|
@ -911,18 +911,23 @@ ${newstr}class-id=0
|
|
|
|
|
|
|
|
|
|
console.log(this.hostData); |
|
|
|
|
//如果之前保存过文件
|
|
|
|
|
if (this.hostData.configFiles && this.hostData.configFiles.length !== 0) { |
|
|
|
|
let config_arm = this.hostData.configFiles.find( |
|
|
|
|
let config_armFile = this.hostData.configFiles.find( |
|
|
|
|
(item) => item.name == 'config_arm.yaml' |
|
|
|
|
).content; |
|
|
|
|
let config_x86 = this.hostData.configFiles.find( |
|
|
|
|
); |
|
|
|
|
let config_x86File = this.hostData.configFiles.find( |
|
|
|
|
(item) => item.name == 'config_x86.yaml' |
|
|
|
|
).content; |
|
|
|
|
let producer = this.hostData.configFiles.find( |
|
|
|
|
); |
|
|
|
|
let producerFile = this.hostData.configFiles.find( |
|
|
|
|
(item) => item.name == 'producer.yaml' |
|
|
|
|
); |
|
|
|
|
if ( |
|
|
|
|
this.hostData.configFiles && |
|
|
|
|
this.hostData.configFiles.length !== 0 && |
|
|
|
|
config_armFile |
|
|
|
|
) { |
|
|
|
|
let config_arm = this.hostData.configFiles.find( |
|
|
|
|
(item) => item.name == 'config_arm.yaml' |
|
|
|
|
).content; |
|
|
|
|
// console.log(111, config_arm);
|
|
|
|
|
// console.log(222, config_x86);
|
|
|
|
|
//修改config_arm.yaml文件
|
|
|
|
|
//更改connet_oil
|
|
|
|
|
let config_armObj = yaml.load(config_arm); |
|
|
|
@ -946,55 +951,26 @@ ${newstr}class-id=0
|
|
|
|
|
}); |
|
|
|
|
config_armObj.connet_grounder.roi[0][key2] = [arr2]; |
|
|
|
|
config2 = yaml.dump(config_armObj, { lineWidth: -1 }); |
|
|
|
|
//修改config_x86.yaml文件
|
|
|
|
|
//更改connet_oil
|
|
|
|
|
let config_x86Obj = yaml.load(config_x86); |
|
|
|
|
console.log('config_x86.yaml', config_x86Obj); |
|
|
|
|
for (const key in config_x86Obj.connet_oil.roi[0]) { |
|
|
|
|
delete config_x86Obj.connet_oil.roi[0][key]; |
|
|
|
|
} |
|
|
|
|
let key3 = `oil_tube-${oilDischargeOrder}`; |
|
|
|
|
let arr3 = []; |
|
|
|
|
xieyouguan.split(',').forEach((item) => { |
|
|
|
|
arr3.push(Number(item)); |
|
|
|
|
}); |
|
|
|
|
config_x86Obj.connet_oil.roi[0][key3] = [arr3]; |
|
|
|
|
// 更改connet_grounder
|
|
|
|
|
for (const key in config_x86Obj.connet_grounder.roi[0]) { |
|
|
|
|
delete config_x86Obj.connet_grounder.roi[0][key]; |
|
|
|
|
} |
|
|
|
|
let key4 = `grounder-${oilDischargeOrder}`; |
|
|
|
|
let arr4 = []; |
|
|
|
|
jingdian.split(',').forEach((item) => { |
|
|
|
|
arr4.push(Number(item)); |
|
|
|
|
}); |
|
|
|
|
config_x86Obj.connet_grounder.roi[0][key4] = [arr4]; |
|
|
|
|
config3 = yaml.dump(config_x86Obj, { lineWidth: -1 }); |
|
|
|
|
|
|
|
|
|
// let producerObj = yaml.load(producer);
|
|
|
|
|
// config4 = yaml.dump(producerObj, { lineWidth: -1 });
|
|
|
|
|
config4 = producer; |
|
|
|
|
console.log(); |
|
|
|
|
} else { |
|
|
|
|
//使用模板
|
|
|
|
|
config2 = `# The all in one config file.
|
|
|
|
|
|
|
|
|
|
debug: false #when the debug is on, osd. |
|
|
|
|
video_record: 10 #time to record into the .ts video |
|
|
|
|
debug: false #when the debug is on, osd. |
|
|
|
|
video_record: 10 #time to record into the .ts video |
|
|
|
|
|
|
|
|
|
sources: |
|
|
|
|
sources: |
|
|
|
|
config: 'config/source.yaml' |
|
|
|
|
|
|
|
|
|
tracker: |
|
|
|
|
tracker: |
|
|
|
|
config: 'config/dstest_tracker_config.txt' |
|
|
|
|
|
|
|
|
|
analytics: |
|
|
|
|
analytics: |
|
|
|
|
config: 'config/config_nvdsanalytics.txt' |
|
|
|
|
|
|
|
|
|
## 通用模型 ## |
|
|
|
|
## 通用模型 ## |
|
|
|
|
|
|
|
|
|
# 1:人物检测 |
|
|
|
|
peoplenet: |
|
|
|
|
# 1:人物检测 |
|
|
|
|
peoplenet: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: -1 |
|
|
|
|
interval: 1 |
|
|
|
@ -1007,8 +983,8 @@ ${newstr}class-id=0
|
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/peoplenet/weights/yolov4_cspdarknet_tiny_fp16.etlt_b16_gpu0_fp16.engine' |
|
|
|
|
threshold: 0.3 |
|
|
|
|
|
|
|
|
|
# 2:车辆检测 |
|
|
|
|
trafficcam: |
|
|
|
|
# 2:车辆检测 |
|
|
|
|
trafficcam: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: 0 |
|
|
|
|
interval: 1 |
|
|
|
@ -1020,8 +996,8 @@ ${newstr}class-id=0
|
|
|
|
|
detected-min-h: 100 |
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/trafficcam/weights/resnet18_trafficcamnet_pruned.etlt_b16_gpu0_int8.engine' |
|
|
|
|
|
|
|
|
|
# 3:人物倚靠行为 |
|
|
|
|
actionnet: |
|
|
|
|
# 3:人物倚靠行为 |
|
|
|
|
actionnet: |
|
|
|
|
enable: false |
|
|
|
|
apply_on: 1 |
|
|
|
|
# roi: |
|
|
|
@ -1036,8 +1012,8 @@ ${newstr}class-id=0
|
|
|
|
|
interval: 1 |
|
|
|
|
batch_size: 32 |
|
|
|
|
|
|
|
|
|
# 4:烟火检测 |
|
|
|
|
fire_smoke_net: |
|
|
|
|
# 4:烟火检测 |
|
|
|
|
fire_smoke_net: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: -1 |
|
|
|
|
interval: 1 |
|
|
|
@ -1045,26 +1021,26 @@ ${newstr}class-id=0
|
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/fire_smoke_net/weights/yolov4_cspdarknet_tiny_fp16.etlt_b16_gpu0_fp16.engine' |
|
|
|
|
threshold: 0.95 |
|
|
|
|
|
|
|
|
|
# 5:抽烟打电话检测 |
|
|
|
|
smoking_calling_net: |
|
|
|
|
# 5:抽烟打电话检测 |
|
|
|
|
smoking_calling_net: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: -1 |
|
|
|
|
interval: 1 |
|
|
|
|
batch_size: 2 |
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/smoking_calling_net/weights/resnet50_smoking_calling_net_fp16.etlt_b2_gpu0_fp16.engine' |
|
|
|
|
|
|
|
|
|
## 油站专用模型 ## |
|
|
|
|
## 油站专用模型 ## |
|
|
|
|
|
|
|
|
|
# 1:身份判别:工装、反光衣、便衣 |
|
|
|
|
idnet: |
|
|
|
|
# 1:身份判别:工装、反光衣、便衣 |
|
|
|
|
idnet: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: -1 |
|
|
|
|
interval: 1 |
|
|
|
|
batch_size: 2 |
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/idnet/weights/resnet50_idnet_fp16.etlt_b2_gpu0_fp16.engine' |
|
|
|
|
|
|
|
|
|
# 2:卸油区物体识别:油罐车、灭火器、手推车、三角木、取样桶、隔离锥、卸油管 |
|
|
|
|
oilnet: |
|
|
|
|
# 2:卸油区物体识别:油罐车、灭火器、手推车、三角木、取样桶、隔离锥、卸油管 |
|
|
|
|
oilnet: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: 2 |
|
|
|
|
interval: 1 |
|
|
|
@ -1076,8 +1052,8 @@ ${newstr}class-id=0
|
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/oilnet/weights/yolov4_cspdarknet_tiny_fp16.etlt_b2_gpu0_fp16.engine' |
|
|
|
|
threshold: 0.5 |
|
|
|
|
|
|
|
|
|
# 3:卸油管是否连接判定 |
|
|
|
|
connet_oil: |
|
|
|
|
# 3:卸油管是否连接判定 |
|
|
|
|
connet_oil: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: 2 |
|
|
|
|
roi: |
|
|
|
@ -1087,8 +1063,8 @@ ${newstr}class-id=0
|
|
|
|
|
batch_size: 2 |
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/connet_oil/weights/resnet50_connet_oil_fp16.etlt_b2_gpu0_fp16.engine' |
|
|
|
|
|
|
|
|
|
# 4:静电接地仪器是否连接判定 |
|
|
|
|
connet_grounder: |
|
|
|
|
# 4:静电接地仪器是否连接判定 |
|
|
|
|
connet_grounder: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: 2 |
|
|
|
|
roi: |
|
|
|
@ -1098,8 +1074,8 @@ ${newstr}class-id=0
|
|
|
|
|
batch_size: 2 |
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/connet_grounder/weights/resnet50_connet_grounder_fp16.etlt_b2_gpu0_fp16.engine' |
|
|
|
|
|
|
|
|
|
# 5:散装桶加油 |
|
|
|
|
bulk_oil_net: |
|
|
|
|
# 5:散装桶加油 |
|
|
|
|
bulk_oil_net: |
|
|
|
|
enable: False |
|
|
|
|
apply_on: 2 |
|
|
|
|
interval: 1 |
|
|
|
@ -1107,8 +1083,8 @@ ${newstr}class-id=0
|
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/bulk_oil_net/weights/yolov4_cspdarknet_tiny_fp16.etlt_b2_gpu0_fp16.engine' |
|
|
|
|
threshold: 0.2 |
|
|
|
|
|
|
|
|
|
# 模型阈值通用设定 |
|
|
|
|
rule_threshold: |
|
|
|
|
# 模型阈值通用设定 |
|
|
|
|
rule_threshold: |
|
|
|
|
object_occurence_interval_second: 3 |
|
|
|
|
object_disappear_interval_second: 10 |
|
|
|
|
on_car_parking_interval_second: 1800 |
|
|
|
@ -1123,25 +1099,60 @@ ${newstr}class-id=0
|
|
|
|
|
threshold_secondary_model: 0.5
|
|
|
|
|
secondary_model_window: 50 |
|
|
|
|
secondary_model_path: '/opt/app/xgboost' |
|
|
|
|
`;
|
|
|
|
|
`;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
this.hostData.configFiles && |
|
|
|
|
this.hostData.configFiles.length !== 0 && |
|
|
|
|
config_x86File |
|
|
|
|
) { |
|
|
|
|
let config_x86 = this.hostData.configFiles.find( |
|
|
|
|
(item) => item.name == 'config_x86.yaml' |
|
|
|
|
).content; |
|
|
|
|
//修改config_x86.yaml文件
|
|
|
|
|
//更改connet_oil
|
|
|
|
|
let config_x86Obj = yaml.load(config_x86); |
|
|
|
|
console.log('config_x86.yaml', config_x86Obj); |
|
|
|
|
for (const key in config_x86Obj.connet_oil.roi[0]) { |
|
|
|
|
delete config_x86Obj.connet_oil.roi[0][key]; |
|
|
|
|
} |
|
|
|
|
let key3 = `oil_tube-${oilDischargeOrder}`; |
|
|
|
|
let arr3 = []; |
|
|
|
|
xieyouguan.split(',').forEach((item) => { |
|
|
|
|
arr3.push(Number(item)); |
|
|
|
|
}); |
|
|
|
|
config_x86Obj.connet_oil.roi[0][key3] = [arr3]; |
|
|
|
|
// 更改connet_grounder
|
|
|
|
|
for (const key in config_x86Obj.connet_grounder.roi[0]) { |
|
|
|
|
delete config_x86Obj.connet_grounder.roi[0][key]; |
|
|
|
|
} |
|
|
|
|
let key4 = `grounder-${oilDischargeOrder}`; |
|
|
|
|
let arr4 = []; |
|
|
|
|
jingdian.split(',').forEach((item) => { |
|
|
|
|
arr4.push(Number(item)); |
|
|
|
|
}); |
|
|
|
|
config_x86Obj.connet_grounder.roi[0][key4] = [arr4]; |
|
|
|
|
config3 = yaml.dump(config_x86Obj, { lineWidth: -1 }); |
|
|
|
|
} else { |
|
|
|
|
config3 = `# The all in one config file.
|
|
|
|
|
|
|
|
|
|
debug: false #when the debug is on, osd. |
|
|
|
|
video_record: 10 #time to record into the .ts video |
|
|
|
|
debug: false #when the debug is on, osd. |
|
|
|
|
video_record: 10 #time to record into the .ts video |
|
|
|
|
|
|
|
|
|
sources: |
|
|
|
|
sources: |
|
|
|
|
config: 'config/source.yaml' |
|
|
|
|
|
|
|
|
|
tracker: |
|
|
|
|
tracker: |
|
|
|
|
config: 'config/dstest_tracker_config.txt' |
|
|
|
|
|
|
|
|
|
analytics: |
|
|
|
|
analytics: |
|
|
|
|
config: 'config/config_nvdsanalytics.txt' |
|
|
|
|
|
|
|
|
|
## 通用模型 ## |
|
|
|
|
## 通用模型 ## |
|
|
|
|
|
|
|
|
|
# 1:人物检测 |
|
|
|
|
peoplenet: |
|
|
|
|
# 1:人物检测 |
|
|
|
|
peoplenet: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: -1 |
|
|
|
|
interval: 1 |
|
|
|
@ -1154,8 +1165,8 @@ ${newstr}class-id=0
|
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/peoplenet/weights/yolov4_cspdarknet_tiny_fp16.etlt_b16_gpu0_fp32.engine' |
|
|
|
|
threshold: 0.3 |
|
|
|
|
|
|
|
|
|
# 2:车辆检测 |
|
|
|
|
trafficcam: |
|
|
|
|
# 2:车辆检测 |
|
|
|
|
trafficcam: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: 0 |
|
|
|
|
interval: 1 |
|
|
|
@ -1167,8 +1178,8 @@ ${newstr}class-id=0
|
|
|
|
|
detected-min-h: 100 |
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/trafficcam/weights/resnet18_trafficcamnet_pruned.etlt_b16_gpu0_int8.engine' |
|
|
|
|
|
|
|
|
|
# 3:人物倚靠行为 |
|
|
|
|
actionnet: |
|
|
|
|
# 3:人物倚靠行为 |
|
|
|
|
actionnet: |
|
|
|
|
enable: false |
|
|
|
|
apply_on: 1 |
|
|
|
|
# roi: |
|
|
|
@ -1183,8 +1194,8 @@ ${newstr}class-id=0
|
|
|
|
|
interval: 1 |
|
|
|
|
batch_size: 32 |
|
|
|
|
|
|
|
|
|
# 4:烟火检测 |
|
|
|
|
fire_smoke_net: |
|
|
|
|
# 4:烟火检测 |
|
|
|
|
fire_smoke_net: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: -1 |
|
|
|
|
interval: 1 |
|
|
|
@ -1192,26 +1203,26 @@ ${newstr}class-id=0
|
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/fire_smoke_net/weights/yolov4_cspdarknet_tiny_fp16.etlt_b16_gpu0_fp32.engine' |
|
|
|
|
threshold: 0.95 |
|
|
|
|
|
|
|
|
|
# 5:抽烟打电话检测 |
|
|
|
|
smoking_calling_net: |
|
|
|
|
# 5:抽烟打电话检测 |
|
|
|
|
smoking_calling_net: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: -1 |
|
|
|
|
interval: 1 |
|
|
|
|
batch_size: 2 |
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/smoking_calling_net/weights/resnet50_smoking_calling_net_fp16.etlt_b2_gpu0_fp32.engine' |
|
|
|
|
|
|
|
|
|
## 油站专用模型 ## |
|
|
|
|
## 油站专用模型 ## |
|
|
|
|
|
|
|
|
|
# 1:身份判别:工装、反光衣、便衣 |
|
|
|
|
idnet: |
|
|
|
|
# 1:身份判别:工装、反光衣、便衣 |
|
|
|
|
idnet: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: -1 |
|
|
|
|
interval: 1 |
|
|
|
|
batch_size: 2 |
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/idnet/weights/resnet50_idnet_fp16.etlt_b2_gpu0_fp32.engine' |
|
|
|
|
|
|
|
|
|
# 2:卸油区物体识别:油罐车、灭火器、手推车、三角木、取样桶、隔离锥、卸油管 |
|
|
|
|
oilnet: |
|
|
|
|
# 2:卸油区物体识别:油罐车、灭火器、手推车、三角木、取样桶、隔离锥、卸油管 |
|
|
|
|
oilnet: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: 2 |
|
|
|
|
interval: 1 |
|
|
|
@ -1223,8 +1234,8 @@ ${newstr}class-id=0
|
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/oilnet/weights/yolov4_cspdarknet_tiny_fp16.etlt_b2_gpu0_fp32.engine' |
|
|
|
|
threshold: 0.5 |
|
|
|
|
|
|
|
|
|
# 3:卸油管是否连接判定 |
|
|
|
|
connet_oil: |
|
|
|
|
# 3:卸油管是否连接判定 |
|
|
|
|
connet_oil: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: 2 |
|
|
|
|
roi: |
|
|
|
@ -1234,8 +1245,8 @@ ${newstr}class-id=0
|
|
|
|
|
batch_size: 2 |
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/connet_oil/weights/resnet50_connet_oil_fp16.etlt_b2_gpu0_fp32.engine' |
|
|
|
|
|
|
|
|
|
# 4:静电接地仪器是否连接判定 |
|
|
|
|
connet_grounder: |
|
|
|
|
# 4:静电接地仪器是否连接判定 |
|
|
|
|
connet_grounder: |
|
|
|
|
enable: true |
|
|
|
|
apply_on: 2 |
|
|
|
|
roi: |
|
|
|
@ -1245,8 +1256,8 @@ ${newstr}class-id=0
|
|
|
|
|
batch_size: 2 |
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/connet_grounder/weights/resnet50_connet_grounder_fp16.etlt_b2_gpu0_fp32.engine' |
|
|
|
|
|
|
|
|
|
# 5:散装桶加油 |
|
|
|
|
bulk_oil_net: |
|
|
|
|
# 5:散装桶加油 |
|
|
|
|
bulk_oil_net: |
|
|
|
|
enable: False |
|
|
|
|
apply_on: 2 |
|
|
|
|
interval: 1 |
|
|
|
@ -1254,8 +1265,8 @@ ${newstr}class-id=0
|
|
|
|
|
model_engine_file: '/opt/nvidia/deepstream/deepstream-6.0/sources/project/models/bulk_oil_net/weights/yolov4_cspdarknet_tiny_fp16.etlt_b2_gpu0_fp32.engine' |
|
|
|
|
threshold: 0.3 |
|
|
|
|
|
|
|
|
|
#模型阈值通用设定 |
|
|
|
|
rule_threshold: |
|
|
|
|
#模型阈值通用设定 |
|
|
|
|
rule_threshold: |
|
|
|
|
object_occurence_interval_second: 3 |
|
|
|
|
object_disappear_interval_second: 10 |
|
|
|
|
on_car_parking_interval_second: 1800 |
|
|
|
@ -1270,7 +1281,7 @@ ${newstr}class-id=0
|
|
|
|
|
threshold_secondary_model: 0.5
|
|
|
|
|
secondary_model_window: 50 |
|
|
|
|
secondary_model_path: '/opt/app/xgboost' |
|
|
|
|
`;
|
|
|
|
|
`;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sessionStorage.setItem('config1', config1); |
|
|
|
|