upd
This commit is contained in:
@@ -101,6 +101,7 @@
|
||||
{{ (scope.row.nsfwScore * 100).toFixed(1) }}%
|
||||
</el-tag>
|
||||
<div class="nsfw-threshold">阈值: {{ (scope.row.nsfwThreshold * 100).toFixed(0) }}%</div>
|
||||
<div v-if="scope.row.nsfwDetections" class="nsfw-threshold">{{ formatNsfwDetections(scope.row.nsfwDetections) }}</div>
|
||||
</div>
|
||||
<span v-else class="muted">-</span>
|
||||
</template>
|
||||
@@ -316,6 +317,19 @@ export default {
|
||||
} catch (e) {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
formatNsfwDetections(detectionsJson) {
|
||||
if (!detectionsJson) return ''
|
||||
try {
|
||||
const detections = JSON.parse(detectionsJson)
|
||||
if (!Array.isArray(detections) || detections.length === 0) return ''
|
||||
return detections.map(d => {
|
||||
const className = d.class.replace(/_/g, ' ').toLowerCase()
|
||||
return `${className}: ${(d.score * 100).toFixed(0)}%`
|
||||
}).join(', ')
|
||||
} catch (e) {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user