提交代码

main
姜玉琦 2024-10-17 15:24:32 +08:00
parent 7648480dcd
commit ac94965045
2 changed files with 23 additions and 12 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<div class="app-container add-report"> <div class="app-container add-report" v-loading="loading">
<div class="scroll div-content-scroll"> <div class="scroll div-content-scroll">
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px"> <el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
<el-card> <el-card>
@ -9,8 +9,8 @@
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="数据集比对报告" prop="reportName"> <el-form-item label="报告名称" prop="reportName">
<el-input v-model="form.reportName" placeholder="请输入数据集比对报告" /> <el-input v-model="form.reportName" placeholder="请输入报告名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="16">
@ -106,7 +106,7 @@
</el-table-column> </el-table-column>
<template #empty> <template #empty>
<el-button type="primary" @click="choiceRobustTask"></el-button> <el-button type="primary" @click="choiceRobustTask"></el-button>
<el-button type="primary" @click="choiceCompTask"></el-button> <el-button type="primary" @click="choiceCompTask"></el-button>
</template> </template>
</el-table> </el-table>
@ -136,6 +136,8 @@ const info = reactive({
}, },
choiceType: '', choiceType: '',
}) })
const loading=ref(false);
const formRef=ref(); const formRef=ref();
const form = ref({}); // const form = ref({}); //
const taskDlg = ref() const taskDlg = ref()
@ -170,6 +172,7 @@ function doSave() {
} }
// //
function doMakeReport(){ function doMakeReport(){
loading.value = true;
let postData={ let postData={
report_name:form.value.reportName, report_name:form.value.reportName,
report_desc:form.value.reportDesc, report_desc:form.value.reportDesc,
@ -183,6 +186,7 @@ function doMakeReport(){
}; };
} }
ReportApi.addReport(postData).then(d=>{ ReportApi.addReport(postData).then(d=>{
loading.value = false;
let reportId=d.data?.data?.report_id||''; let reportId=d.data?.data?.report_id||'';
if(reportId){ if(reportId){
router.push({ path: "/simulationEvaluation/reportDesc", query: { id:reportId} }); router.push({ path: "/simulationEvaluation/reportDesc", query: { id:reportId} });

View File

@ -31,7 +31,7 @@
<template v-if="info.reportType == 'other'"> <template v-if="info.reportType == 'other'">
<div class="task-lists" v-if="info.tasks && info.tasks.length > 0"> <div class="task-lists" v-if="info.tasks && info.tasks.length > 0">
<div v-for="(it, idx) in info.tasks" :key="idx"> <div v-for="(it, idx) in info.tasks" :key="idx">
<div class="sub-title">我的任务{{ idx + 1 }}的测试报告</div> <div class="sub-title">{{ info.report.report_name }}的测试报告</div>
<template v-if="info.reportType == 'other'"> <template v-if="info.reportType == 'other'">
<div v-if="info.thresholds" class="info-thresholds"> <div v-if="info.thresholds" class="info-thresholds">
<span>置信度阈值</span> <span>置信度阈值</span>
@ -90,7 +90,7 @@
<template v-if="info.robustness && info.robustness.length > 0"> <template v-if="info.robustness && info.robustness.length > 0">
<div class="div-line"></div> <div class="div-line"></div>
<div class="sub-title">鲁棒性测试报告</div> <div class="sub-title">推理结果比对报告</div>
<el-table :data="info.robustness" stripe style="margin-top:10px;"> <el-table :data="info.robustness" stripe style="margin-top:10px;">
<el-table-column type="index" width="80" label="序号" /> <el-table-column type="index" width="80" label="序号" />
<el-table-column label="模型名称" align="left" prop="model_name" /> <el-table-column label="模型名称" align="left" prop="model_name" />
@ -139,7 +139,7 @@
<template v-else> <template v-else>
<div v-for="(it, idx) in info.tasks" :key="idx"> <div v-for="(it, idx) in info.tasks" :key="idx">
<div class="div-line"></div> <div class="div-line"></div>
<div class="sub-title">{{ it.task_name }}的测试报告</div> <div class="sub-title">{{ info.report.report_name }}的测试报告</div>
<el-table :data="[it]" stripe style="margin-top:10px;"> <el-table :data="[it]" stripe style="margin-top:10px;">
<el-table-column label="IDSW" align="left" prop="idsw" /> <el-table-column label="IDSW" align="left" prop="idsw" />
<el-table-column label="MT跟踪轨迹" align="left" prop="mt" /> <el-table-column label="MT跟踪轨迹" align="left" prop="mt" />
@ -153,7 +153,7 @@
<template v-if="info.robustness && info.robustness.length > 0"> <template v-if="info.robustness && info.robustness.length > 0">
<div class="div-line"></div> <div class="div-line"></div>
<div class="sub-title">鲁棒性测试报告</div> <div class="sub-title">推理结果比对报告</div>
<el-table :data="info.robustness" stripe style="margin-top:10px;"> <el-table :data="info.robustness" stripe style="margin-top:10px;">
<el-table-column type="index" width="80" label="序号" /> <el-table-column type="index" width="80" label="序号" />
<el-table-column label="模型名称" align="left" prop="model_name" /> <el-table-column label="模型名称" align="left" prop="model_name" />
@ -300,6 +300,7 @@ function renderChar4() {
let datas = info.horizontal_comparison; let datas = info.horizontal_comparison;
let maxTime1 = 0; let maxTime1 = 0;
let maxTime2 = 0; let maxTime2 = 0;
let micro_f1 = 1;
let maxIdsw=0; let maxIdsw=0;
let maxFm=0; let maxFm=0;
let seriesData = []; let seriesData = [];
@ -310,6 +311,9 @@ function renderChar4() {
if (d.system_delay > maxTime2) { if (d.system_delay > maxTime2) {
maxTime2 = d.system_delay; maxTime2 = d.system_delay;
} }
if (d.micro_f1 > micro_f1) {
micro_f1 = d.micro_f1;
}
if (d.idsw > maxIdsw) { if (d.idsw > maxIdsw) {
maxIdsw = d.idsw; maxIdsw = d.idsw;
} }
@ -329,7 +333,7 @@ function renderChar4() {
} }
}); });
let indicators = [ let indicators = [
{ text: 'Micro F1', max: 1 }, { text: 'Micro F1', max: micro_f1 },
{ text: 'Macro F1', max: 1 }, { text: 'Macro F1', max: 1 },
{ text: '加权F1-Score', max: 1 }, { text: '加权F1-Score', max: 1 },
{ text: 'mAP', max: 1 }, { text: 'mAP', max: 1 },
@ -389,6 +393,7 @@ function renderChar4() {
function renderChar3() { function renderChar3() {
let datas = info.robustness; let datas = info.robustness;
let maxTime = 0; let maxTime = 0;
let micro_f1 = 1;
let seriesData = []; let seriesData = [];
let maxIdsw = 0; let maxIdsw = 0;
let maxFm = 0; let maxFm = 0;
@ -397,6 +402,9 @@ function renderChar3() {
if (d.inference_time > maxTime) { if (d.inference_time > maxTime) {
maxTime = d.inference_time; maxTime = d.inference_time;
} }
if (d.micro_f1 > micro_f1) {
micro_f1 = d.micro_f1;
}
if (d.idsw > maxIdsw) { if (d.idsw > maxIdsw) {
maxIdsw = d.idsw; maxIdsw = d.idsw;
} }
@ -418,7 +426,7 @@ function renderChar3() {
} }
}); });
let indicators = [ let indicators = [
{ text: 'Micro F1', max: 1 }, { text: 'Micro F1', max: micro_f1 },
{ text: 'Macro F1', max: 1 }, { text: 'Macro F1', max: 1 },
{ text: '加权F1-Score', max: 1 }, { text: '加权F1-Score', max: 1 },
{ text: 'mAP', max: 1 }, { text: 'mAP', max: 1 },
@ -447,7 +455,7 @@ function renderChar3() {
} }
let opt = { let opt = {
title: { title: {
text: '鲁棒性测试图' text: '推理结果比对图'
}, },
legend: { legend: {
x: 'left', x: 'left',
@ -546,7 +554,6 @@ function loadData() {
info.thresholds = info.report.report_parameters?.report_parameters?.thresholds || null info.thresholds = info.report.report_parameters?.report_parameters?.thresholds || null
info.extra_evaluation_type = info.report.report_parameters?.report_parameters?.extra_evaluation_type || ''; info.extra_evaluation_type = info.report.report_parameters?.report_parameters?.extra_evaluation_type || '';
info.tasks = (info.report.report_data?.tasks || info.report.report_data?.report_data?.tasks || []).map(it => { info.tasks = (info.report.report_data?.tasks || info.report.report_data?.report_data?.tasks || []).map(it => {
it.datas = [{ it.datas = [{
inference_time: it.inference_time, macro_f1: it.macro_f1, map: it.map, micro_f1: it.micro_f1, inference_time: it.inference_time, macro_f1: it.macro_f1, map: it.map, micro_f1: it.micro_f1,
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