Skip to content

Commit 58a5e14

Browse files
authored
Merge pull request #92 from kurusugawa-computer/feature/annofab-v0.66.7
Annofab v0.66.7のリリースによる対応
2 parents de7c377 + 3c143c3 commit 58a5e14

11 files changed

+105
-25
lines changed

annofabapi/dataclass/project.py

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ class ProjectConfiguration:
4343
max_tasks_per_member_including_hold: Optional[int]
4444
"""保留中のタスクを含めて、1人(オーナー以外)に割り当てられるタスク数上限。未指定の場合は20件として扱う。"""
4545

46+
input_data_set_id_list: Optional[List[str]]
47+
"""このフィールドは内部用でまだ何も意味を成しません。今は空配列を指定してください。"""
48+
4649
input_data_max_long_side_length: Optional[int]
4750
"""入力データ画像の長辺の最大値(未指定時は4096px)。 画像をアップロードすると、長辺がこの値になるように画像が自動で圧縮されます。 アノテーションの座標は、もとの解像度の画像でつけたものに復元されます。 大きな数値を設定すると入力データ画像のサイズが大きくなり、生産性低下やブラウザで画像を表示できない懸念があります。注意して設定してください。 """
4851

annofabapi/dataclass/project_member.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ProjectMember:
4848
""""""
4949

5050
sampling_inspection_rate: Optional[int]
51-
"""メンバー固有の抜取検査率。0-100のパーセント値で指定する。値が指定された場合、プロジェクトの抜取検査率を指定の値で上書きする。"""
51+
"""メンバー固有の抜取検査率(0-100のパーセント値)。"""
5252

5353
sampling_acceptance_rate: Optional[int]
54-
"""メンバー固有の抜取受入率。"""
54+
"""メンバー固有の抜取受入率(0-100のパーセント値)。"""

