You've already forked DataMate
feat(annotation): 添加标注任务自定义配置功能
- 新增 LabelStudioEmbed 组件用于嵌入式标注界面预览 - 在创建标注任务对话框中添加 XML 配置编辑器 - 支持从现有模板加载配置并进行自定义修改 - 实现标注界面实时预览功能 - 后端支持直接传递 label_config 覆盖模板配置 - 更新 CreateAnnotationTaskRequest 模型添加 labelConfig 字段
This commit is contained in:
@@ -83,6 +83,11 @@ async def create_mapping(
|
||||
label_config = template.label_config
|
||||
logger.debug(f"Template label config loaded for template: {template.name}")
|
||||
|
||||
# 如果直接提供了 label_config (自定义或修改后的),则覆盖模板配置
|
||||
if request.label_config:
|
||||
label_config = request.label_config
|
||||
logger.debug("Using custom label config from request")
|
||||
|
||||
# DataMate-only:不再创建/依赖 Label Studio Server 项目。
|
||||
# 为兼容既有 schema 字段(labeling_project_id 长度 8),生成一个 8 位数字 ID。
|
||||
labeling_project_id = str(uuid.uuid4().int % 10**8).zfill(8)
|
||||
|
||||
@@ -22,6 +22,7 @@ class DatasetMappingCreateRequest(BaseModel):
|
||||
name: Optional[str] = Field(None, alias="name", description="标注项目名称")
|
||||
description: Optional[str] = Field(None, alias="description", description="标注项目描述")
|
||||
template_id: Optional[str] = Field(None, alias="templateId", description="标注模板ID")
|
||||
label_config: Optional[str] = Field(None, alias="labelConfig", description="Label Studio XML配置")
|
||||
|
||||
class Config:
|
||||
# allow population by field name when constructing model programmatically
|
||||
|
||||
Reference in New Issue
Block a user