-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
unexcellent
committed
Oct 31, 2024
1 parent
2df4b77
commit ee79bca
Showing
5 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from __future__ import annotations | ||
|
||
from pydantic import BaseModel | ||
|
||
from .boolean_attribute import JSONBooleanAttribute | ||
from .num_attribute import JSONNumAttribute | ||
from .text_attribute import JSONTextAttribute | ||
from .vec_attribute import JSONVecAttribute | ||
|
||
|
||
class JSONAttributes(BaseModel): | ||
"""Attributes is the alias of element data that can be nested inside geometric object data. | ||
For example, a certain bounding box can have attributes related to its score, visibility, etc. | ||
These values can be nested inside the bounding box as attributes. | ||
""" | ||
|
||
boolean: list[JSONBooleanAttribute] | None | ||
num: list[JSONNumAttribute] | None | ||
text: list[JSONTextAttribute] | None | ||
vec: list[JSONVecAttribute] | None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from __future__ import annotations | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class JSONBooleanAttribute(BaseModel): | ||
"""A boolean attribute.""" | ||
|
||
name: str | None | ||
"""Friendly identifier describing the attribute. Used to track the attribute throughout | ||
annotations and frames.""" | ||
|
||
val: bool | ||
"The boolean value." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from __future__ import annotations | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class JSONNumAttribute(BaseModel): | ||
"""A number attribute.""" | ||
|
||
name: str | None | ||
"""Friendly identifier describing the attribute. Used to track the attribute throughout | ||
annotations and frames.""" | ||
|
||
val: int | float | ||
"The number value." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from __future__ import annotations | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class JSONTextAttribute(BaseModel): | ||
"""A text attribute.""" | ||
|
||
name: str | None | ||
"""Friendly identifier describing the attribute. Used to track the attribute throughout | ||
annotations and frames.""" | ||
|
||
val: str | ||
"The text value." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from __future__ import annotations | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class JSONVecAttribute(BaseModel): | ||
"""A vec attribute.""" | ||
|
||
name: str | None | ||
"""Friendly identifier describing the attribute. Used to track the attribute throughout | ||
annotations and frames.""" | ||
|
||
val: list[int | float | str] | ||
"The value vector of the attribute." |