Skip to content

Commit

Permalink
Add ICDAR to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yasakova-anastasia committed Mar 29, 2021
1 parent 254889f commit cfe22a4
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 0 deletions.
72 changes: 72 additions & 0 deletions cvat/apps/dataset_manager/tests/assets/annotations.json
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,78 @@
],
"tracks": []
},
"ICDAR Localization 1.0": {
"version": 0,
"tags": [],
"shapes": [
{
"type": "rectangle",
"occluded": false,
"z_order": 0,
"points": [10.0, 8.79, 20.5, 15.69],
"frame": 0,
"label_id": null,
"group": 0,
"source": "manual",
"attributes": []
},
{
"type": "polygon",
"occluded": false,
"z_order": 0,
"points": [35.0, 22.5, 53.32, 30.63, 22.34, 29.45, 47.43, 38.21],
"frame": 0,
"label_id": null,
"group": 0,
"source": "manual",
"attributes": []
}
],
"tracks": []
},
"ICDAR Recognition 1.0": {
"version": 0,
"tags": [
{
"frame": 0,
"label_id": null,
"group": 0,
"source": "manual",
"attributes": []
}
],
"shapes": [],
"tracks": []
},
"ICDAR Segmentation 1.0": {
"version": 0,
"tags": [],
"shapes": [
{
"type": "rectangle",
"occluded": false,
"z_order": 0,
"points": [10.0, 12.1, 25.6, 21.9],
"frame": 0,
"label_id": null,
"group": 0,
"source": "manual",
"attributes": []
},
{
"type": "polygon",
"occluded": false,
"z_order": 0,
"points": [35.0, 22.5, 53.32, 30.63, 22.34, 29.45],
"frame": 0,
"label_id": null,
"group": 0,
"source": "manual",
"attributes": []
}
],
"tracks": []
},
"ImageNet 1.0": {
"version": 0,
"tags": [
Expand Down
58 changes: 58 additions & 0 deletions cvat/apps/dataset_manager/tests/assets/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,64 @@
}
]
},
"icdar_localization_and_recognition": {
"name": "icdar localization/recogntion task",
"overlap": 0,
"segment_size": 100,
"owner_id": 1,
"assignee_id": 2,
"labels": [
{
"name": "icdar",
"attributes": [
{
"name": "text",
"mutable": false,
"input_type": "text",
"values": ["word_1", "word_2", "word_3"]
}
]
}
]
},
"icdar_segmentation": {
"name": "icdar segmentation task",
"overlap": 0,
"segment_size": 100,
"owner_id": 1,
"assignee_id": 2,
"labels": [
{
"name": "icdar",
"attributes": [
{
"name": "text",
"mutable": false,
"input_type": "text",
"values": ["word_1", "word_2", "word_3"]
},
{
"name": "index",
"mutable": false,
"input_type": "number",
"values": ["0", "1", "2"]
},
{
"name": "color",
"mutable": false,
"input_type": "text",
"values": ["100 110 240", "10 15 20", "120 128 64"]
},
{
"name": "center",
"mutable": false,
"input_type": "text",
"values": ["1 2", "2 4", "10 45"]
}
]
}
]
},
"market1501": {
"name": "market1501 task",
"overlap": 0,
Expand Down
14 changes: 14 additions & 0 deletions cvat/apps/dataset_manager/tests/test_rest_api_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def test_api_v1_tasks_annotations_dump_and_upload_with_datumaro(self):
"CamVid 1.0", # issue #2840 and changed points values
"MOTS PNG 1.0", # issue #2925 and changed points values
"Segmentation mask 1.1", # changed points values
"ICDAR Segmentation 1.0", # changed points values
]:
self.skipTest("Format is fail")

Expand All @@ -235,6 +236,11 @@ def test_api_v1_tasks_annotations_dump_and_upload_with_datumaro(self):
images = self._generate_task_images(3)
if dump_format_name == "Market-1501 1.0":
task = self._create_task(tasks["market1501"], images)
elif dump_format_name in ["ICDAR Localization 1.0",
"ICDAR Recognition 1.0"]:
task = self._create_task(tasks["icdar_localization_and_recognition"], images)
elif dump_format_name == "ICDAR Segmentation 1.0":
task = self._create_task(tasks["icdar_segmentation"], images)
else:
task = self._create_task(tasks["main"], images)

Expand Down Expand Up @@ -536,6 +542,9 @@ def test_api_v1_tasks_annotations_dump_and_dataset_export_with_datumaro(self):
'WiderFace 1.0': 'wider_face',
'VGGFace2 1.0': 'vgg_face2',
'Market-1501 1.0': 'market1501',
'ICDAR Localization 1.0': 'icdar_text_localization',
'ICDAR Recognition 1.0': 'icdar_word_recognition',
'ICDAR Segmentation 1.0': 'icdar_text_segmentation',
}

# get formats
Expand All @@ -559,6 +568,11 @@ def test_api_v1_tasks_annotations_dump_and_dataset_export_with_datumaro(self):
images = self._generate_task_images(3)
if dump_format_name == "Market-1501 1.0":
task = self._create_task(tasks["market1501"], images)
elif dump_format_name in ["ICDAR Localization 1.0",
"ICDAR Recognition 1.0"]:
task = self._create_task(tasks["icdar_localization_and_recognition"], images)
elif dump_format_name == "ICDAR Segmentation 1.0":
task = self._create_task(tasks["icdar_segmentation"], images)
else:
task = self._create_task(tasks["main"], images)

Expand Down

0 comments on commit cfe22a4

Please sign in to comment.