update code

main
lijun 2024-09-28 23:10:12 +08:00
parent 7987fb3de4
commit 2899ecebee
1 changed files with 326 additions and 163 deletions

View File

@ -3,21 +3,19 @@
<div style="background-color: #fff;padding:20px;margin-bottom: 60px;" id="print_simulation_report_desc">
<div class="report-name">{{ info.report.report_name }}</div>
<div class="report-info">
<table>
<tr>
<td style="width:100px;" align="right"> 报告创建人:</td>
<td>{{ info.report.user_name }}</td>
</tr>
<tr>
<td align="right"> 报告生成时间:</td>
<td>{{ info.report.create_time }}</td>
</tr>
<tr>
<td align="right"> 报告说明:</td>
<td>{{ info.report.report_desc }}</td>
</tr>
</table>
<el-row>
<el-col :span="12">
报告生成时间:{{ info.report.create_time }}
</el-col>
<el-col :span="12" style="text-align: right;" v-if="info.report.user_name">
报告创建人:{{ info.report.user_name }}
</el-col>
</el-row>
<div v-if="info.report.report_desc">
{{ info.report.report_desc }}
</div>
</div>
<div class="div-line"></div>
<div class="sub-title">推理任务列表</div>
<el-table :data="info.taskList" stripe style="margin-top:10px;">
@ -30,6 +28,7 @@
<el-table-column label="设备名称" align="left" prop="device_name" />
<el-table-column label="设备处理器" align="left" prop="hardware_chip" />
</el-table>
<template v-if="info.reportType == 'other'">
<div class="task-lists" v-if="info.tasks && info.tasks.length > 0">
<div v-for="(it, idx) in info.tasks" :key="idx">
<div class="sub-title">我的任务{{ idx + 1 }}的评估报告</div>
@ -90,6 +89,7 @@
</div>
<template v-if="info.robustness && info.robustness.length > 0">
<div class="div-line"></div>
<div class="sub-title">鲁棒性评估报告</div>
<el-table :data="info.robustness" stripe style="margin-top:10px;">
<el-table-column type="index" width="80" label="序号" />
@ -111,20 +111,22 @@
</charts>
</div>
</template>
<template v-if="info.horizontal_comparison && info.horizontal_comparison.length>0">
<template v-if="info.horizontal_comparison && info.horizontal_comparison.length > 0">
<div class="div-line"></div>
<div class="sub-title">硬件横向对比评估报告</div>
<el-table :data="info.horizontal_comparison" stripe style="margin-top:10px;">
<el-table-column type="index" width="80" label="序号" />
<el-table-column label="设备名称" align="left" prop="model_name" />
<el-table-column label="设备处理器" align="left" prop="database_name" />
<el-table-column label="设备名称" align="left" prop="device_name" />
<el-table-column label="设备处理器" align="left" prop="device_cpu" />
<el-table-column label="Micro F1" align="left" prop="micro_f1" />
<el-table-column label="Macro F1" align="left" prop="macro_f1" />
<el-table-column label="加权F1-Score" align="left" prop="weight_f1" />
<el-table-column label="mAP" align="left" prop="map" />
<el-table-column label="mAP" align="left" prop="mAP" />
<el-table-column label="平均推理时间" align="left" prop="inference_time" />
<el-table-column label="系统延迟时间" align="left" prop="system_delay" />
<el-table-column label="mAP变化率" align="left">
<template #default="scope">
{{ scope.$index == 0 ? '----' : info.robustnessMapDecrease + '%' }}
{{ scope.row.map_ratio + "%" }}
</template>
</el-table-column>
</el-table>
@ -133,6 +135,73 @@
</charts>
</div>
</template>
</template>
<template v-else>
<div v-for="(it, idx) in info.tasks" :key="idx">
<div class="div-line"></div>
<div class="sub-title">{{ it.task_name }}的评估报告</div>
<el-table :data="[it]" stripe style="margin-top:10px;">
<el-table-column label="IDSW" align="left" prop="idsw" />
<el-table-column label="MT跟踪轨迹" align="left" prop="mt" />
<el-table-column label="ML丢失轨迹" align="left" prop="ml" />
<el-table-column label="FM打断次数" align="left" prop="fm" />
<el-table-column label="MOTA" align="left" prop="mota" />
<el-table-column label="平均推理时间" align="left" prop="inference_time" />
<el-table-column label="系统延迟时间" align="left" prop="system_delay" />
</el-table>
</div>
<template v-if="info.robustness && info.robustness.length > 0">
<div class="div-line"></div>
<div class="sub-title">鲁棒性评估报告</div>
<el-table :data="info.robustness" stripe style="margin-top:10px;">
<el-table-column type="index" width="80" label="序号" />
<el-table-column label="模型名称" align="left" prop="model_name" />
<el-table-column label="数据集名称" align="left" prop="database_name" />
<el-table-column label="IDSW" align="left" prop="idsw" />
<el-table-column label="MT跟踪轨迹" align="left" prop="mt" />
<el-table-column label="ML丢失轨迹" align="left" prop="ml" />
<el-table-column label="FM打断次数" align="left" prop="fm" />
<el-table-column label="MOTA" align="left" prop="mota" />
<el-table-column label="mAP变化率" align="left">
<template #default="scope">
{{ scope.$index == 0 ? '----' : info.robustnessMapDecrease + '%' }}
</template>
</el-table-column>
</el-table>
<div style="margin-top:20px;">
<charts id="reportChart3-robustness" width="100%" height="400px" :render="renderChar3">
</charts>
</div>
</template>
<template v-if="info.horizontal_comparison && info.horizontal_comparison.length > 0">
<div class="div-line"></div>
<div class="sub-title">硬件横向对比评估报告</div>
<el-table :data="info.horizontal_comparison" stripe style="margin-top:10px;">
<el-table-column type="index" width="80" label="序号" />
<el-table-column label="设备名称" align="left" prop="device_name" />
<el-table-column label="设备处理器" align="left" prop="device_cpu" />
<el-table-column label="IDSW" align="left" prop="idsw" />
<el-table-column label="MT跟踪轨迹" align="left" prop="mt" />
<el-table-column label="ML丢失轨迹" align="left" prop="ml" />
<el-table-column label="FM打断次数" align="left" prop="fm" />
<el-table-column label="MOTA" align="left" prop="mota" />
<el-table-column label="平均推理时间" align="left" prop="inference_time" />
<el-table-column label="系统延迟时间" align="left" prop="system_delay" />
<el-table-column label="mAP变化率" align="left">
<template #default="scope">
{{ scope.row.mota_ratio + "%" }}
</template>
</el-table-column>
</el-table>
<div style="margin-top:20px;">
<charts id="reportChart3-comparison" width="100%" height="400px" :render="renderChar4">
</charts>
</div>
</template>
</template>
</div>
<el-card class="card-footer">
@ -160,7 +229,7 @@ const info = reactive({
reportType: '',
robustness: [],
robustnessMapDecrease: '',
horizontal_comparison:[],
horizontal_comparison: [],
isPrint: false,
elPrint: 0,
})
@ -227,45 +296,83 @@ const doDelete = () => {
});
}
//
function renderChar4(){
function renderChar4() {
let datas = info.horizontal_comparison;
let maxTime = 0;
let maxTime1 = 0;
let maxTime2 = 0;
let maxIdsw=0;
let maxFm=0;
let seriesData = [];
datas.forEach(d => {
if (d.inference_time > maxTime) {
maxTime = d.inference_time;
datas.forEach((d, idx) => {
if (d.inference_time > maxTime1) {
maxTime1 = d.inference_time;
}
if (d.system_delay > maxTime2) {
maxTime2 = d.system_delay;
}
if (d.idsw > maxIdsw) {
maxIdsw = d.idsw;
}
if (d.fm > maxFm) {
maxFm = d.fm;
}
if (info.reportType != 'tracking') {
seriesData.push({
name: d.database_name,
value: [d.micro_f1, d.macro_f1, d.weight_f1, d.map, d.inference_time]
name: idx + 1 + "-" + d.device_name,
value: [d.micro_f1, d.macro_f1, d.weight_f1, d.mAP, d.inference_time, d.system_delay]
})
}else{
seriesData.push({
name: idx + 1 + "-" + d.device_name,
value: [d.idsw, d.mt, d.ml, d.fm,d.mota, d.inference_time, d.system_delay]
})
}
});
let indicators = [
{ text: 'Micro F1', max: 1 },
{ text: 'Macro F1', max: 1 },
{ text: '加权F1-Score', max: 1 },
{ text: 'mAP', max: 1 },
{ text: '平均推理时间', max: maxTime1 },
{ text: '系统延迟时间', max: maxTime2 }
];
if (info.reportType == 'tracking') {
indicators = [
{ text: 'IDSW', max: maxIdsw },
{ text: 'MT跟踪轨迹', max: 1 },
{ text: 'ML丢失轨迹', max: 1 },
{ text: 'FM打断次数', max: maxFm },
{ text: 'MOTA', max: 1 },
{ text: '平均推理时间', max: maxTime1 },
{ text: '系统延迟时间', max: maxTime2 }
];
}
let opt = {
title: {
text: '硬件横向对比评估图'
},
legend: {
x: 'center',
data: datas.map(d => d.database_name)
x: 'left',
top: 40,
orient: 'vertical',
data: datas.map((d, idx) => idx + 1 + "-" + d.device_name)
},
tooltip: {
trigger: 'axis'
},
calculable: true,
polar: [
{
indicator: [
{ text: 'Micro F1', max: 1 },
{ text: 'Macro F1', max: 1 },
{ text: '加权F1-Score', max: 1 },
{ text: 'mAP', max: 1 },
{ text: '平均推理时间', max: maxTime }
],
radar: {
indicator: indicators,
radius: 130
}
],
},
series: [{
type: 'radar',
tooltip: {
trigger: 'item'
},
label: {
show: true,
},
itemStyle: {
normal: {
areaStyle: {
@ -283,41 +390,87 @@ function renderChar3() {
let datas = info.robustness;
let maxTime = 0;
let seriesData = [];
datas.forEach(d => {
let maxIdsw = 0;
let maxFm = 0;
datas.forEach((d, idx) => {
if (d.inference_time > maxTime) {
maxTime = d.inference_time;
}
if (d.idsw > maxIdsw) {
maxIdsw = d.idsw;
}
if (d.fm > maxFm) {
maxFm = d.fm;
}
});
datas.forEach((d, idx) => {
if (info.reportType == "tracking") {
seriesData.push({
name: d.database_name,
name: idx + 1 + '-' + d.database_name,
value: [d.idsw, d.mt, d.ml, d.fm, d.mota]
})
} else {
seriesData.push({
name: idx + 1 + '-' + d.database_name,
value: [d.micro_f1, d.macro_f1, d.weight_f1, d.map, d.inference_time]
})
}
});
let opt = {
title: {
text: '鲁棒性评估图'
},
legend: {
x: 'center',
data: datas.map(d => d.database_name)
},
tooltip: {
trigger: 'axis'
},
calculable: true,
polar: [
{
indicator: [
let indicators = [
{ text: 'Micro F1', max: 1 },
{ text: 'Macro F1', max: 1 },
{ text: '加权F1-Score', max: 1 },
{ text: 'mAP', max: 1 },
{ text: '平均推理时间', max: maxTime }
],
radius: 130
];
if (info.reportType == "tracking") {
indicators = [
{ text: 'IDSW', max: maxIdsw },
{ text: 'MT跟踪轨迹', max: 1 },
{ text: 'ML丢失轨迹', max: 1 },
{ text: 'FM打断次数', max: maxFm },
{ text: 'MOTA', max: 1 }
];
}
],
let legendDatas = datas.map((d, idx) => idx + 1 + '-' + d.database_name);
if (info.reportType == "tracking") {
legendDatas = datas.map((d, idx) => idx + 1 + '-' + d.database_name);
}
let toolTipFun = (p) => {
let val = p.value;
if (info.reportType == "tracking") {
return `<b>${p.name}<b/><br/>IDSW:${maxIdsw - val[0]}<br>MT跟踪轨迹:${val[1]}<br/>ML丢失轨迹:${val[2]}<br/>FM打断次数:${maxFm - val[3]}<br/>MOTA:${val[4]}`
} else {
return `${p.name}<br/>`
}
}
let opt = {
title: {
text: '鲁棒性评估图'
},
legend: {
x: 'left',
top: 40,
orient: 'vertical',
data: legendDatas
},
tooltip: {
trigger: 'axis'
},
calculable: true,
radar: {
indicator: indicators,
radius: 130
},
series: [{
type: 'radar',
tooltip: {
trigger: 'item'
},
label: {
show: true,
},
itemStyle: {
normal: {
areaStyle: {
@ -399,18 +552,28 @@ function loadData() {
system_delay: it.system_delay, task_id: it.task_id, weight_f1: it.weight_f1
}];
it.chartsInfo = initTaskChart(it);
if (it.targets && it.targets.length > 0) {
info.reportType = "tracking";
} else {
info.reportType = "other"
}
return it;
});
let obj = info.report?.report_data?.robustness?.tasks || null
info.robustness = (obj ? obj : []);
info.robustnessMapDecrease = info.report?.report_data?.robustness?.map_decrease;
info.horizontal_comparison=info.report?.report_data?.horizontal_comparison
info.horizontal_comparison = info.report?.report_data?.horizontal_comparison
if (info.report.report_data.Tasks) {
info.reportType = "tracking";
info.tasks = (info.report?.report_data?.Tasks || []).map(it => {
let tasks = info.taskList.filter(item => item.task_id == it.task_id);
let task = tasks.length > 0 ? tasks[0] : {};
it.task_name = task.task_name || ''
it.task = task;
return it;
});
obj = info.report?.report_data?.Robustness?.Tasks || null
info.robustness = (obj ? obj : []);
info.robustnessMapDecrease = info.report?.report_data?.Robustness?.mota_decrease;
info.horizontal_comparison = info.report?.report_data?.HorizontalComparison
} else {
info.reportType = "other"
}
});
}
onMounted(loadData);