Skip to content

Commit

Permalink
♻️ refactor: test cases of vision data conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Zerohertz committed Nov 4, 2024
1 parent dbc545b commit 71114e4
Show file tree
Hide file tree
Showing 13 changed files with 271 additions and 160 deletions.
11 changes: 3 additions & 8 deletions test/data/annotation/coco-detection/images.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"width": 1283,
"height": 1283,
"id": 0,
"file_name": "images\/ce066911-test.jpg"
"file_name": "images/test.jpg"
}
],
"categories": [
Expand All @@ -19,12 +19,7 @@
"image_id": 0,
"category_id": 0,
"segmentation": [],
"bbox": [
0.0,
0.0,
1169.7941176470588,
1283.0
],
"bbox": [0.0, 0.0, 1169.7941176470588, 1283.0],
"ignore": 0,
"iscrowd": 0,
"area": 1500845.8529411764
Expand All @@ -38,4 +33,4 @@
"url": "",
"date_created": "2024-11-04 05:15:04.962792"
}
}
}
73 changes: 17 additions & 56 deletions test/data/annotation/coco-segmentation/images.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"width": 1283,
"height": 1283,
"id": 0,
"file_name": "images\/ce066911-test.jpg"
"file_name": "images/test.jpg"
}
],
"categories": [
Expand All @@ -20,62 +20,23 @@
"category_id": 0,
"segmentation": [
[
204.05010893246188,
489.161220043573,
178.89324618736384,
609.355119825708,
148.14596949891066,
718.3681917211329,
111.8082788671024,
777.0675381263617,
9.78322440087146,
923.8159041394335,
1.39760348583878,
934.9967320261436,
0.0,
1283.0,
982.5152505446622,
1283.0,
934.9967320261436,
1070.5642701525053,
1031.4313725490197,
1037.0217864923748,
1116.6851851851852,
930.8039215686274,
1143.239651416122,
818.9956427015251,
1146.0348583877997,
697.4041394335512,
1130.661220043573,
658.2712418300653,
1146.0348583877997,
498.9444444444445,
1112.492374727669,
401.11220043572985,
1066.3714596949892,
345.2080610021787,
1169.7941176470588,
0.0,
1080.347494553377,
0.0,
881.8877995642702,
229.20697167755998,
487.7636165577342,
251.56862745098042,
181.68845315904133,
0.0,
71.27777777777777,
0.0,
192.86928104575162,
479.37799564270153
204.05010893246188, 489.161220043573, 178.89324618736384,
609.355119825708, 148.14596949891066, 718.3681917211329,
111.8082788671024, 777.0675381263617, 9.78322440087146,
923.8159041394335, 1.39760348583878, 934.9967320261436, 0.0, 1283.0,
982.5152505446622, 1283.0, 934.9967320261436, 1070.5642701525053,
1031.4313725490197, 1037.0217864923748, 1116.6851851851852,
930.8039215686274, 1143.239651416122, 818.9956427015251,
1146.0348583877997, 697.4041394335512, 1130.661220043573,
658.2712418300653, 1146.0348583877997, 498.9444444444445,
1112.492374727669, 401.11220043572985, 1066.3714596949892,
345.2080610021787, 1169.7941176470588, 0.0, 1080.347494553377, 0.0,
881.8877995642702, 229.20697167755998, 487.7636165577342,
251.56862745098042, 181.68845315904133, 0.0, 71.27777777777777, 0.0,
192.86928104575162, 479.37799564270153
]
],
"bbox": [
0.0,
0.0,
1169.7941176470588,
1283.0
],
"bbox": [0.0, 0.0, 1169.7941176470588, 1283.0],
"ignore": 0,
"iscrowd": 0,
"area": 1120587.0741245067
Expand All @@ -89,4 +50,4 @@
"url": "",
"date_created": "2024-11-04 05:12:12.629617"
}
}
}
66 changes: 65 additions & 1 deletion test/data/annotation/label-studio-detection.json
Original file line number Diff line number Diff line change
@@ -1 +1,65 @@
[{"id":1,"annotations":[{"id":1,"completed_by":1,"result":[{"original_width":1283,"original_height":1283,"image_rotation":0,"value":{"x":0,"y":0,"width":91.1764705882353,"height":100,"rotation":0,"rectanglelabels":["Cat"]},"id":"TjAKadMcbI","from_name":"label","to_name":"image","type":"rectanglelabels","origin":"manual"}],"was_cancelled":false,"ground_truth":false,"created_at":"2024-11-04T05:11:38.330048Z","updated_at":"2024-11-04T05:14:53.361059Z","draft_created_at":"2024-11-04T05:10:42.618671Z","lead_time":86.758,"prediction":{},"result_count":0,"unique_id":"dfab6a15-7c4d-40e5-9d07-c69a4806b187","import_id":null,"last_action":null,"task":1,"project":1,"updated_by":1,"parent_prediction":null,"parent_annotation":null,"last_created_by":null}],"file_upload":"ce066911-test.jpg","drafts":[],"predictions":[],"data":{"image":"\/data\/upload\/1\/ce066911-test.jpg"},"meta":{},"created_at":"2024-11-04T05:10:07.188324Z","updated_at":"2024-11-04T05:14:53.384750Z","inner_id":1,"total_annotations":1,"cancelled_annotations":0,"total_predictions":0,"comment_count":0,"unresolved_comment_count":0,"last_comment_updated_at":null,"project":1,"updated_by":1,"comment_authors":[]}]
[
{
"id": 1,
"annotations": [
{
"id": 1,
"completed_by": 1,
"result": [
{
"original_width": 1283,
"original_height": 1283,
"image_rotation": 0,
"value": {
"x": 0,
"y": 0,
"width": 91.1764705882353,
"height": 100,
"rotation": 0,
"rectanglelabels": ["Cat"]
},
"id": "TjAKadMcbI",
"from_name": "label",
"to_name": "image",
"type": "rectanglelabels",
"origin": "manual"
}
],
"was_cancelled": false,
"ground_truth": false,
"created_at": "2024-11-04T05:11:38.330048Z",
"updated_at": "2024-11-04T05:14:53.361059Z",
"draft_created_at": "2024-11-04T05:10:42.618671Z",
"lead_time": 86.758,
"prediction": {},
"result_count": 0,
"unique_id": "dfab6a15-7c4d-40e5-9d07-c69a4806b187",
"import_id": null,
"last_action": null,
"task": 1,
"project": 1,
"updated_by": 1,
"parent_prediction": null,
"parent_annotation": null,
"last_created_by": null
}
],
"file_upload": "test.jpg",
"drafts": [],
"predictions": [],
"data": { "image": "/data/upload/1/test.jpg" },
"meta": {},
"created_at": "2024-11-04T05:10:07.188324Z",
"updated_at": "2024-11-04T05:14:53.384750Z",
"inner_id": 1,
"total_annotations": 1,
"cancelled_annotations": 0,
"total_predictions": 0,
"comment_count": 0,
"unresolved_comment_count": 0,
"last_comment_updated_at": null,
"project": 1,
"updated_by": 1,
"comment_authors": []
}
]
88 changes: 87 additions & 1 deletion test/data/annotation/label-studio-segmentation.json
Original file line number Diff line number Diff line change
@@ -1 +1,87 @@
[{"id":1,"annotations":[{"id":1,"completed_by":1,"result":[{"original_width":1283,"original_height":1283,"image_rotation":0,"value":{"points":[[15.904139433551197,38.12636165577342],[13.943355119825709,47.49455337690632],[11.546840958605664,55.99128540305011],[8.714596949891067,60.56644880174292],[0.7625272331154684,72.00435729847494],[0.10893246187363835,72.87581699346404],[0,100],[76.57952069716775,100],[72.87581699346404,83.44226579520696],[80.3921568627451,80.82788671023965],[87.03703703703704,72.54901960784314],[89.10675381263616,63.834422657952075],[89.32461873638344,54.35729847494554],[88.12636165577342,51.307189542483655],[89.32461873638344,38.88888888888889],[86.71023965141612,31.263616557734203],[83.11546840958606,26.906318082788673],[91.17647058823529,0],[84.20479302832244,0],[68.73638344226579,17.86492374727669],[38.01742919389978,19.607843137254903],[14.16122004357298,0],[5.5555555555555545,0],[15.032679738562091,37.36383442265795]],"closed":true,"polygonlabels":["Cat"]},"id":"e69elTFZfe","from_name":"label","to_name":"image","type":"polygonlabels","origin":"manual"}],"was_cancelled":false,"ground_truth":false,"created_at":"2024-11-04T05:11:38.330048Z","updated_at":"2024-11-04T05:11:38.330061Z","draft_created_at":"2024-11-04T05:10:42.618671Z","lead_time":73.283,"prediction":{},"result_count":0,"unique_id":"dfab6a15-7c4d-40e5-9d07-c69a4806b187","import_id":null,"last_action":null,"task":1,"project":1,"updated_by":1,"parent_prediction":null,"parent_annotation":null,"last_created_by":null}],"file_upload":"ce066911-test.jpg","drafts":[],"predictions":[],"data":{"image":"\/data\/upload\/1\/ce066911-test.jpg"},"meta":{},"created_at":"2024-11-04T05:10:07.188324Z","updated_at":"2024-11-04T05:11:38.341582Z","inner_id":1,"total_annotations":1,"cancelled_annotations":0,"total_predictions":0,"comment_count":0,"unresolved_comment_count":0,"last_comment_updated_at":null,"project":1,"updated_by":1,"comment_authors":[]}]
[
{
"id": 1,
"annotations": [
{
"id": 1,
"completed_by": 1,
"result": [
{
"original_width": 1283,
"original_height": 1283,
"image_rotation": 0,
"value": {
"points": [
[15.904139433551197, 38.12636165577342],
[13.943355119825709, 47.49455337690632],
[11.546840958605664, 55.99128540305011],
[8.714596949891067, 60.56644880174292],
[0.7625272331154684, 72.00435729847494],
[0.10893246187363835, 72.87581699346404],
[0, 100],
[76.57952069716775, 100],
[72.87581699346404, 83.44226579520696],
[80.3921568627451, 80.82788671023965],
[87.03703703703704, 72.54901960784314],
[89.10675381263616, 63.834422657952075],
[89.32461873638344, 54.35729847494554],
[88.12636165577342, 51.307189542483655],
[89.32461873638344, 38.88888888888889],
[86.71023965141612, 31.263616557734203],
[83.11546840958606, 26.906318082788673],
[91.17647058823529, 0],
[84.20479302832244, 0],
[68.73638344226579, 17.86492374727669],
[38.01742919389978, 19.607843137254903],
[14.16122004357298, 0],
[5.5555555555555545, 0],
[15.032679738562091, 37.36383442265795]
],
"closed": true,
"polygonlabels": ["Cat"]
},
"id": "e69elTFZfe",
"from_name": "label",
"to_name": "image",
"type": "polygonlabels",
"origin": "manual"
}
],
"was_cancelled": false,
"ground_truth": false,
"created_at": "2024-11-04T05:11:38.330048Z",
"updated_at": "2024-11-04T05:11:38.330061Z",
"draft_created_at": "2024-11-04T05:10:42.618671Z",
"lead_time": 73.283,
"prediction": {},
"result_count": 0,
"unique_id": "dfab6a15-7c4d-40e5-9d07-c69a4806b187",
"import_id": null,
"last_action": null,
"task": 1,
"project": 1,
"updated_by": 1,
"parent_prediction": null,
"parent_annotation": null,
"last_created_by": null
}
],
"file_upload": "test.jpg",
"drafts": [],
"predictions": [],
"data": { "image": "/data/upload/1/test.jpg" },
"meta": {},
"created_at": "2024-11-04T05:10:07.188324Z",
"updated_at": "2024-11-04T05:11:38.341582Z",
"inner_id": 1,
"total_annotations": 1,
"cancelled_annotations": 0,
"total_predictions": 0,
"comment_count": 0,
"unresolved_comment_count": 0,
"last_comment_updated_at": null,
"project": 1,
"updated_by": 1,
"comment_authors": []
}
]
13 changes: 0 additions & 13 deletions test/data/annotation/yolo-detection/notes.json

This file was deleted.

13 changes: 0 additions & 13 deletions test/data/annotation/yolo-segmentation/notes.json

This file was deleted.

Loading

0 comments on commit 71114e4

Please sign in to comment.