annofabapi/models.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -2558,6 +2558,8 @@ class PricePlan(Enum):
25582558
保留中のタスクを除き、1人(オーナー以外)に割り当てられるタスク数上限。未指定の場合は10件として扱う。
25592559
* max_tasks_per_member_including_hold: int
25602560
保留中のタスクを含めて、1人(オーナー以外)に割り当てられるタスク数上限。未指定の場合は20件として扱う。
2561+
* input_data_set_id_list: List[str]
2562+
このフィールドは内部用でまだ何も意味を成しません。今は空配列を指定してください。
25612563
* input_data_max_long_side_length: int
25622564
入力データ画像の長辺の最大値(未指定時は4096px)。 画像をアップロードすると、長辺がこの値になるように画像が自動で圧縮されます。 アノテーションの座標は、もとの解像度の画像でつけたものに復元されます。 大きな数値を設定すると入力データ画像のサイズが大きくなり、生産性低下やブラウザで画像を表示できない懸念があります。注意して設定してください。
25632565
* sampling_inspection_rate: int
@@ -2621,7 +2623,9 @@ class PricePlan(Enum):
26212623
* created_datetime: str
26222624
26232625
* sampling_inspection_rate: int
2624-
メンバー固有の抜取検査率。0-100のパーセント値で指定する。値が指定された場合、プロジェクトの抜取検査率を指定の値で上書きする。
2626+
メンバー固有の抜取検査率(0-100のパーセント値)。
2627+
* sampling_acceptance_rate: int
2628+
メンバー固有の抜取受入率(0-100のパーセント値)。
26252629
26262630
"""
26272631

@@ -2635,6 +2639,10 @@ class PricePlan(Enum):
26352639
26362640
* member_role: ProjectMemberRole
26372641
2642+
* sampling_inspection_rate: int
2643+
メンバー固有の抜取検査率。0-100のパーセント値で指定する。値が指定された場合、プロジェクトの抜取検査率を指定の値で上書きする。
2644+
* sampling_acceptance_rate: int
2645+
メンバー固有の抜取受入率。0-100のパーセント値で指定する。値が指定された場合、プロジェクトの抜取受入率を指定の値で上書きする。
26382646
* last_updated_datetime: str
26392647
新規作成時は未指定、更新時は必須(更新前の日時)
26402648

generate/swagger/swagger-api-components.yaml

+10-1
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,10 @@
12961296
type: string
12971297
format: date-time
12981298
sampling_inspection_rate:
1299-
description: メンバー固有の抜取検査率。0-100のパーセント値で指定する。値が指定された場合、プロジェクトの抜取検査率を指定の値で上書きする。
1299+
description: メンバー固有の抜取検査率(0-100のパーセント値)。
1300+
type: integer
1301+
sampling_acceptance_rate:
1302+
description: メンバー固有の抜取受入率(0-100のパーセント値)。
13001303
type: integer
13011304
ProjectMemberStatus:
13021305
type: string
@@ -1320,6 +1323,12 @@
13201323
$ref: "#/components/schemas/ProjectMemberStatus"
13211324
member_role:
13221325
$ref: "#/components/schemas/ProjectMemberRole"
1326+
sampling_inspection_rate:
1327+
description: メンバー固有の抜取検査率。0-100のパーセント値で指定する。値が指定された場合、プロジェクトの抜取検査率を指定の値で上書きする。
1328+
type: integer
1329+
sampling_acceptance_rate:
1330+
description: メンバー固有の抜取受入率。0-100のパーセント値で指定する。値が指定された場合、プロジェクトの抜取受入率を指定の値で上書きする。
1331+
type: integer
13231332
last_updated_datetime:
13241333
$ref: "#/components/schemas/LastUpdatedDatetime"
13251334
ProjectTaskStatisticsHistory:

generate/swagger/swagger.v2.yaml

+11-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ info:
7676
WebhookID | プロジェクト内で一意
7777
入力データセットID | 組織内で一意
7878
79-
version: 0.66.4
79+
version: 0.66.7
8080
title: AnnoFab Web API
8181
x-logo:
8282
url: "https://annofab.com/images/logo_landscape.png"
@@ -1878,7 +1878,10 @@ components:
18781878
type: string
18791879
format: date-time
18801880
sampling_inspection_rate:
1881-
description: メンバー固有の抜取検査率。0-100のパーセント値で指定する。値が指定された場合、プロジェクトの抜取検査率を指定の値で上書きする。
1881+
description: メンバー固有の抜取検査率(0-100のパーセント値)。
1882+
type: integer
1883+
sampling_acceptance_rate:
1884+
description: メンバー固有の抜取受入率(0-100のパーセント値)。
18821885
type: integer
18831886
ProjectMemberStatus:
18841887
type: string
@@ -1902,6 +1905,12 @@ components:
19021905
$ref: "#/components/schemas/ProjectMemberStatus"
19031906
member_role:
19041907
$ref: "#/components/schemas/ProjectMemberRole"
1908+
sampling_inspection_rate:
1909+
description: メンバー固有の抜取検査率。0-100のパーセント値で指定する。値が指定された場合、プロジェクトの抜取検査率を指定の値で上書きする。
1910+
type: integer
1911+
sampling_acceptance_rate:
1912+
description: メンバー固有の抜取受入率。0-100のパーセント値で指定する。値が指定された場合、プロジェクトの抜取受入率を指定の値で上書きする。
1913+
type: integer
19051914
last_updated_datetime:
19061915
$ref: "#/components/schemas/LastUpdatedDatetime"
19071916
ProjectTaskStatisticsHistory:

generate/swagger/swagger.yaml

+11-8
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ info:
7676
WebhookID | プロジェクト内で一意
7777
入力データセットID | 組織内で一意
7878
79-
version: 0.66.4
79+
version: 0.66.7
8080
title: AnnoFab Web API
8181
x-logo:
8282
url: "https://annofab.com/images/logo_landscape.png"
@@ -1630,12 +1630,6 @@ paths:
16301630
$ref: "#/components/responses/ErrorInvalidRequest"
16311631
401:
16321632
$ref: "#/components/responses/ErrorUnauthorizedApi"
1633-
409:
1634-
description: 停止中プロジェクトに対する操作のため失敗
1635-
content:
1636-
application/json:
1637-
schema:
1638-
$ref: "#/components/schemas/ErrorStateMismatch"
16391633
503:
16401634
$ref: "#/components/responses/ErrorUnderMaintenance"
16411635
/projects/{project_id}/rawdata/inspections:
@@ -5868,7 +5862,10 @@ components:
58685862
type: string
58695863
format: date-time
58705864
sampling_inspection_rate:
5871-
description: メンバー固有の抜取検査率。0-100のパーセント値で指定する。値が指定された場合、プロジェクトの抜取検査率を指定の値で上書きする。
5865+
description: メンバー固有の抜取検査率(0-100のパーセント値)。
5866+
type: integer
5867+
sampling_acceptance_rate:
5868+
description: メンバー固有の抜取受入率(0-100のパーセント値)。
58725869
type: integer
58735870
ProjectMemberStatus:
58745871
type: string
@@ -5892,6 +5889,12 @@ components:
58925889
$ref: "#/components/schemas/ProjectMemberStatus"
58935890
member_role:
58945891
$ref: "#/components/schemas/ProjectMemberRole"
5892+
sampling_inspection_rate:
5893+
description: メンバー固有の抜取検査率。0-100のパーセント値で指定する。値が指定された場合、プロジェクトの抜取検査率を指定の値で上書きする。
5894+
type: integer
5895+
sampling_acceptance_rate:
5896+
description: メンバー固有の抜取受入率。0-100のパーセント値で指定する。値が指定された場合、プロジェクトの抜取受入率を指定の値で上書きする。
5897+
type: integer
58955898
last_updated_datetime:
58965899
$ref: "#/components/schemas/LastUpdatedDatetime"
58975900
ProjectTaskStatisticsHistory:

tests/data/dataclass/project.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,22 @@
55
"overview": "",
66
"project_status": "active",
77
"input_data_type": "image",
8-
"created_datetime": "2019-04-23T12:03:21.721+09:00",
9-
"updated_datetime": "2019-08-22T12:07:48.918+09:00",
8+
"created_datetime": "2019-04-19T16:29:41.06+09:00",
9+
"updated_datetime": "2019-11-06T10:30:57.575+09:00",
1010
"configuration": {
11-
"project_rule": null,
1211
"number_of_inspections": 0,
1312
"assignee_rule_of_resubmitted_task": "no_assignee",
1413
"max_tasks_per_member": 10,
1514
"max_tasks_per_member_including_hold": 20,
1615
"private_storage_aws_iam_role_arn": null,
16+
"input_data_set_id_list": [
17+
"90788848-4c48-4314-86b0-d2c12138dab5"
18+
],
1719
"input_data_max_long_side_length": null,
1820
"sampling_inspection_rate": null,
1921
"sampling_acceptance_rate": null
2022
},
2123
"summary": {
22-
"last_tasks_updated_datetime": "2019-08-22T12:07:31.321+09:00"
24+
"last_tasks_updated_datetime": "2019-11-19T17:26:51.348+09:00"
2325
}
2426
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"project_id": "a2345678-abcd-1234-abcd-1234abcd5678",
3+
"annotation_format_version": "1.2.0",
4+
"task_id": "sample_2",
5+
"task_phase": "acceptance",
6+
"task_phase_stage": 1,
7+
"task_status": "complete",
8+
"input_data_id": "6e37eeac-2327-48f0-b8f2-3179b5f294ba",
9+
"input_data_name": "test.out4.mp4",
10+
"details": [
11+
{
12+
"label": "brightness",
13+
"annotation_id": "ce55cf39-0e94-46b1-a714-e0df4ecf78f7",
14+
"data": {
15+
"_type": "Classification"
16+
},
17+
"attributes": {
18+
"bright": true
19+
}
20+
},
21+
{
22+
"label": "Objects-of-Interest",
23+
"annotation_id": "60fe3050-e132-49af-bef1-95106b6d930d",
24+
"data": {
25+
"begin": 11000,
26+
"end": 13200,
27+
"_type": "Range"
28+
},
29+
"attributes": {
30+
"occluded": false,
31+
"truncated": true
32+
}
33+
}
34+
],
35+
"updated_datetime": "2019-11-22T14:29:33.96+09:00"
36+
}

tests/data/dataclass/simple-annotation.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"project_id": "1186bb00-16e6-4d20-8e24-310322911850",
2+
"project_id": "a2345678-abcd-1234-abcd-1234abcd5678",
33
"annotation_format_version": "1.2.0",
44
"task_id": "sample_1",
55
"task_phase": "acceptance",

tests/test_dataclass.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,12 @@ def test_instruction_image(self):
100100

101101
class TestJob:
102102
def test_job(self):
103-
job_list = service.wrapper.get_all_project_job(project_id, query_params={"type": "gen-tasks"})
104-
job = JobInfo.from_dict(job_list[0])
105-
assert type(job) == JobInfo
103+
job_list = service.wrapper.get_all_project_job(project_id, query_params={"type": "gen-annotation"})
104+
if len(job_list) > 0:
105+
job = JobInfo.from_dict(job_list[0])
106+
assert type(job) == JobInfo
107+
else:
108+
print(f"'gen-annotation'のジョブが存在しませんでした。")
106109

107110

108111
class TestMy:

tests/test_local_dataclass.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,18 @@
2929

3030

3131
class TestAnnotation:
32-
def test_simple_annotation(self):
32+
def test_simple_annotation_for_image(self):
3333
simple_annotaion_json = test_dir / "simple-annotation.json"
3434
with simple_annotaion_json.open(encoding="utf-8") as f:
35-
dict_full_annotation = json.load(f)
36-
simple_annotion = SimpleAnnotation.from_dict(dict_full_annotation)
35+
dict_simple_annotation = json.load(f)
36+
simple_annotion = SimpleAnnotation.from_dict(dict_simple_annotation)
37+
assert type(simple_annotion) == SimpleAnnotation
38+
39+
def test_simple_annotation_for_movie(self):
40+
simple_annotaion_json = test_dir / "simple-annotation-movie.json"
41+
with simple_annotaion_json.open(encoding="utf-8") as f:
42+
dict_simple_annotation = json.load(f)
43+
simple_annotion = SimpleAnnotation.from_dict(dict_simple_annotation)
3744
assert type(simple_annotion) == SimpleAnnotation
3845

3946
def test_full_annotation(self):

0 commit comments

Comments
 (0)