|
@@ -4,8 +4,8 @@
|
|
<!-- 表格 header 按钮 -->
|
|
<!-- 表格 header 按钮 -->
|
|
<template #tableHeader="scope">
|
|
<template #tableHeader="scope">
|
|
<el-button type="primary" v-auth="['demo:DataAugmentation:add']" icon="CirclePlus" @click="openDialog(1, '任务新增')"> 新增 </el-button>
|
|
<el-button type="primary" v-auth="['demo:DataAugmentation:add']" icon="CirclePlus" @click="openDialog(1, '任务新增')"> 新增 </el-button>
|
|
- <!-- <el-button type="primary" v-auth="['demo:DataAugmentation:import']" icon="Upload" plain @click="batchAdd"> 导入</el-button>-->
|
|
|
|
- <!-- <el-button type="primary" v-auth="['demo:DataAugmentation:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>-->
|
|
|
|
|
|
+ <!-- <el-button type="primary" v-auth="['demo:DataAugmentation:import']" icon="Upload" plain @click="batchAdd"> 导入</el-button> -->
|
|
|
|
+ <el-button type="primary" v-auth="['demo:DataAugmentation:export']" icon="Download" plain @click="downloadFile"> 导出 </el-button>
|
|
<el-button
|
|
<el-button
|
|
type="danger"
|
|
type="danger"
|
|
v-auth="['demo:DataAugmentation:remove']"
|
|
v-auth="['demo:DataAugmentation:remove']"
|
|
@@ -34,12 +34,10 @@
|
|
</template>
|
|
</template>
|
|
</el-popconfirm>
|
|
</el-popconfirm>
|
|
<el-button type="primary" link icon="View" @click="compareDataAugmentation(scope.row)" v-if="scope.row.status == '2'"> 预览 </el-button>
|
|
<el-button type="primary" link icon="View" @click="compareDataAugmentation(scope.row)" v-if="scope.row.status == '2'"> 预览 </el-button>
|
|
- <el-button type="primary" link icon="View" v-auth="['demo:DataAugmentation:query']" @click="openDialog(3, '视频去抖动查看', scope.row)">
|
|
|
|
|
|
+ <el-button type="primary" link icon="View" v-auth="['demo:DataAugmentation:query']" @click="openDialog(3, '任务查看', scope.row)">
|
|
查看
|
|
查看
|
|
</el-button>
|
|
</el-button>
|
|
- <!-- <el-button type="primary" link icon="EditPen" v-auth="['demo:DataAugmentation:edit']" @click="openDialog(2, '视频去抖动编辑', scope.row)">
|
|
|
|
- 编辑
|
|
|
|
- </el-button> -->
|
|
|
|
|
|
+ <el-button type="primary" link icon="View" v-auth="['demo:DataAugmentation:query']" @click="openLogDialog(scope.row.id)"> 日志 </el-button>
|
|
<el-button type="primary" link icon="Delete" v-auth="['demo:DataAugmentation:remove']" @click="deleteDataAugmentation(scope.row)">
|
|
<el-button type="primary" link icon="Delete" v-auth="['demo:DataAugmentation:remove']" @click="deleteDataAugmentation(scope.row)">
|
|
删除
|
|
删除
|
|
</el-button>
|
|
</el-button>
|
|
@@ -48,26 +46,23 @@
|
|
<FormDialog ref="formDialogRef" />
|
|
<FormDialog ref="formDialogRef" />
|
|
<ImportExcel ref="dialogRef" />
|
|
<ImportExcel ref="dialogRef" />
|
|
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="80%">
|
|
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="80%">
|
|
- <div class="image-dialog" v-if="imageIdx >= 0">
|
|
|
|
- <el-image
|
|
|
|
- v-for="(image, index) in cacheImages[imageIdx].origin"
|
|
|
|
- :key="index"
|
|
|
|
- :src="'data:image/png;base64,' + image"
|
|
|
|
- style="width: 45%"
|
|
|
|
- ></el-image>
|
|
|
|
- <el-tag>结果:</el-tag>
|
|
|
|
- <el-image
|
|
|
|
- v-for="(image, index) in cacheImages[imageIdx].stable"
|
|
|
|
- :key="index"
|
|
|
|
- :src="'data:image/png;base64,' + image"
|
|
|
|
- style="width: 45%"
|
|
|
|
- ></el-image>
|
|
|
|
|
|
+ <div class="image-dialog" v-if="imageIdx >= 0 && cacheImages[imageIdx]">
|
|
|
|
+ <div style="width: 50%">
|
|
|
|
+ <el-image v-for="(image, index) in cacheImages[imageIdx].origin" :key="index" :src="'data:image/png;base64,' + image"></el-image>
|
|
|
|
+ <!-- <el-tag>结果:</el-tag> -->
|
|
|
|
+ </div>
|
|
|
|
+ <div style="width: 50%">
|
|
|
|
+ <el-image v-for="(image, index) in cacheImages[imageIdx].stable" :key="index" :src="'data:image/png;base64,' + image"></el-image>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="image-dialog-btn" v-if="imageFps == 0">
|
|
<div class="image-dialog-btn" v-if="imageFps == 0">
|
|
<el-button type="primary" @click="pre_picture" :disabled="imageIdx <= 0">上一个</el-button>
|
|
<el-button type="primary" @click="pre_picture" :disabled="imageIdx <= 0">上一个</el-button>
|
|
<el-button type="primary" @click="next_picture" :disabled="imageIdx >= fileCount - 1">下一个</el-button>
|
|
<el-button type="primary" @click="next_picture" :disabled="imageIdx >= fileCount - 1">下一个</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <el-dialog v-model="logDialogVisible" title="日志" width="80%">
|
|
|
|
+ <el-text class="mx-1">{{ logDialog }}</el-text>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -92,9 +87,11 @@ import {
|
|
startDataAugmentationApi,
|
|
startDataAugmentationApi,
|
|
stopDataAugmentationApi,
|
|
stopDataAugmentationApi,
|
|
getCompareImageApi,
|
|
getCompareImageApi,
|
|
- getCompareImageCountApi
|
|
|
|
|
|
+ getCompareImageCountApi,
|
|
|
|
+ getDialogApi
|
|
} from '@/api/modules/demo/dataAugmentation'
|
|
} from '@/api/modules/demo/dataAugmentation'
|
|
import { listDataApi } from '@/api/modules/system/dictData'
|
|
import { listDataApi } from '@/api/modules/system/dictData'
|
|
|
|
+import { S } from 'vite/dist/node/types.d-aGj9QkWt'
|
|
const dialogVisible = ref(false)
|
|
const dialogVisible = ref(false)
|
|
const taskId = ref('')
|
|
const taskId = ref('')
|
|
const imageIdx = ref(0)
|
|
const imageIdx = ref(0)
|
|
@@ -115,6 +112,13 @@ const taskTypeEnums: EnumProps[] = []
|
|
|
|
|
|
const hyperparameterConfiguration = []
|
|
const hyperparameterConfiguration = []
|
|
const hyperparameter = ref('')
|
|
const hyperparameter = ref('')
|
|
|
|
+const logDialogVisible = ref(false)
|
|
|
|
+const logDialog = ref('')
|
|
|
|
+const openLogDialog = async (id: string | number) => {
|
|
|
|
+ const res: any = await getDialogApi(id)
|
|
|
|
+ logDialog.value = res.data
|
|
|
|
+ logDialogVisible.value = true
|
|
|
|
+}
|
|
const getTaskType = async () => {
|
|
const getTaskType = async () => {
|
|
const res: any = await listDataApi({
|
|
const res: any = await listDataApi({
|
|
dictName: '',
|
|
dictName: '',
|
|
@@ -195,7 +199,7 @@ const loadImageData = async (taskId: string, imageIdx: number) => {
|
|
const compareDataAugmentation = async (params: any) => {
|
|
const compareDataAugmentation = async (params: any) => {
|
|
taskId.value = params.id
|
|
taskId.value = params.id
|
|
imageIdx.value = 0
|
|
imageIdx.value = 0
|
|
-
|
|
|
|
|
|
+ cacheImages.value = {}
|
|
const resCount: any = await getCompareImageCountApi(params.id)
|
|
const resCount: any = await getCompareImageCountApi(params.id)
|
|
if (resCount.code === 200) {
|
|
if (resCount.code === 200) {
|
|
inFileCount.value = resCount.data.inFileCount
|
|
inFileCount.value = resCount.data.inFileCount
|
|
@@ -214,12 +218,14 @@ const compareDataAugmentation = async (params: any) => {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
const res: any = await getCompareImageApi(taskId.value, idx - 1)
|
|
const res: any = await getCompareImageApi(taskId.value, idx - 1)
|
|
|
|
+ // console.log(res)
|
|
|
|
+
|
|
cacheImages.value[idx - 1] = {
|
|
cacheImages.value[idx - 1] = {
|
|
origin: res.origin,
|
|
origin: res.origin,
|
|
stable: res.stable
|
|
stable: res.stable
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- console.log(cacheImages.value[0])
|
|
|
|
|
|
+ // console.log(cacheImages.value[0])
|
|
dialogTitle.value = '预览: 第1个样本 共' + fileCount.value + '个样本'
|
|
dialogTitle.value = '预览: 第1个样本 共' + fileCount.value + '个样本'
|
|
// next_picture()
|
|
// next_picture()
|
|
}
|
|
}
|
|
@@ -260,8 +266,8 @@ const batchDelete = async (ids: string[]) => {
|
|
|
|
|
|
// 导出视频去抖动列表
|
|
// 导出视频去抖动列表
|
|
const downloadFile = async () => {
|
|
const downloadFile = async () => {
|
|
- ElMessageBox.confirm('确认导出视频去抖动数据?', '温馨提示', { type: 'warning' }).then(() =>
|
|
|
|
- useDownload(exportDataAugmentationApi, '视频去抖动列表', proTable.value?.searchParam)
|
|
|
|
|
|
+ ElMessageBox.confirm('确认导出任务数据?', '温馨提示', { type: 'warning' }).then(() =>
|
|
|
|
+ useDownload(exportDataAugmentationApi, '任务列表', proTable.value?.searchParam)
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -284,7 +290,9 @@ const openDialog = async (type: number, title: string, row?: any) => {
|
|
let res = { data: {} }
|
|
let res = { data: {} }
|
|
if (row?.id) {
|
|
if (row?.id) {
|
|
res = await getDataAugmentationApi(row?.id || null)
|
|
res = await getDataAugmentationApi(row?.id || null)
|
|
|
|
+ hyperparameter.value = res.data?.hyperparameterConfiguration
|
|
}
|
|
}
|
|
|
|
+
|
|
// 重置表单
|
|
// 重置表单
|
|
setItemsOptions()
|
|
setItemsOptions()
|
|
const params = {
|
|
const params = {
|
|
@@ -292,7 +300,7 @@ const openDialog = async (type: number, title: string, row?: any) => {
|
|
width: 580,
|
|
width: 580,
|
|
isEdit: type !== 3,
|
|
isEdit: type !== 3,
|
|
itemsOptions: itemsOptions,
|
|
itemsOptions: itemsOptions,
|
|
- model: type == 1 ? {} : res.data,
|
|
|
|
|
|
+ model: type == 1 ? model : res.data,
|
|
api: type == 1 ? addDataAugmentationApi : updateDataAugmentationApi,
|
|
api: type == 1 ? addDataAugmentationApi : updateDataAugmentationApi,
|
|
getTableList: proTable.value?.getTableList
|
|
getTableList: proTable.value?.getTableList
|
|
}
|
|
}
|
|
@@ -337,7 +345,7 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
{ prop: 'id', label: '主键ID', width: 180 },
|
|
{ prop: 'id', label: '主键ID', width: 180 },
|
|
{
|
|
{
|
|
prop: 'name',
|
|
prop: 'name',
|
|
- label: '视频名称',
|
|
|
|
|
|
+ label: '任务名称',
|
|
search: {
|
|
search: {
|
|
el: 'input'
|
|
el: 'input'
|
|
},
|
|
},
|
|
@@ -403,7 +411,7 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
|
|
|
{
|
|
{
|
|
prop: 'algorithmPath',
|
|
prop: 'algorithmPath',
|
|
- label: '算法路径',
|
|
|
|
|
|
+ label: '日志路径',
|
|
width: 120
|
|
width: 120
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -428,6 +436,7 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
])
|
|
])
|
|
// 表单配置项
|
|
// 表单配置项
|
|
let itemsOptions: ProForm.ItemsOptions[] = []
|
|
let itemsOptions: ProForm.ItemsOptions[] = []
|
|
|
|
+const model = ref({})
|
|
const setItemsOptions = () => {
|
|
const setItemsOptions = () => {
|
|
itemsOptions = [
|
|
itemsOptions = [
|
|
{
|
|
{
|
|
@@ -447,20 +456,15 @@ const setItemsOptions = () => {
|
|
placeholder: '请选择任务类型',
|
|
placeholder: '请选择任务类型',
|
|
enum: taskType,
|
|
enum: taskType,
|
|
onChange: (value: string) => {
|
|
onChange: (value: string) => {
|
|
- // itemsOptions.forEach(obj => {
|
|
|
|
- // if (obj.prop == "hyperparameterConfiguration") {
|
|
|
|
- // hyperparameterConfiguration.forEach(obj1 => {
|
|
|
|
- // if (value in obj1) {
|
|
|
|
- // obj.compOptions.value = obj1[value]
|
|
|
|
- // hyperparameter.value = obj1[value]
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
hyperparameterConfiguration.forEach(obj => {
|
|
hyperparameterConfiguration.forEach(obj => {
|
|
if (value in obj) {
|
|
if (value in obj) {
|
|
hyperparameter.value = obj[value]
|
|
hyperparameter.value = obj[value]
|
|
|
|
+ // console.log(obj)
|
|
|
|
+ model.value['hyperparameterConfiguration'] = obj[value]
|
|
|
|
+ // itemsOptions[3]['compOptions']['value'] = obj[value]
|
|
|
|
+ //itemsOptions[3].compOptions.onChange(obj[value])
|
|
|
|
+ // let change = itemsOptions[3]['compOptions']['onChange']
|
|
|
|
+ // change(obj[value])
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -469,7 +473,7 @@ const setItemsOptions = () => {
|
|
{
|
|
{
|
|
label: '图片集压缩包',
|
|
label: '图片集压缩包',
|
|
prop: 'inputOssId',
|
|
prop: 'inputOssId',
|
|
- rules: [{ required: true, message: '数据压缩包不能为空', trigger: 'blur' }],
|
|
|
|
|
|
+ rules: [{ required: true, message: '数据压缩包不能为空', trigger: 'change' }],
|
|
compOptions: {
|
|
compOptions: {
|
|
elTagName: 'file-upload',
|
|
elTagName: 'file-upload',
|
|
fileSize: 4096,
|
|
fileSize: 4096,
|
|
@@ -477,26 +481,19 @@ const setItemsOptions = () => {
|
|
placeholder: '请上传图片集压缩包'
|
|
placeholder: '请上传图片集压缩包'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // {
|
|
|
|
- // label: '算法路径',
|
|
|
|
- // prop: 'algorithmPath',
|
|
|
|
- // rules: [],
|
|
|
|
- // compOptions: {
|
|
|
|
- // type: 'input',
|
|
|
|
- // clearable: true,
|
|
|
|
- // placeholder: ''
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
{
|
|
{
|
|
label: '超参配置',
|
|
label: '超参配置',
|
|
prop: 'hyperparameterConfiguration',
|
|
prop: 'hyperparameterConfiguration',
|
|
- rules: [{ required: true, message: '超参配置不能为空', trigger: 'blur' }],
|
|
|
|
|
|
+ // rules: [{ required: true, message: '超参配置不能为空', trigger: 'blur' }],
|
|
|
|
+ rules: [{ required: false, trigger: 'blur' }],
|
|
compOptions: {
|
|
compOptions: {
|
|
type: 'input',
|
|
type: 'input',
|
|
clearable: true,
|
|
clearable: true,
|
|
// placeholder: hyperparameter
|
|
// placeholder: hyperparameter
|
|
- value: hyperparameter
|
|
|
|
- //value: hyperparameterConfiguration[itemsOptions.taskType]
|
|
|
|
|
|
+ value: hyperparameter,
|
|
|
|
+ onChange: (value: string) => {
|
|
|
|
+ hyperparameter.value = value
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -519,6 +516,7 @@ const setItemsOptions = () => {
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.image-dialog {
|
|
.image-dialog {
|
|
display: flex;
|
|
display: flex;
|
|
|
|
+ align-items: center;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
.el-image {
|
|
.el-image {
|
|
margin-right: 20px;
|
|
margin-right: 20px;
|