|
@@ -86,7 +86,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="tsx" name="DataAugmentation">
|
|
|
-import { ref, reactive, onMounted, computed } from 'vue'
|
|
|
+import { ref, reactive, onMounted, computed, onUnmounted, onBeforeMount } from 'vue'
|
|
|
import { useHandleData } from '@/hooks/useHandleData'
|
|
|
import { useDownload } from '@/hooks/useDownload'
|
|
|
import { ElMessageBox, ElMessage } from 'element-plus'
|
|
@@ -107,9 +107,10 @@ import {
|
|
|
stopDataAugmentationApi,
|
|
|
getCompareImageApi,
|
|
|
getCompareImageCountApi,
|
|
|
- getDialogApi
|
|
|
+ getDialogApi,
|
|
|
+ getTaskDictData
|
|
|
} from '@/api/modules/demo/dataAugmentation'
|
|
|
-import { listDataApi } from '@/api/modules/system/dictData'
|
|
|
+// import { } from '@/api/modules/system/dictData'
|
|
|
import { S } from 'vite/dist/node/types.d-aGj9QkWt'
|
|
|
import { servicesVersion } from 'typescript'
|
|
|
const dialogVisible = ref(false)
|
|
@@ -151,52 +152,38 @@ const openLogDialog = async (id: string | number) => {
|
|
|
logDialogVisible.value = true
|
|
|
}
|
|
|
const getTaskType = async () => {
|
|
|
- const res: any = await listDataApi({
|
|
|
- dictName: '',
|
|
|
- dictType: 'biz_data_augmentation',
|
|
|
- dictLabel: '任务类型',
|
|
|
- pageNum: 0,
|
|
|
- pageSize: 1000
|
|
|
- })
|
|
|
- if (res.data.list.length != 0) {
|
|
|
- taskType.value = res.data.list.map(item => ({
|
|
|
- label: item.dictValue,
|
|
|
- value: item.dictValue
|
|
|
+ const res: any = await getTaskDictData()
|
|
|
+ if (res.data.length != 0) {
|
|
|
+ taskType.value = res.data.map(item => ({
|
|
|
+ label: item.taskType,
|
|
|
+ value: item.taskType
|
|
|
}))
|
|
|
- res.data.list.forEach(item => {
|
|
|
+ res.data.forEach(item => {
|
|
|
taskTypeEnums.push({
|
|
|
- label: item.dictValue,
|
|
|
- value: item.dictValue,
|
|
|
+ label: item.taskType,
|
|
|
+ value: item.taskType,
|
|
|
disabled: false,
|
|
|
tagType: 'default'
|
|
|
})
|
|
|
+ let obj = {}
|
|
|
+ obj[item.taskType] = item.hyperparameterConfiguration
|
|
|
+ hyperparameterConfiguration.push(obj)
|
|
|
})
|
|
|
- console.log(taskTypeEnums)
|
|
|
- for (let i = 0; i < taskType.value.length; i++) {
|
|
|
- let dictValue = taskType.value[i].value
|
|
|
- const res: any = await listDataApi({
|
|
|
- dictName: '',
|
|
|
- dictType: 'biz_data_augmentation',
|
|
|
- dictLabel: dictValue + '超参配置',
|
|
|
- pageNum: 0,
|
|
|
- pageSize: 1000
|
|
|
- })
|
|
|
- if (res.data.list.length != 0) {
|
|
|
- //console.log(res.data.list[0].dictValue)
|
|
|
- let obj = {}
|
|
|
- obj[dictValue] = res.data.list[0].dictValue
|
|
|
- hyperparameterConfiguration.push(obj)
|
|
|
- } else {
|
|
|
- ElMessage.error('${dictValue}未在数据字典中设置超参!')
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- ElMessage.error('task_type为空,请在数据字典中设置具体的任务类型!')
|
|
|
}
|
|
|
-
|
|
|
- // console.log(taskType.value)
|
|
|
}
|
|
|
+let intervalId: NodeJS.Timeout | null = null
|
|
|
+
|
|
|
+onUnmounted(() => {
|
|
|
+ // 组件卸载时清除定时器
|
|
|
+ if (intervalId !== null) {
|
|
|
+ clearInterval(intervalId)
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
+ intervalId = setInterval(async () => {
|
|
|
+ proTable.value?.getTableList()
|
|
|
+ }, 5000)
|
|
|
getTaskType()
|
|
|
})
|
|
|
|
|
@@ -263,7 +250,12 @@ const compareDataAugmentation = async (params: any) => {
|
|
|
}
|
|
|
}
|
|
|
// console.log(cacheImages.value[0])
|
|
|
- dialogTitle.value = '预览: 第1个样本 共' + fileCount.value + '个样本'
|
|
|
+ if (fileCount.value > 0) {
|
|
|
+ dialogTitle.value = '预览: 第1个样本 共' + fileCount.value + '个样本'
|
|
|
+ } else {
|
|
|
+ dialogTitle.value = '无结果预览'
|
|
|
+ }
|
|
|
+
|
|
|
// next_picture()
|
|
|
}
|
|
|
const next_picture = async () => {
|
|
@@ -310,15 +302,6 @@ const downloadFile = async task => {
|
|
|
|
|
|
// 批量添加视频去抖动
|
|
|
const dialogRef = ref<InstanceType<typeof ImportExcel> | null>(null)
|
|
|
-const batchAdd = () => {
|
|
|
- const params = {
|
|
|
- title: '视频去抖动',
|
|
|
- tempApi: importTemplateApi,
|
|
|
- importApi: importDataAugmentationDataApi,
|
|
|
- getTableList: proTable.value?.getTableList
|
|
|
- }
|
|
|
- dialogRef.value?.acceptParams(params)
|
|
|
-}
|
|
|
|
|
|
const formDialogRef = ref<InstanceType<typeof DataAugmentationFormDialog> | null>(null)
|
|
|
// 打开弹框的功能
|
|
@@ -519,7 +502,7 @@ const setItemsOptions = () => {
|
|
|
itemsOptions.splice(4) // 如果里面有新增参数,删除,重新添加
|
|
|
}
|
|
|
}
|
|
|
-const hyperparameter = ref({})
|
|
|
+
|
|
|
const addParams = params => {
|
|
|
setItemsOptions()
|
|
|
if (params == 'null') {
|
|
@@ -528,10 +511,9 @@ const addParams = params => {
|
|
|
let validJsonString = params.replace(/'/g, '"')
|
|
|
try {
|
|
|
const obj: { [key: string]: number } = JSON.parse(validJsonString)
|
|
|
- // hyperparameter.value = { ...obj };
|
|
|
Object.keys(obj).forEach(key => {
|
|
|
model.value[key] = obj[key]
|
|
|
- // hyperparameter[key] = obj[key]
|
|
|
+
|
|
|
itemsOptions.push({
|
|
|
label: key,
|
|
|
prop: key,
|
|
@@ -540,12 +522,6 @@ const addParams = params => {
|
|
|
type: 'input',
|
|
|
clearable: true,
|
|
|
placeholder: '默认值为' + obj[key]
|
|
|
- // value: hyperparameter.value[key],
|
|
|
- // onChange: (value) => {
|
|
|
- // hyperparameter.value[key] = value
|
|
|
- // console.log(hyperparameter)
|
|
|
- // // model.value[key] = value
|
|
|
- // }
|
|
|
}
|
|
|
})
|
|
|
})
|