|
|
|
|
@ -2778,7 +2778,7 @@ class JobAnnotationAPITestCase(APITestCase):
|
|
|
|
|
def setUpTestData(cls):
|
|
|
|
|
create_db_users(cls)
|
|
|
|
|
|
|
|
|
|
def _create_task(self, owner, assignee):
|
|
|
|
|
def _create_task(self, owner, assignee, annotation_format=""):
|
|
|
|
|
data = {
|
|
|
|
|
"name": "my task #1",
|
|
|
|
|
"owner_id": owner.id,
|
|
|
|
|
@ -2833,6 +2833,30 @@ class JobAnnotationAPITestCase(APITestCase):
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
if annotation_format == "Market-1501 1.0":
|
|
|
|
|
data["labels"] = [{
|
|
|
|
|
"name": "market-1501",
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"name": "query",
|
|
|
|
|
"mutable": False,
|
|
|
|
|
"input_type": "select",
|
|
|
|
|
"values": ["True", "False"]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "camera_id",
|
|
|
|
|
"mutable": False,
|
|
|
|
|
"input_type": "number",
|
|
|
|
|
"values": ["0", "1", "2", "3", "4", "5"]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "person_id",
|
|
|
|
|
"mutable": False,
|
|
|
|
|
"input_type": "number",
|
|
|
|
|
"values": ["1", "2", "3"]
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
with ForceLogin(owner, self.client):
|
|
|
|
|
response = self.client.post('/api/v1/tasks', data=data, format="json")
|
|
|
|
|
@ -3812,147 +3836,148 @@ class TaskAnnotationAPITestCase(JobAnnotationAPITestCase):
|
|
|
|
|
HTTP_201_CREATED = status.HTTP_401_UNAUTHORIZED
|
|
|
|
|
|
|
|
|
|
def _get_initial_annotation(annotation_format):
|
|
|
|
|
rectangle_tracks_with_attrs = [{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"label_id": task["labels"][0]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][0]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][0]["values"][0]
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
"shapes": [
|
|
|
|
|
{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"points": [1.0, 2.1, 50.1, 30.22],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": False,
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][1]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][1]["default_value"]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"points": [2.0, 2.1, 77.2, 36.22],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": True,
|
|
|
|
|
"outside": False,
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][1]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][1]["default_value"]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 2,
|
|
|
|
|
"points": [2.0, 2.1, 77.2, 36.22],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": True,
|
|
|
|
|
"outside": True,
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][1]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][1]["default_value"]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
}]
|
|
|
|
|
rectangle_tracks_wo_attrs = [{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"label_id": task["labels"][1]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"shapes": [
|
|
|
|
|
{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [1.0, 2.1, 50.2, 36.6],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": False,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [1.0, 2.1, 51, 36.6],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": False
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 2,
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [1.0, 2.1, 51, 36.6],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": True,
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}]
|
|
|
|
|
polygon_tracks_wo_attrs = [{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"label_id": task["labels"][1]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"shapes": [
|
|
|
|
|
{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [1.0, 2.1, 50.2, 36.6, 7.0, 10.0],
|
|
|
|
|
"type": "polygon",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": False,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [1.0, 2.1, 51, 36.6, 8.0, 11.0],
|
|
|
|
|
"type": "polygon",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": False
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 2,
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [1.0, 2.1, 51, 36.6, 14.0, 15.0],
|
|
|
|
|
"type": "polygon",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": True,
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}]
|
|
|
|
|
if annotation_format != "Market-1501 1.0":
|
|
|
|
|
rectangle_tracks_with_attrs = [{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"label_id": task["labels"][0]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][0]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][0]["values"][0]
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
"shapes": [
|
|
|
|
|
{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"points": [1.0, 2.1, 50.1, 30.22],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": False,
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][1]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][1]["default_value"]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"points": [2.0, 2.1, 77.2, 36.22],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": True,
|
|
|
|
|
"outside": False,
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][1]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][1]["default_value"]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 2,
|
|
|
|
|
"points": [2.0, 2.1, 77.2, 36.22],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": True,
|
|
|
|
|
"outside": True,
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][1]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][1]["default_value"]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
}]
|
|
|
|
|
rectangle_tracks_wo_attrs = [{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"label_id": task["labels"][1]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"shapes": [
|
|
|
|
|
{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [1.0, 2.1, 50.2, 36.6],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": False,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [1.0, 2.1, 51, 36.6],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": False
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 2,
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [1.0, 2.1, 51, 36.6],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": True,
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}]
|
|
|
|
|
polygon_tracks_wo_attrs = [{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"label_id": task["labels"][1]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"shapes": [
|
|
|
|
|
{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [1.0, 2.1, 50.2, 36.6, 7.0, 10.0],
|
|
|
|
|
"type": "polygon",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": False,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [1.0, 2.1, 51, 36.6, 8.0, 11.0],
|
|
|
|
|
"type": "polygon",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": False
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 2,
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [1.0, 2.1, 51, 36.6, 14.0, 15.0],
|
|
|
|
|
"type": "polygon",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
"outside": True,
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
rectangle_shapes_with_attrs = [{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"label_id": task["labels"][0]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][0]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][0]["values"][0]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][1]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][1]["default_value"]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"points": [1.0, 2.1, 10.6, 53.22],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
}]
|
|
|
|
|
rectangle_shapes_with_attrs = [{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"label_id": task["labels"][0]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][0]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][0]["values"][0]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][1]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][1]["default_value"]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"points": [1.0, 2.1, 10.6, 53.22],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
rectangle_shapes_with_wider_attrs = [{
|
|
|
|
|
rectangle_shapes_with_wider_attrs = [{
|
|
|
|
|
"frame": 0,
|
|
|
|
|
"label_id": task["labels"][2]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
@ -3976,59 +4001,59 @@ class TaskAnnotationAPITestCase(JobAnnotationAPITestCase):
|
|
|
|
|
"occluded": False,
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
rectangle_shapes_wo_attrs = [{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"label_id": task["labels"][1]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [2.0, 2.1, 40, 50.7],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
}]
|
|
|
|
|
rectangle_shapes_wo_attrs = [{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"label_id": task["labels"][1]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [2.0, 2.1, 40, 50.7],
|
|
|
|
|
"type": "rectangle",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
polygon_shapes_wo_attrs = [{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"label_id": task["labels"][1]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [2.0, 2.1, 100, 30.22, 40, 77, 1, 3],
|
|
|
|
|
"type": "polygon",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
}]
|
|
|
|
|
polygon_shapes_wo_attrs = [{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"label_id": task["labels"][1]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [2.0, 2.1, 100, 30.22, 40, 77, 1, 3],
|
|
|
|
|
"type": "polygon",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
polygon_shapes_with_attrs = [{
|
|
|
|
|
"frame": 2,
|
|
|
|
|
"label_id": task["labels"][0]["id"],
|
|
|
|
|
"group": 1,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][0]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][0]["values"][1]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][1]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][1]["default_value"]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"points": [20.0, 0.1, 10, 3.22, 4, 7, 10, 30, 1, 2, 4.44, 5.55],
|
|
|
|
|
"type": "polygon",
|
|
|
|
|
"occluded": True,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 2,
|
|
|
|
|
"label_id": task["labels"][1]["id"],
|
|
|
|
|
"group": 1,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [4, 7, 10, 30, 4, 5.55],
|
|
|
|
|
"type": "polygon",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
}]
|
|
|
|
|
polygon_shapes_with_attrs = [{
|
|
|
|
|
"frame": 2,
|
|
|
|
|
"label_id": task["labels"][0]["id"],
|
|
|
|
|
"group": 1,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][0]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][0]["values"][1]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][1]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][1]["default_value"]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"points": [20.0, 0.1, 10, 3.22, 4, 7, 10, 30, 1, 2, 4.44, 5.55],
|
|
|
|
|
"type": "polygon",
|
|
|
|
|
"occluded": True,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"frame": 2,
|
|
|
|
|
"label_id": task["labels"][1]["id"],
|
|
|
|
|
"group": 1,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [],
|
|
|
|
|
"points": [4, 7, 10, 30, 4, 5.55],
|
|
|
|
|
"type": "polygon",
|
|
|
|
|
"occluded": False,
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
points_wo_attrs = [{
|
|
|
|
|
points_wo_attrs = [{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"label_id": task["labels"][1]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
@ -4039,36 +4064,36 @@ class TaskAnnotationAPITestCase(JobAnnotationAPITestCase):
|
|
|
|
|
"occluded": False,
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
tags_wo_attrs = [{
|
|
|
|
|
"frame": 2,
|
|
|
|
|
"label_id": task["labels"][1]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [],
|
|
|
|
|
}]
|
|
|
|
|
tags_with_attrs = [{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"label_id": task["labels"][0]["id"],
|
|
|
|
|
"group": 3,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][0]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][0]["values"][1]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][1]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][1]["default_value"]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
}]
|
|
|
|
|
tags_wo_attrs = [{
|
|
|
|
|
"frame": 2,
|
|
|
|
|
"label_id": task["labels"][1]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [],
|
|
|
|
|
}]
|
|
|
|
|
tags_with_attrs = [{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"label_id": task["labels"][0]["id"],
|
|
|
|
|
"group": 3,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][0]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][0]["values"][1]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][1]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][1]["default_value"]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
annotations = {
|
|
|
|
|
"version": 0,
|
|
|
|
|
"tags": [],
|
|
|
|
|
"shapes": [],
|
|
|
|
|
"tracks": [],
|
|
|
|
|
}
|
|
|
|
|
"version": 0,
|
|
|
|
|
"tags": [],
|
|
|
|
|
"shapes": [],
|
|
|
|
|
"tracks": [],
|
|
|
|
|
}
|
|
|
|
|
if annotation_format == "CVAT for video 1.1":
|
|
|
|
|
annotations["tracks"] = rectangle_tracks_with_attrs \
|
|
|
|
|
+ rectangle_tracks_wo_attrs \
|
|
|
|
|
@ -4133,6 +4158,29 @@ class TaskAnnotationAPITestCase(JobAnnotationAPITestCase):
|
|
|
|
|
annotations["shapes"] = points_wo_attrs \
|
|
|
|
|
+ rectangle_shapes_wo_attrs
|
|
|
|
|
|
|
|
|
|
elif annotation_format == "Market-1501 1.0":
|
|
|
|
|
tags_with_attrs = [{
|
|
|
|
|
"frame": 1,
|
|
|
|
|
"label_id": task["labels"][0]["id"],
|
|
|
|
|
"group": 0,
|
|
|
|
|
"source": "manual",
|
|
|
|
|
"attributes": [
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][0]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][0]["values"][1]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][1]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][1]["values"][2]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"spec_id": task["labels"][0]["attributes"][2]["id"],
|
|
|
|
|
"value": task["labels"][0]["attributes"][2]["values"][0]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
}]
|
|
|
|
|
annotations["tags"] = tags_with_attrs
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
raise Exception("Unknown format {}".format(annotation_format))
|
|
|
|
|
|
|
|
|
|
@ -4169,7 +4217,7 @@ class TaskAnnotationAPITestCase(JobAnnotationAPITestCase):
|
|
|
|
|
with self.subTest(export_format=export_format,
|
|
|
|
|
import_format=import_format):
|
|
|
|
|
# 1. create task
|
|
|
|
|
task, jobs = self._create_task(owner, assignee)
|
|
|
|
|
task, jobs = self._create_task(owner, assignee, import_format)
|
|
|
|
|
|
|
|
|
|
# 2. add annotation
|
|
|
|
|
data = _get_initial_annotation(export_format)
|
|
|
|
|
|