feat(annotation): 支持音频和视频数据类型的标注任务

- 添加了音频和视频数据类型常量定义
- 实现了音频和视频标注模板的内置配置
- 扩展前端组件以支持按数据类型过滤标注模板
- 重构后端编辑器服务以处理音频和视频任务构建
- 更新数据库初始化脚本包含音频和视频标注模板
- 添加音频和视频数据类型的预览URL映射逻辑
This commit is contained in:
2026-01-26 23:54:40 +08:00
parent 47295e8cdf
commit 977a930c97
5 changed files with 461 additions and 59 deletions

View File

@@ -95,10 +95,8 @@ DELETE FROM t_dm_annotation_templates WHERE built_in = 1;
-- =============================================
-- 1. 音频/语音处理 (Audio/Speech Processing)
-- [已注释] 以下模板暂未调试完成
-- 已启用默认模板
-- =============================================
/*
-- 1.1 自动语音识别(分段)
INSERT INTO t_dm_annotation_templates (
id, name, description, data_type, labeling_type,
@@ -318,7 +316,6 @@ INSERT INTO t_dm_annotation_templates (
1,
'1.0.0'
);
*/
-- =============================================
-- 2. 聊天评估 (Chat)
@@ -1276,10 +1273,8 @@ INSERT INTO t_dm_annotation_templates (
-- =============================================
-- 9. 视频处理 (Videos)
-- [已注释] 以下模板暂未调试完成
-- 已启用默认模板
-- =============================================
/*
-- 9.1 视频分类
INSERT INTO t_dm_annotation_templates (
id, name, description, data_type, labeling_type,
@@ -1298,7 +1293,7 @@ INSERT INTO t_dm_annotation_templates (
),
'<View>
<Video name="video" value="$video"/>
<Choices name="choice" toName="video">
<Choices name="choice" toName="video" showInline="true">
<Choice value="Sports"/>
<Choice value="News"/>
<Choice value="Entertainment"/>
@@ -1323,18 +1318,18 @@ INSERT INTO t_dm_annotation_templates (
'video-object-tracking',
JSON_OBJECT(
'labels', JSON_ARRAY(
JSON_OBJECT('fromName', 'label', 'toName', 'video', 'type', 'VideoRectangle', 'labels', JSON_ARRAY('Person', 'Car', 'Object'))
JSON_OBJECT('fromName', 'videoLabels', 'toName', 'video', 'type', 'Labels', 'labels', JSON_ARRAY('Man', 'Woman', 'Other'))
),
'objects', JSON_ARRAY(JSON_OBJECT('name', 'video', 'type', 'Video', 'value', '$video'))
),
'<View>
<Labels name="label" toName="video">
<Label value="Person" background="red"/>
<Label value="Car" background="blue"/>
<Label value="Object" background="green"/>
<Labels name="videoLabels" toName="video" allowEmpty="true">
<Label value="Man" background="blue"/>
<Label value="Woman" background="red"/>
<Label value="Other" background="green"/>
</Labels>
<VideoRectangle name="box" toName="video"/>
<Video name="video" value="$video"/>
<Video name="video" value="$video" framerate="25.0"/>
<VideoRectangle name="box" toName="video" />
</View>',
'horizontal',
'video',
@@ -1354,24 +1349,28 @@ INSERT INTO t_dm_annotation_templates (
'video-timeline-segmentation',
JSON_OBJECT(
'labels', JSON_ARRAY(
JSON_OBJECT('fromName', 'label', 'toName', 'video', 'type', 'Labels', 'labels', JSON_ARRAY('Intro', 'Content', 'Outro'))
JSON_OBJECT('fromName', 'tricks', 'toName', 'audio', 'type', 'Labels', 'labels', JSON_ARRAY('Intro', 'Content', 'Outro'))
),
'objects', JSON_ARRAY(JSON_OBJECT('name', 'video', 'type', 'Video', 'value', '$video'))
'objects', JSON_ARRAY(
JSON_OBJECT('name', 'video', 'type', 'Video', 'value', '$video_url'),
JSON_OBJECT('name', 'audio', 'type', 'Audio', 'value', '$video_url')
)
),
'<View>
<Labels name="label" toName="video">
<Label value="Intro" background="blue"/>
<Label value="Content" background="green"/>
<Label value="Outro" background="orange"/>
<Header value="视频时间线分割"/>
<Video name="video" value="$video_url" sync="audio"/>
<Labels name="tricks" toName="audio" choice="multiple">
<Label value="Intro" background="#358EF3"/>
<Label value="Content" background="#1BB500"/>
<Label value="Outro" background="#FFA91D"/>
</Labels>
<Video name="video" value="$video"/>
<Audio name="audio" value="$video_url" sync="video" speed="false"/>
</View>',
'horizontal',
'video',
1,
'1.0.0'
);
*/
-- =============================================
-- 10. 对话AI (Conversational AI)