dsdl.types.special
BBox
Bases: BaseField
A DSDL Field to validate the given value and return a BBox object.
Examples:
>>> bbox_field = BBox()
>>> value = [0, 10, 100, 100] # [x, y, w, h]
>>> bbox_obj = bbox_field.validate(value)
>>> bbox_obj.__class__.__name__
"BBox"
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/fields/special.py
Coord
Bases: BaseField
A DSDL Field to validate and return a 2D coordinate object.
Examples:
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/fields/special.py
Coord3D
Bases: BaseField
A DSDL Field to validate and return a 3D coordinate object.
Examples:
>>> coord3d_field = Coord3D()
>>> value = [10, 10, 10]
>>> coord3d_field.validate(value)
[10.0, 10.0, 10.0]
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/fields/special.py
Date
Bases: BaseField
A DSDL Field to validate the given value and return a datetime object.
Examples:
>>> date_field = Date(fmt="%Y-%m-%d")
>>> value = "2020-06-06"
>>> date_obj = date_field.validate(value)
>>> date_obj.__class__.__name__
"datetime"
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fmt |
The datetime format of the given value. |
required |
Attributes:
Name | Type | Description |
---|---|---|
fmt(str) |
The datetime format of the given value. |
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/fields/special.py
ImageShape
Bases: BaseField
A DSDL Field to validate the given value and return an ImageShape object.
Examples:
>>> shape_field = ImageShape()
>>> value = [360, 540]
>>> shape_obj = shape_field.validate(value)
>>> shape_obj.__class__.__name__
"ImageShape"
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode |
The format in which the value to be validated is given. Only |
required |
Attributes:
Name | Type | Description |
---|---|---|
mode(str) |
The format in which the value to be validated is given. Only |
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/fields/special.py
InstanceID
Bases: UniqueID
A DSDL Field to validate the given value and return a UniqueID object to represent an instance id.
Examples:
>>> ins_field = InstanceID()
>>> value = "instance_100"
>>> ins_obj = ins_field.validate(value)
>>> ins_obj.__class__.__name__
"UniqueID"
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/fields/special.py
Interval
Bases: BaseField
A DSDL Field to validate and return an interval object.
Examples:
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/fields/special.py
Keypoint
Bases: BaseFieldWithDomain
A DSDL Field to validate the given value and return a Keypoints object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dom |
The class domain which the current keypoints object belongs to. |
required |
Attributes:
Name | Type | Description |
---|---|---|
dom(ClassDomain) |
The class domain which the current keypoints object belongs to. |
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/fields/special.py
Label
Bases: BaseFieldWithDomain
A DSDL Field to validate the given value and return a Label object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dom |
The class domain which the current keypoints object belongs to. |
required |
Attributes:
Name | Type | Description |
---|---|---|
dom(ClassDomain) |
The class domain which the current keypoints object belongs to. |
|
dom_dic(Dict[str, |
ClassDomain]
|
The class domain which the current keypoints object belongs to. The format is |
dom_lst(List[ClassDomain]) |
ClassDomain]
|
The class domain which the current keypoints object belongs to. The format is |
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/fields/special.py
Polygon
Bases: BaseField
A DSDL Field to validate the given value and return a polygon object.
Examples:
>>> polygon_field = Polygon()
>>> value = [[[0, 0], [0, 100], [100, 100], [100, 0]], [[0, 0], [0, 50], [50, 50], [50, 0]]]
>>> polygon_obj = polygon_field.validate(value)
>>> polygon_obj.__class__.__name__
"Polygon"
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/fields/special.py
RotatedBBox
Bases: BaseField
A DSDL Field to validate the given value and return a RBBox object.
Examples:
>>> rotatedbbox_field = RotatedBBox(measure="degree")
>>> value = [1, 10, 100, 100, 180]
>>> rotatedbbox_obj = rotatedbbox_field.validate(value)
>>> rotatedbbox_obj.__class__.__name__
"RBBox"
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode |
The format in which the value to be validated is given. Only |
required | |
measure |
The uint in which the angle value is given. Only |
required |
Attributes:
Name | Type | Description |
---|---|---|
mode |
The format in which the value to be validated is given. Only |
|
measure |
The uint in which the angle value is given. Only |
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/fields/special.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
|
Text
Bases: BaseField
A DSDL Field to validate the given value and return a Text object.
Examples:
>>> txt_field = Text()
>>> value = "some text annotation"
>>> txt_obj = txt_field.validate(value)
>>> txt_obj.__class__.__name__
"Text"
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/fields/special.py
Time
Bases: BaseField
A DSDL Field to validate the given value and return a time object.
Examples:
>>> time_field = Time(fmt="%Y-%m-%d %H:%M:%S")
>>> value = "2020-06-06 23:03:15"
>>> time_obj = time_field.validate(value)
>>> time_obj.__class__.__name__
"time"
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fmt |
The time format of the given value. |
required |
Attributes:
Name | Type | Description |
---|---|---|
fmt(str) |
The time format of the given value. |
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/fields/special.py
UniqueID
Bases: BaseField
A DSDL Field to validate the given value and return an UniqueID object.
Examples:
>>> id_field = UniqueID(id_type="image_id")
>>> value = "00000001"
>>> id_obj = id_field.validate(value)
>>> id_obj.__class__.__name__
"UniqueID"
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_type |
What the current unique id describes. |
required |
Attributes:
Name | Type | Description |
---|---|---|
id_type(str) |
What the current unique id describes. |