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 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-name">{{ info.report.report_name }}</div>
<div class="report-info"> <div class="report-info">
<table> <el-row>
<tr> <el-col :span="12">
<td style="width:100px;" align="right"> 报告创建人:</td> 报告生成时间:{{ info.report.create_time }}
<td>{{ info.report.user_name }}</td> </el-col>
</tr> <el-col :span="12" style="text-align: right;" v-if="info.report.user_name">
<tr> 报告创建人:{{ info.report.user_name }}
<td align="right"> 报告生成时间:</td> </el-col>
<td>{{ info.report.create_time }}</td> </el-row>
</tr> <div v-if="info.report.report_desc">
<tr> {{ info.report.report_desc }}
<td align="right"> 报告说明:</td> </div>
<td>{{ info.report.report_desc }}</td>
</tr>
</table>
</div> </div>
<div class="div-line"></div> <div class="div-line"></div>
<div class="sub-title">推理任务列表</div> <div class="sub-title">推理任务列表</div>
<el-table :data="info.taskList" stripe style="margin-top:10px;"> <el-table :data="info.taskList" stripe style="margin-top:10px;">
@ -30,108 +28,179 @@
<el-table-column label="设备名称" align="left" prop="device_name" /> <el-table-column label="设备名称" align="left" prop="device_name" />
<el-table-column label="设备处理器" align="left" prop="hardware_chip" /> <el-table-column label="设备处理器" align="left" prop="hardware_chip" />
</el-table> </el-table>
<div class="task-lists" v-if="info.tasks && info.tasks.length > 0"> <template v-if="info.reportType == 'other'">
<div v-for="(it, idx) in info.tasks" :key="idx"> <div class="task-lists" v-if="info.tasks && info.tasks.length > 0">
<div class="sub-title">我的任务{{ idx + 1 }}的评估报告</div> <div v-for="(it, idx) in info.tasks" :key="idx">
<template v-if="info.reportType == 'other'"> <div class="sub-title">我的任务{{ idx + 1 }}的评估报告</div>
<div v-if="info.thresholds" class="info-thresholds"> <template v-if="info.reportType == 'other'">
<span>置信度阈值</span> <div v-if="info.thresholds" class="info-thresholds">
<span>{{ info.thresholds.score_threshold }}</span> <span>置信度阈值</span>
<span style="margin-left:10px;">nms阈值:</span> <span>{{ info.thresholds.score_threshold }}</span>
<span>{{ info.thresholds.nms_threshold }}</span> <span style="margin-left:10px;">nms阈值:</span>
</div> <span>{{ info.thresholds.nms_threshold }}</span>
<el-table :data="it.classes" stripe style="margin-top:10px;">
<el-table-column label="类别名称" align="left" prop="class_name" />
<el-table-column label="Precision(精确度)" align="left" prop="precision" />
<el-table-column label="Recall(召回率)" align="left" prop="recall" />
<el-table-column label="F1-score" align="left" prop="f1_score" />
<el-table-column label="AP" align="left" prop="ap" />
</el-table>
<el-table :data="it.datas" stripe style="margin-top:20px;">
<el-table-column label="mAP" align="left" prop="map" />
<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-Scroe" align="left" prop="weight_f1" />
<el-table-column label="平均推理时间" align="left" prop="inference_time" />
<el-table-column label="系统延迟时间" align="left" prop="system_delay" />
</el-table>
<div class="print-page"></div>
<el-row class="report-chart1" style="margin-top:20px;" :key="info.elPrint"
:style="info.isPrint ? 'width:18cm;' : ''">
<el-col :span="info.isPrint || it.classes.length > 20 ? 24 : 24">
<charts :id="'reportChart2-' + idx" width="100%" :height="calcChartHeight(it)"
:render="opt => renderChart1(it, 'rp')"></charts>
</el-col>
</el-row>
</template>
<template v-else>
<el-table :data="it.targets" stripe style="margin-top:10px;">
<el-table-column label="目标序号" align="left" prop="index" />
<el-table-column label="IDSW" align="left" prop="idsw" />
<el-table-column label="TM(跟踪轨迹)" align="left" prop="mt" />
<el-table-column label="ML(丢失轨迹)" align="left" prop="ml" />
<el-table-column label="FM(打断次数)" align="left" prop="fm" />
</el-table>
<div class="info-thresholds" style="margin-top: 10px;line-height: 24px;">
<div> <span>MOTA跟踪准确度</span>
<span>{{ it.mota }}</span>
</div> </div>
<div> <span>平均推理时间:</span>
<span>{{ it.inference_time }}ms</span>
</div>
<div><span>系统延迟时间:</span>
<span>{{ it.system_delay }}ms</span>
</div>
</div>
</template>
</div>
</div>
<template v-if="info.robustness && info.robustness.length > 0"> <el-table :data="it.classes" stripe style="margin-top:10px;">
<div class="sub-title">鲁棒性评估报告</div> <el-table-column label="类别名称" align="left" prop="class_name" />
<el-table :data="info.robustness" stripe style="margin-top:10px;"> <el-table-column label="Precision(精确度)" align="left" prop="precision" />
<el-table-column type="index" width="80" label="序号" /> <el-table-column label="Recall(召回率)" align="left" prop="recall" />
<el-table-column label="模型名称" align="left" prop="model_name" /> <el-table-column label="F1-score" align="left" prop="f1_score" />
<el-table-column label="数据集名称" align="left" prop="database_name" /> <el-table-column label="AP" align="left" prop="ap" />
<el-table-column label="Micro F1" align="left" prop="micro_f1" /> </el-table>
<el-table-column label="Macro F1" align="left" prop="macro_f1" />
<el-table-column label="加权F1-Score" align="left" prop="weight_f1" /> <el-table :data="it.datas" stripe style="margin-top:20px;">
<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="Micro F1" align="left" prop="micro_f1" />
<el-table-column label="mAP变化率" align="left"> <el-table-column label="Macro F1" align="left" prop="macro_f1" />
<template #default="scope"> <el-table-column label="加权F1-Scroe" align="left" prop="weight_f1" />
{{ scope.$index == 0 ? '----' : info.robustnessMapDecrease + '%' }} <el-table-column label="平均推理时间" align="left" prop="inference_time" />
<el-table-column label="系统延迟时间" align="left" prop="system_delay" />
</el-table>
<div class="print-page"></div>
<el-row class="report-chart1" style="margin-top:20px;" :key="info.elPrint"
:style="info.isPrint ? 'width:18cm;' : ''">
<el-col :span="info.isPrint || it.classes.length > 20 ? 24 : 24">
<charts :id="'reportChart2-' + idx" width="100%" :height="calcChartHeight(it)"
:render="opt => renderChart1(it, 'rp')"></charts>
</el-col>
</el-row>
</template> </template>
</el-table-column> <template v-else>
</el-table> <el-table :data="it.targets" stripe style="margin-top:10px;">
<div style="margin-top:20px;"> <el-table-column label="目标序号" align="left" prop="index" />
<charts id="reportChart3-robustness" width="100%" height="400px" :render="renderChar3"> <el-table-column label="IDSW" align="left" prop="idsw" />
</charts> <el-table-column label="TM(跟踪轨迹)" align="left" prop="mt" />
<el-table-column label="ML(丢失轨迹)" align="left" prop="ml" />
<el-table-column label="FM(打断次数)" align="left" prop="fm" />
</el-table>
<div class="info-thresholds" style="margin-top: 10px;line-height: 24px;">
<div> <span>MOTA跟踪准确度</span>
<span>{{ it.mota }}</span>
</div>
<div> <span>平均推理时间:</span>
<span>{{ it.inference_time }}ms</span>
</div>
<div><span>系统延迟时间:</span>
<span>{{ it.system_delay }}ms</span>
</div>
</div>
</template>
</div>
</div> </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="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="平均推理时间" align="left" prop="inference_time" />
<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="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="平均推理时间" 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.map_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> </template>
<template v-if="info.horizontal_comparison && info.horizontal_comparison.length>0"> <template v-else>
<div class="sub-title">硬件横向对比评估报告</div> <div v-for="(it, idx) in info.tasks" :key="idx">
<el-table :data="info.horizontal_comparison" stripe style="margin-top:10px;"> <div class="div-line"></div>
<el-table-column type="index" width="80" label="序号" /> <div class="sub-title">{{ it.task_name }}的评估报告</div>
<el-table-column label="设备名称" align="left" prop="model_name" /> <el-table :data="[it]" stripe style="margin-top:10px;">
<el-table-column label="设备处理器" align="left" prop="database_name" /> <el-table-column label="IDSW" align="left" prop="idsw" />
<el-table-column label="Micro F1" align="left" prop="micro_f1" /> <el-table-column label="MT跟踪轨迹" align="left" prop="mt" />
<el-table-column label="Macro F1" align="left" prop="macro_f1" /> <el-table-column label="ML丢失轨迹" align="left" prop="ml" />
<el-table-column label="加权F1-Score" align="left" prop="weight_f1" /> <el-table-column label="FM打断次数" align="left" prop="fm" />
<el-table-column label="mAP" align="left" prop="map" /> <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="inference_time" />
<el-table-column label="mAP变化率" align="left"> <el-table-column label="系统延迟时间" align="left" prop="system_delay" />
<template #default="scope"> </el-table>
{{ scope.$index == 0 ? '----' : info.robustnessMapDecrease + '%' }}
</template>
</el-table-column>
</el-table>
<div style="margin-top:20px;">
<charts id="reportChart3-comparison" width="100%" height="400px" :render="renderChar4">
</charts>
</div> </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> </template>
</div> </div>
@ -160,7 +229,7 @@ const info = reactive({
reportType: '', reportType: '',
robustness: [], robustness: [],
robustnessMapDecrease: '', robustnessMapDecrease: '',
horizontal_comparison:[], horizontal_comparison: [],
isPrint: false, isPrint: false,
elPrint: 0, elPrint: 0,
}) })
@ -227,45 +296,83 @@ const doDelete = () => {
}); });
} }
// //
function renderChar4(){ function renderChar4() {
let datas = info.horizontal_comparison; let datas = info.horizontal_comparison;
let maxTime = 0; let maxTime1 = 0;
let seriesData = []; let maxTime2 = 0;
datas.forEach(d => { let maxIdsw=0;
if (d.inference_time > maxTime) { let maxFm=0;
maxTime = d.inference_time; let seriesData = [];
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: 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]
})
} }
seriesData.push({
name: d.database_name,
value: [d.micro_f1, d.macro_f1, d.weight_f1, d.map, d.inference_time]
})
}); });
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 = { let opt = {
title: { title: {
text: '硬件横向对比评估图' text: '硬件横向对比评估图'
}, },
legend: { legend: {
x: 'center', x: 'left',
data: datas.map(d => d.database_name) top: 40,
orient: 'vertical',
data: datas.map((d, idx) => idx + 1 + "-" + d.device_name)
}, },
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
}, },
calculable: true, calculable: true,
polar: [ radar: {
{ indicator: indicators,
indicator: [ radius: 130
{ text: 'Micro F1', max: 1 }, },
{ text: 'Macro F1', max: 1 },
{ text: '加权F1-Score', max: 1 },
{ text: 'mAP', max: 1 },
{ text: '平均推理时间', max: maxTime }
],
radius: 130
}
],
series: [{ series: [{
type: 'radar', type: 'radar',
tooltip: {
trigger: 'item'
},
label: {
show: true,
},
itemStyle: { itemStyle: {
normal: { normal: {
areaStyle: { areaStyle: {
@ -283,41 +390,87 @@ function renderChar3() {
let datas = info.robustness; let datas = info.robustness;
let maxTime = 0; let maxTime = 0;
let seriesData = []; let seriesData = [];
datas.forEach(d => { let maxIdsw = 0;
let maxFm = 0;
datas.forEach((d, idx) => {
if (d.inference_time > maxTime) { if (d.inference_time > maxTime) {
maxTime = d.inference_time; maxTime = d.inference_time;
} }
seriesData.push({ if (d.idsw > maxIdsw) {
name: d.database_name, maxIdsw = d.idsw;
value: [d.micro_f1, d.macro_f1, d.weight_f1, d.map, d.inference_time] }
}) if (d.fm > maxFm) {
maxFm = d.fm;
}
}); });
datas.forEach((d, idx) => {
if (info.reportType == "tracking") {
seriesData.push({
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 indicators = [
{ text: 'Micro F1', max: 1 },
{ text: 'Macro F1', max: 1 },
{ text: '加权F1-Score', max: 1 },
{ text: 'mAP', max: 1 },
{ text: '平均推理时间', max: maxTime }
];
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 = { let opt = {
title: { title: {
text: '鲁棒性评估图' text: '鲁棒性评估图'
}, },
legend: { legend: {
x: 'center', x: 'left',
data: datas.map(d => d.database_name) top: 40,
orient: 'vertical',
data: legendDatas
}, },
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
}, },
calculable: true, calculable: true,
polar: [ radar: {
{ indicator: indicators,
indicator: [ radius: 130
{ text: 'Micro F1', max: 1 }, },
{ text: 'Macro F1', max: 1 },
{ text: '加权F1-Score', max: 1 },
{ text: 'mAP', max: 1 },
{ text: '平均推理时间', max: maxTime }
],
radius: 130
}
],
series: [{ series: [{
type: 'radar', type: 'radar',
tooltip: {
trigger: 'item'
},
label: {
show: true,
},
itemStyle: { itemStyle: {
normal: { normal: {
areaStyle: { areaStyle: {
@ -399,18 +552,28 @@ function loadData() {
system_delay: it.system_delay, task_id: it.task_id, weight_f1: it.weight_f1 system_delay: it.system_delay, task_id: it.task_id, weight_f1: it.weight_f1
}]; }];
it.chartsInfo = initTaskChart(it); it.chartsInfo = initTaskChart(it);
if (it.targets && it.targets.length > 0) {
info.reportType = "tracking";
} else {
info.reportType = "other"
}
return it; return it;
}); });
let obj = info.report?.report_data?.robustness?.tasks || null let obj = info.report?.report_data?.robustness?.tasks || null
info.robustness = (obj ? obj : []); info.robustness = (obj ? obj : []);
info.robustnessMapDecrease = info.report?.report_data?.robustness?.map_decrease; 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); onMounted(loadData);