@@ -36,9 +36,16 @@ def validate(cls, value: Union[str]) -> Union[str]:
3636 return value
3737
3838
39+ class Attribute (BaseModel ):
40+ id : int
41+ group_id : int
42+ name : NotEmptyStr
43+
44+
3945class AttributeGroup (BaseModel ):
4046 name : StrictStr
4147 is_multiselect : Optional [bool ]
48+ attributes : List [Attribute ]
4249
4350
4451class ClassesJson (BaseModel ):
@@ -47,6 +54,83 @@ class ClassesJson(BaseModel):
4754 attribute_groups : List [AttributeGroup ]
4855
4956
57+ class Metadata (BaseModel ):
58+ width : int
59+ height : int
60+
61+
62+ class BaseInstance (BaseModel ):
63+ metadata : Metadata
64+ type : NotEmptyStr
65+ classId : int
66+ groupId : int
67+ attributes : List [Attribute ]
68+
69+
70+ class Point (BaseInstance ):
71+ x : float
72+ y : float
73+
74+
75+ class PolyLine (BaseInstance ):
76+ points : List [float ]
77+
78+
79+ class Polygon (BaseInstance ):
80+ points : List [float ]
81+
82+
83+ class BboxPoints (BaseModel ):
84+ x1 : float
85+ x2 : float
86+ y1 : float
87+ y2 : float
88+
89+
90+ class Bbox (BaseInstance ):
91+ points : BboxPoints
92+
93+
94+ class Ellipse (BaseInstance ):
95+ cx : float
96+ cy : float
97+ rx : float
98+ ry : float
99+
100+
101+ class TemplatePoint (BaseModel ):
102+ id : int
103+ x : float
104+ y : float
105+
106+
107+ class TemplateConnection (BaseModel ):
108+ id : int
109+ to : int
110+
111+
112+ class Template (BaseInstance ):
113+ points : List [TemplatePoint ]
114+ connections : List [TemplateConnection ]
115+ templateId : int
116+
117+
118+ class CuboidPoint (BaseModel ):
119+ f1 : Point
120+ f2 : Point
121+ r1 : Point
122+ r2 : Point
123+
124+
125+ class Cuboid (BaseInstance ):
126+ points : List [CuboidPoint ]
127+
128+
129+ class VectorAnnotation (BaseModel ):
130+ metadata : Metadata
131+ instances : Optional [List [Template , Cuboid , Point , PolyLine , Polygon , Bbox , Ellipse ]]
132+
133+
50134def validate_arguments (func ):
51135 @wraps (func )
52136 def wrapped (* args , ** kwargs ):
0 commit comments