Skip to content

Commit 0ec994c

Browse files
authored
Merge pull request #119 from kurusugawa-computer/annofab-v0.71.0
Annofab v0.71.0に対応する
2 parents 2d27d73 + 5f06175 commit 0ec994c

13 files changed

+11804
-11588
lines changed

annofabapi/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.25.2'
1+
__version__ = '0.26.0'

annofabapi/dataclass/annotation.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,13 @@ class SimpleAnnotation:
225225
"""入力データID。[値の制約についてはこちら。](#section/API-Convention/APIID) """
226226

227227
input_data_name: str
228-
""""""
228+
"""入力データ名"""
229229

230230
details: List[SimpleAnnotationDetail]
231-
""""""
231+
"""矩形、ポリゴン、全体アノテーションなど個々のアノテーションの配列。"""
232232

233-
updated_datetime: str
234-
""""""
233+
updated_datetime: Optional[str]
234+
"""更新日時。アノテーションが一つもない場合(教師付作業が未着手のときなど)は、未指定。"""
235235

236236

237237
@dataclass_json

annofabapi/dataclass/annotation_specs.py

+16
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ class Keybind:
4040
""""""
4141

4242

43+
@dataclass_json
44+
@dataclass
45+
class PositionForMinimumBoundingBoxInsertion:
46+
"""
47+
`annotation_type` が `bounding_box` かつ `min_warn_rule` が `and` または `or` の場合のみ、挿入する最小矩形アノテーションの原点を指定できます。 画像左上の座標が「x=0, y=0」です。 未指定、もしくは「画像外に飛び出たアノテーション」を許可していないにも関わらず飛び出してしまう場合は、表示範囲の中央に挿入されます。 「スキャンした帳票の記入欄」や「定点カメラで撮影した製品ラベル」など、アノテーションしたい位置やサイズが多くの画像で共通している場合に便利です。 `annotation_type` が `bounding_box` 以外の場合は必ず未指定となります。
48+
"""
49+
x: int
50+
""""""
51+
52+
y: int
53+
""""""
54+
55+
4356
@dataclass_json
4457
@dataclass
4558
class LabelV1BoundingBoxMetadata:
@@ -64,6 +77,9 @@ class LabelV1BoundingBoxMetadata:
6477
min_vertices: Optional[int]
6578
""""""
6679

80+
position_for_minimum_bounding_box_insertion: Optional[PositionForMinimumBoundingBoxInsertion]
81+
""""""
82+
6783
tolerance: Optional[int]
6884
""""""
6985

annofabapi/dataclass/input.py

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ class InputData:
6161
resized_resolution: Optional[Resolution]
6262
""""""
6363

64+
input_duration: Optional[float]
65+
"""入力データが動画の場合、動画の長さ(秒)。小数点以下はミリ秒以下を表します。 動画の長さが取得できなかった場合、あるいは入力データが画像の場合は値なし。 """
66+
6467
updated_datetime: str
6568
""""""
6669

annofabapi/generated_api.py

