feat(web):补充YOLOv8的打架斗殴模型Web和Vue
This commit is contained in:
@@ -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
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user