Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion annofabapi/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.33.1"
__version__ = "0.34.0"
14 changes: 7 additions & 7 deletions annofabapi/dataclass/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
TaskStatus,
)

OneOfstringFullAnnotationData = Union[str, Dict[str, Any]]
AnnotationData = Union[str, Dict[str, Any]]
FullAnnotationData = Dict[str, Any]
AdditionalDataValue = Dict[str, Any]

Expand Down Expand Up @@ -152,7 +152,7 @@ class AdditionalData:
"""

additional_data_definition_id: str
"""属性ID。[アノテーション仕様](#tag/af-annotation-specs)で定義されます。"""
""""""

flag: Optional[bool]
"""`additional_data_definition`の`type`が`flag`のときの属性値。 """
Expand All @@ -164,7 +164,7 @@ class AdditionalData:
"""`additional_data_definition`の`type`が`text`,`comment`,`link` または `tracking`のときの属性値。 """

choice: Optional[str]
"""`additional_data_definition`の`type`が`choice` または `select `のときの属性値(選択肢ID)。 """
""""""


@dataclass_json
Expand Down Expand Up @@ -387,19 +387,19 @@ class AnnotationDetail:
"""アノテーションID。[値の制約についてはこちら。](#section/API-Convention/APIID)<br> annotation_type が classification の場合は label_id と同じ値が格納されます。 """

account_id: str
"""アノテーションを作成したユーザのアカウントID。"""
""""""

label_id: str
"""ラベルID。[アノテーション仕様](#tag/af-annotation-specs)で定義されます。"""
""""""

is_protected: bool
"""`true`の場合、アノテーションをアノテーションエディタ上での削除から保護できます。 外部から取り込んだアノテーションに属性を追加するときなどに指定すると、データの削除を防げます。 """

data_holding_type: AnnotationDataHoldingType
""""""

data: Optional[OneOfstringFullAnnotationData]
"""アノテーションの座標値や区間などのデータ。レスポンスの場合は`string`形式、[putAnnotation](#operation/putAnnotation) APIのリクエストボディに渡す場合は`string`または`object`形式です。 `annotation_type`に応じて`string`,`object`の形式が変わります。 <table> <tr><th>annotation_type</th><th>data_holding_type</th><th>string形式</th><th>object形式</th></tr> <tr><td>bounding_box </td><td>inner</td><td><code>左上x,左上y,右下x,右下y</code></td><td><code>FullAnnotationDataBoundingBox</code></td></tr> <tr><td>point</td><td>inner</td><td><code>x1,y1</code></td><td><code>FullAnnotationDataSinglePoint</code></td></tr> <tr><td>polygon / polyline </td><td>inner</td><td><code>x1,y1,x2,y2, ... </code></td><td><code>FullAnnotationDataPoints</code></td></tr> <tr><td>range </td><td>inner</td><td><code>開始時間(ミリ秒),終了時間(ミリ秒) </code></td><td><code>FullAnnotationDataRange</code></td></tr> <tr><td>classification </td><td>inner</td><td><code>null </code></td><td><code>FullAnnotationDataClassification</code> / <code>null </code></td></tr> <tr><td>segmentation</td><td>outer</td><td><code>null </code></td><td><code>FullAnnotationDataSegmentation</code> / <code>null </code></td></tr> <tr><td>segmentation_v2 </td><td>outer</td><td><code>null </code></td><td><code>FullAnnotationDataSegmentationV2</code> / <code>null </code></td></tr> </table> """
data: Optional[AnnotationData]
""""""

path: Optional[str]
"""外部ファイルに保存されたアノテーションのパス。`data_holding_type`が`inner`の場合は未指定です。 レスポンスの場合は`annotation_id`と同じ値が格納されます。 [putAnnotation](#operation/putAnnotation) APIのリクエストボディに渡す場合は、[createTempPath](#operation/createTempPath) APIで取得できる一時データ保存先S3パスを格納してください。 更新しない場合は、[getEditorAnnotation](#operation/getEditorAnnotation) APIで取得した`path`をそのまま渡せます。 外部ファイルのフォーマットは下表の通りです。 <table> <tr><th>annotation_type</th><th>形式</th></tr> <tr><td>segmentation / segmentation_v2 </td><td>PNG画像。塗りつぶした部分は<code>rgba(255, 255, 255, 1) </code>、塗りつぶしていない部分は<code>rgba(0, 0, 0, 0) </code>。</td></tr> </table> """
Expand Down
10 changes: 5 additions & 5 deletions annofabapi/dataclass/annotation_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from annofabapi.models import AdditionalDataDefinitionType, AnnotationType

OneOfbooleanintegerstring = Union[bool, int, str]
AdditionalDataDefaultType = Union[bool, int, str]

AdditionalDataRestrictionCondition = Dict[str, Any]

Expand Down Expand Up @@ -226,8 +226,8 @@ class AdditionalDataDefinitionV1:
name: Optional[InternationalizationMessage]
""""""

default: Optional[OneOfbooleanintegerstring]
"""属性の初期値です。 初期値を指定する場合、属性の種類に応じて次の値を指定します。初期値を設定しない場合には空文字を指定します。 * type が flag の場合: 真偽値(`true` or `false`) * type が integer の場合: 整数値 * type が text の場合: 文字列 * type が comment の場合: 文字列 * type が choice の場合: 選択肢(`choices`)の `choice_id` * type が select の場合: 選択肢(`choices`)の `choice_id` 属性の種類に対して有効でない初期値を設定した場合、その設定は無視されます。 なお、トラッキングとリンクには初期値を設定できません。 """
default: Optional[AdditionalDataDefaultType]
""""""

keybind: Optional[List[Keybind]]
""""""
Expand Down Expand Up @@ -264,8 +264,8 @@ class AdditionalDataDefinitionV2:
name: Optional[InternationalizationMessage]
""""""

default: Optional[OneOfbooleanintegerstring]
"""属性の初期値です。 初期値を指定する場合、属性の種類に応じて次の値を指定します。初期値を設定しない場合には空文字を指定します。 * type が flag の場合: 真偽値(`true` or `false`) * type が integer の場合: 整数値 * type が text の場合: 文字列 * type が comment の場合: 文字列 * type が choice の場合: 選択肢(`choices`)の `choice_id` * type が select の場合: 選択肢(`choices`)の `choice_id` 属性の種類に対して有効でない初期値を設定した場合、その設定は無視されます。 なお、トラッキングとリンクには初期値を設定できません。 """
default: Optional[AdditionalDataDefaultType]
""""""

keybind: Optional[List[Keybind]]
""""""
Expand Down
5 changes: 5 additions & 0 deletions annofabapi/dataclass/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

from dataclasses_json import dataclass_json

SystemMetadata = Dict[str, Any]


@dataclass_json
@dataclass
Expand Down Expand Up @@ -75,3 +77,6 @@ class InputData:

metadata: Optional[Dict[str, str]]
"""ユーザーが自由に登録できるkey-value型のメタデータです。主にカスタムエディタで使われることを想定しています。 """

system_metadata: Optional[SystemMetadata]
""""""
14 changes: 7 additions & 7 deletions annofabapi/dataclass/inspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from annofabapi.models import InspectionStatus, TaskPhase

OneOfInspectionDataPointInspectionDataPolylineInspectionDataTime = Dict[str, Any]
InspectionData = Dict[str, Any]


@dataclass_json
Expand All @@ -40,22 +40,22 @@ class Inspection:
"""検査ID。[値の制約についてはこちら。](#section/API-Convention/APIID) """

phase: TaskPhase
"""検査コメントを付与したときのタスクフェーズ。[詳細はこちら](#section/TaskPhase)"""
""""""

phase_stage: int
"""検査コメントを付与したときのフェーズのステージ"""

commenter_account_id: str
"""検査コメントを付与したユーザのアカウントID"""
""""""

annotation_id: Optional[str]
"""検査コメントに紐づくアノテーションのID。アノテーションに紐付けられていない場合(アノテーションの付け忘れに対する指定など)は未指定。 [詳細はこちら](#section/AnnotationId)。 """
"""アノテーションID。[値の制約についてはこちら。](#section/API-Convention/APIID)<br> annotation_type が classification の場合は label_id と同じ値が格納されます。 """

data: OneOfInspectionDataPointInspectionDataPolylineInspectionDataTime
"""検査コメントの座標値や区間。 * `InspectionDataPoint`:点で検査コメントを付与したときの座標値 * `InspectionDataPolyline`:ポリラインで検査コメントを付与したときの座標値 * `InspectionDataTime`:検査コメントを付与した区間(動画プロジェクトの場合) """
data: InspectionData
""""""

parent_inspection_id: Optional[str]
"""返信先の検査コメントの検査ID。返信先の検査コメントは「スレッド内の直前のコメント」ではなく「スレッドの先頭のコメント」を指します。 """
"""検査ID。[値の制約についてはこちら。](#section/API-Convention/APIID) """

phrases: Optional[List[str]]
"""参照している定型指摘のID。"""
Expand Down
Loading