You've already forked DataMate
feat(annotation): 优化标注模板生成和配置验证
- 添加文本对象类型集合用于模板类型判断 - 将XML生成部分拆分为对象和控件两个独立部分 - 为文本类模板添加响应式布局支持长文本标注 - 修复配置验证器中对象和控件查找逻辑 - 优化标签控件在长文本场景下的显示位置
This commit is contained in:
@@ -35,13 +35,13 @@ class LabelStudioConfigValidator:
|
||||
|
||||
# 检查是否有对象定义
|
||||
object_types = config.get_object_types()
|
||||
objects = [child for child in root if child.tag in object_types]
|
||||
objects = [elem for elem in root.iter() if elem is not root and elem.tag in object_types]
|
||||
if not objects:
|
||||
return False, "No data objects (Image, Text, etc.) found"
|
||||
|
||||
# 检查是否有控件定义
|
||||
control_types = config.get_control_types()
|
||||
controls = [child for child in root if child.tag in control_types]
|
||||
controls = [elem for elem in root.iter() if elem is not root and elem.tag in control_types]
|
||||
if not controls:
|
||||
return False, "No annotation controls found"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user