feat(web):补充YOLOv8的打架斗殴模型Web和Vue

This commit is contained in:
2026-06-10 14:37:00 +08:00
parent 77bd437fdb
commit 30ea6eb0fb
2 changed files with 368 additions and 14 deletions

View File

@@ -10,6 +10,12 @@ const dockerApi = axios.create({
timeout: 120000
})
// 视频检测专用,超时更长
const videoApi = axios.create({
baseURL: '/api',
timeout: 300000
})
export const detectionApi = {
getModels() {
return api.get('/models')
@@ -39,5 +45,19 @@ export const detectionApi = {
'Content-Type': 'multipart/form-data'
}
})
},
// 本地 YOLO 视频检测(打架斗殴检测等)
detectLocalVideo(formData, modelId = 'fight_detection', confidence = 0.5, iou = 0.45) {
return videoApi.post('/detect/video', formData, {
headers: {
'Content-Type': 'multipart/form-data'
},
params: {
model_id: modelId,
confidence,
iou
}
})
}
}