+29
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,31 @@ def get_archive_full_with_pro_id(self, project_id: str, **kwargs) -> Tuple[Any,
389389
keyword_params: Dict[str, Any] = {}
390390
return self._request_wrapper(http_method, url_path, **keyword_params)
391391

392+
def get_editor_annotation(self, project_id: str, task_id: str, input_data_id: str,
393+
**kwargs) -> Tuple[Any, requests.Response]:
394+
"""タスク/入力データのアノテーション一括取得
395+
396+
397+
authorizations: AllProjectMember
398+
399+
400+
[putAnnotation](#operation/putAnnotation)が要求する構造のアノテーションを取得します。 このAPIは、[putAnnotation](#operation/putAnnotation)をより利用しやすくする目的で提供しています。 機械学習などで利用する成果物としてのアノテーションを取得するには、以下をご利用いただけます。 * [getAnnotation](#operation/getAnnotation): 特定のタスク - 入力データのアノテーション取得 * [getAnnotationArchive](#operation/getAnnotationArchive): プロジェクト全体のアノテーション(ZIP)
401+
402+
Args:
403+
project_id (str): プロジェクトID (required)
404+
task_id (str): タスクID (required)
405+
input_data_id (str): 入力データID (required)
406+
407+
Returns:
408+
Tuple[Annotation, requests.Response]
409+
410+
411+
"""
412+
url_path = f'/projects/{project_id}/tasks/{task_id}/inputs/{input_data_id}/annotation'
413+
http_method = 'GET'
414+
keyword_params: Dict[str, Any] = {}
415+
return self._request_wrapper(http_method, url_path, **keyword_params)
416+
392417
def post_annotation_archive_update(self, project_id: str, **kwargs) -> Tuple[Any, requests.Response]:
393418
"""アノテーションZIP更新開始
394419
@@ -1786,6 +1811,7 @@ def get_account_statistics(self, project_id: str, **kwargs) -> Tuple[Any, reques
17861811
authorizations: AllProjectMember
17871812
17881813
1814+
ユーザごと、日ごとに集計した以下のデータを取得します。 * 教師付を担当したタスクが完了状態になった回数 * 教師付を担当したタスクが差し戻された回数 * 作業時間
17891815
17901816
Args:
17911817
project_id (str): プロジェクトID (required)
@@ -1807,6 +1833,7 @@ def get_inspection_statistics(self, project_id: str, **kwargs) -> Tuple[Any, req
18071833
authorizations: AllProjectMember
18081834
18091835
1836+
ラベルごと、定型指摘ごとに集計した検査コメント数を取得します。
18101837
18111838
Args:
18121839
project_id (str): プロジェクトID (required)
@@ -1871,6 +1898,7 @@ def get_task_phase_statistics(self, project_id: str, **kwargs) -> Tuple[Any, req
18711898
authorizations: AllProjectMember
18721899
18731900
1901+
日ごと、フェーズごとに集計した以下のデータを取得します。 * 累積作業時間
18741902
18751903
Args:
18761904
project_id (str): プロジェクトID (required)
@@ -1892,6 +1920,7 @@ def get_task_statistics(self, project_id: str, **kwargs) -> Tuple[Any, requests.
18921920
authorizations: AllProjectMember
18931921
18941922
1923+
日ごと、タスクフェーズごと、タスクステータスごとに集計した以下のデータを取得します。 * タスク数 * 累計作業時間
18951924
18961925
Args:
18971926
project_id (str): プロジェクトID (required)

annofabapi/models.py

+20-3
Original file line numberDiff line numberDiff line change
@@ -1870,6 +1870,8 @@ class GraphType(Enum):
18701870
18711871
* resized_resolution: Resolution
18721872
1873+
* input_duration: float
1874+
入力データが動画の場合、動画の長さ(秒)。小数点以下はミリ秒以下を表します。 動画の長さが取得できなかった場合、あるいは入力データが画像の場合は値なし。
18731875
* updated_datetime: str
18741876
18751877
* sign_required: bool
@@ -2364,6 +2366,8 @@ class JobType(Enum):
23642366
23652367
* min_vertices: int
23662368
2369+
* position_for_minimum_bounding_box_insertion: PositionForMinimumBoundingBoxInsertion
2370+
23672371
* tolerance: int
23682372
23692373
@@ -2714,6 +2718,19 @@ class OrganizationMemberStatus(Enum):
27142718
* y: int
27152719
27162720
2721+
"""
2722+
2723+
PositionForMinimumBoundingBoxInsertion = Dict[str, Any]
2724+
"""
2725+
`annotation_type` が `bounding_box` かつ `min_warn_rule` が `and` または `or` の場合のみ、挿入する最小矩形アノテーションの原点を指定できます。 画像左上の座標が「x=0, y=0」です。 未指定、もしくは「画像外に飛び出たアノテーション」を許可していないにも関わらず飛び出してしまう場合は、表示範囲の中央に挿入されます。 「スキャンした帳票の記入欄」や「定点カメラで撮影した製品ラベル」など、アノテーションしたい位置やサイズが多くの画像で共通している場合に便利です。 `annotation_type` が `bounding_box` 以外の場合は必ず未指定となります。
2726+
2727+
Kyes of Dict
2728+
2729+
* x: int
2730+
2731+
* y: int
2732+
2733+
27172734
"""
27182735

27192736

@@ -3142,11 +3159,11 @@ class ProjectStatus(Enum):
31423159
* input_data_id: str
31433160
入力データID。[値の制約についてはこちら。](#section/API-Convention/APIID)
31443161
* input_data_name: str
3145-
3162+
入力データ名
31463163
* details: List[SimpleAnnotationDetail]
3147-
3164+
矩形、ポリゴン、全体アノテーションなど個々のアノテーションの配列。
31483165
* updated_datetime: str
3149-
3166+
更新日時。アノテーションが一つもない場合(教師付作業が未着手のときなど)は、未指定。
31503167
31513168
"""
31523169

generate/generate.sh

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ cat partial-header/dataclass/common.py partial-header/dataclass/annotation.py \
130130

131131
# Annotation Specs
132132
declare -a model_files=(${MODELS_DIR}/keybind.py \
133+
${MODELS_DIR}/position_for_minimum_bounding_box_insertion.py \
133134
${MODELS_DIR}/label_v1_bounding_box_metadata.py \
134135
${MODELS_DIR}/label_v1_segmentation_metadata.py \
135136
${MODELS_DIR}/internationalization_message_messages.py \

0 commit comments

Comments
 (0)