Skip to content

Commit ad71f24

Browse files
committed
fix(frontend): relation pre-annotation schema
1 parent d1d912a commit ad71f24

File tree

2 files changed

+125
-0
lines changed

2 files changed

+125
-0
lines changed

apps/frontend/src/pages/tasks.[id].edit/partials/InputData/imagePreAnnotationJson.schema.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
{
4848
"$ref": "#/definitions/PolygonTool"
4949
},
50+
{
51+
"$ref": "#/definitions/RelationTool"
52+
},
5053
{
5154
"$ref": "#/definitions/CuboidTool"
5255
},
@@ -323,6 +326,55 @@
323326
},
324327
"required": ["toolName", "result"]
325328
},
329+
"RelationTool": {
330+
"type": "object",
331+
"properties": {
332+
"toolName": {
333+
"type": "string",
334+
"const": "relationTool"
335+
},
336+
"result": {
337+
"type": "array",
338+
"items": {
339+
"type": "object",
340+
"properties": {
341+
"id": {
342+
"type": "string",
343+
"description": "唯一标识"
344+
},
345+
"sourceId": {
346+
"type": "string",
347+
"description": "起始标注id"
348+
},
349+
"targetId": {
350+
"type": "string",
351+
"description": "目标标注id"
352+
},
353+
"visible": {
354+
"type": "boolean",
355+
"description": "是否可见",
356+
"default": true
357+
},
358+
"attributes": {
359+
"$ref": "#/definitions/Attribute"
360+
},
361+
"order": {
362+
"type": "integer",
363+
"description": "标注顺序",
364+
"minimum": 0
365+
},
366+
"label": {
367+
"type": "string",
368+
"description": "标注标签",
369+
"default": "none"
370+
}
371+
},
372+
"required": ["sourceId", "targetId", "id", "order", "label"]
373+
}
374+
}
375+
},
376+
"required": ["toolName", "result"]
377+
},
326378
"RectTool": {
327379
"type": "object",
328380
"properties": {

apps/frontend/src/pages/tasks.[id].edit/partials/InputData/imagePreAnnotationJsonl.schema.json

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
"$ref": "#/definitions/LabelItem"
3434
}
3535
},
36+
"relationTool": {
37+
"type": "array",
38+
"items": {
39+
"$ref": "#/definitions/LabelItem"
40+
}
41+
},
3642
"cuboidTool": {
3743
"type": "array",
3844
"items": {
@@ -161,6 +167,24 @@
161167
},
162168
"required": ["toolName", "result"]
163169
},
170+
"relationTool": {
171+
"type": "object",
172+
"properties": {
173+
"toolName": {
174+
"type": "string",
175+
"const": "relationTool",
176+
"default": "relationTool"
177+
},
178+
"result": {
179+
"description": "标注结果",
180+
"type": "array",
181+
"items": {
182+
"$ref": "#/definitions/RelationTool"
183+
}
184+
}
185+
},
186+
"required": ["toolName", "result"]
187+
},
164188
"textTool": {
165189
"type": "object",
166190
"properties": {
@@ -608,6 +632,55 @@
608632
},
609633
"required": ["direction", "front", "back", "x", "y", "width", "height", "id", "order", "label"]
610634
},
635+
"RelationTool": {
636+
"type": "object",
637+
"properties": {
638+
"toolName": {
639+
"type": "string",
640+
"const": "relationTool"
641+
},
642+
"result": {
643+
"type": "array",
644+
"items": {
645+
"type": "object",
646+
"properties": {
647+
"id": {
648+
"type": "string",
649+
"description": "唯一标识"
650+
},
651+
"sourceId": {
652+
"type": "string",
653+
"description": "起始标注id"
654+
},
655+
"targetId": {
656+
"type": "string",
657+
"description": "目标标注id"
658+
},
659+
"visible": {
660+
"type": "boolean",
661+
"description": "是否可见",
662+
"default": true
663+
},
664+
"attributes": {
665+
"$ref": "#/definitions/Attribute"
666+
},
667+
"order": {
668+
"type": "integer",
669+
"description": "标注顺序",
670+
"minimum": 0
671+
},
672+
"label": {
673+
"type": "string",
674+
"description": "标注标签",
675+
"default": "none"
676+
}
677+
},
678+
"required": ["sourceId", "targetId", "id", "order", "label"]
679+
}
680+
}
681+
},
682+
"required": ["toolName", "result"]
683+
},
611684
"TextTool": {
612685
"type": "array",
613686
"items": {

0 commit comments

Comments
 (0)