|
|
@@ -149,17 +149,10 @@
|
|
|
.map((item) => item.id);
|
|
|
};
|
|
|
|
|
|
- const algoParams = computed(() => {
|
|
|
- const countList = getCriticalCounts(selectedAlgoDetail.value.extra);
|
|
|
- const index = selectedAlgoDetail.value.metaValues.findIndex((item) => item.id === props.id);
|
|
|
- if (index < 0) {
|
|
|
- return {} as AlgoParamMetaItem;
|
|
|
- } else {
|
|
|
- const param = selectedAlgoDetail.value.metaValues[index];
|
|
|
- param.criticalCount = countList && countList.length > index ? countList[index] : 0;
|
|
|
- return param;
|
|
|
- }
|
|
|
- });
|
|
|
+ const algoParams = ref<AlgoParamMetaItem>(
|
|
|
+ selectedAlgoDetail.value.metaValues?.find((item) => item.id === props.id) ||
|
|
|
+ ({} as AlgoParamMetaItem),
|
|
|
+ );
|
|
|
|
|
|
const paramItems = ref([
|
|
|
{ label: '', type: 'label', prop: 'label' },
|
|
|
@@ -172,28 +165,37 @@
|
|
|
() => algoParams.value.label,
|
|
|
(val) => {
|
|
|
if (!val) return;
|
|
|
- const meta = metaObjList.value.find((item) => item.label === val);
|
|
|
- algoParams.value.confidence = meta.confidence * 100;
|
|
|
- algoParams.value['min_width'] = meta['min_width'];
|
|
|
- algoParams.value['min_height'] = meta['min_height'];
|
|
|
|
|
|
- const nexts = meta.nextObjs;
|
|
|
- if (nexts) {
|
|
|
- for (let i = 0; i < nexts.length; i++) {
|
|
|
- const item = nexts[i];
|
|
|
- paramItems.value.push({
|
|
|
- label: item.label,
|
|
|
- type: 'confidence',
|
|
|
- prop: `${item.label}.confidence`,
|
|
|
- });
|
|
|
- algoParams.value[`${item.label}.confidence`] = item.confidence * 100;
|
|
|
- paramItems.value.push({
|
|
|
- label: item.label,
|
|
|
- type: 'minArea',
|
|
|
- prop: '',
|
|
|
- });
|
|
|
- algoParams.value[item.label + '.' + 'min_width'] = item['min_width'];
|
|
|
- algoParams.value[item.label + '.' + 'min_height'] = item['min_height'];
|
|
|
+ const index = selectedAlgoDetail.value.metaValues.findIndex((item) => item.label === val);
|
|
|
+ if (selectedAlgoDetail.value.metaValues[index]['min_width']) {
|
|
|
+ const countList = getCriticalCounts(selectedAlgoDetail.value.extra);
|
|
|
+ algoParams.value = selectedAlgoDetail.value.metaValues[index];
|
|
|
+ algoParams.value.criticalCount =
|
|
|
+ countList && countList.length > index ? countList[index] : 0;
|
|
|
+ } else {
|
|
|
+ const meta = metaObjList.value.find((item) => item.label === val);
|
|
|
+ algoParams.value.confidence = meta.confidence * 100;
|
|
|
+ algoParams.value['min_width'] = meta['min_width'];
|
|
|
+ algoParams.value['min_height'] = meta['min_height'];
|
|
|
+
|
|
|
+ const nexts = meta.nextObjs;
|
|
|
+ if (nexts) {
|
|
|
+ for (let i = 0; i < nexts.length; i++) {
|
|
|
+ const item = nexts[i];
|
|
|
+ paramItems.value.push({
|
|
|
+ label: item.label,
|
|
|
+ type: 'confidence',
|
|
|
+ prop: `${item.label}.confidence`,
|
|
|
+ });
|
|
|
+ algoParams.value[`${item.label}.confidence`] = item.confidence * 100;
|
|
|
+ paramItems.value.push({
|
|
|
+ label: item.label,
|
|
|
+ type: 'minArea',
|
|
|
+ prop: '',
|
|
|
+ });
|
|
|
+ algoParams.value[item.label + '.' + 'min_width'] = item['min_width'];
|
|
|
+ algoParams.value[item.label + '.' + 'min_height'] = item['min_height'];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
},
|