forked from openvinotoolkit/datumaro
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix datumaro export with media (#34)
* Fix broken type inference for media_as * Remove duplicated 'media' field in dm export * Add PointCloud to datumaro import namespace * Format code * Add tests for the issue and datumaro dataset examples * Apply black v2024 * Apply black v2024 * Ignore some bandit warnings * Fix paths in test * Update changelog
- Loading branch information
1 parent
446bad5
commit 8ba237c
Showing
16 changed files
with
637 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
tests/assets/datumaro_dataset/diverse/annotations/default.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"info": {}, | ||
"categories": { | ||
"label": { | ||
"labels": [ | ||
{ "name": "cat0", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat1", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat2", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat3", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat4", "parent": "", "attributes": ["x", "y"] } | ||
], | ||
"attributes": ["a", "b", "score"] | ||
}, | ||
"mask": { | ||
"colormap": [ | ||
{ "label_id": 0, "r": 0, "g": 0, "b": 0 }, | ||
{ "label_id": 1, "r": 128, "g": 0, "b": 0 }, | ||
{ "label_id": 2, "r": 0, "g": 128, "b": 0 }, | ||
{ "label_id": 3, "r": 128, "g": 128, "b": 0 }, | ||
{ "label_id": 4, "r": 0, "g": 0, "b": 128 } | ||
] | ||
}, | ||
"points": { | ||
"items": [ | ||
{ "label_id": 0, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 1, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 2, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 3, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 4, "labels": ["cat1", "cat2"], "joints": [[0, 1]] } | ||
] | ||
} | ||
}, | ||
"items": [ | ||
{ "id": "42", "annotations": [] }, | ||
{ | ||
"id": "43", | ||
"annotations": [], | ||
"image": { "path": "43.qq", "size": [2, 4] } | ||
} | ||
] | ||
} |
51 changes: 51 additions & 0 deletions
51
tests/assets/datumaro_dataset/diverse/annotations/test.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
"info": {}, | ||
"categories": { | ||
"label": { | ||
"labels": [ | ||
{ "name": "cat0", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat1", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat2", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat3", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat4", "parent": "", "attributes": ["x", "y"] } | ||
], | ||
"attributes": ["a", "b", "score"] | ||
}, | ||
"mask": { | ||
"colormap": [ | ||
{ "label_id": 0, "r": 0, "g": 0, "b": 0 }, | ||
{ "label_id": 1, "r": 128, "g": 0, "b": 0 }, | ||
{ "label_id": 2, "r": 0, "g": 128, "b": 0 }, | ||
{ "label_id": 3, "r": 128, "g": 128, "b": 0 }, | ||
{ "label_id": 4, "r": 0, "g": 0, "b": 128 } | ||
] | ||
}, | ||
"points": { | ||
"items": [ | ||
{ "label_id": 0, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 1, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 2, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 3, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 4, "labels": ["cat1", "cat2"], "joints": [[0, 1]] } | ||
] | ||
} | ||
}, | ||
"items": [ | ||
{ | ||
"id": "1", | ||
"annotations": [ | ||
{ | ||
"id": 6, | ||
"type": "cuboid_3d", | ||
"attributes": { "occluded": true }, | ||
"group": 6, | ||
"label_id": 0, | ||
"position": [1.0, 2.0, 3.0], | ||
"rotation": [2.0, 2.0, 4.0], | ||
"scale": [1.0, 3.0, 4.0] | ||
} | ||
] | ||
}, | ||
{ "id": "42", "annotations": [], "attr": { "a1": 5, "a2": "42" } } | ||
] | ||
} |
127 changes: 127 additions & 0 deletions
127
tests/assets/datumaro_dataset/diverse/annotations/train.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
{ | ||
"info": {}, | ||
"categories": { | ||
"label": { | ||
"labels": [ | ||
{ "name": "cat0", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat1", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat2", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat3", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat4", "parent": "", "attributes": ["x", "y"] } | ||
], | ||
"attributes": ["a", "b", "score"] | ||
}, | ||
"mask": { | ||
"colormap": [ | ||
{ "label_id": 0, "r": 0, "g": 0, "b": 0 }, | ||
{ "label_id": 1, "r": 128, "g": 0, "b": 0 }, | ||
{ "label_id": 2, "r": 0, "g": 128, "b": 0 }, | ||
{ "label_id": 3, "r": 128, "g": 128, "b": 0 }, | ||
{ "label_id": 4, "r": 0, "g": 0, "b": 128 } | ||
] | ||
}, | ||
"points": { | ||
"items": [ | ||
{ "label_id": 0, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 1, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 2, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 3, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 4, "labels": ["cat1", "cat2"], "joints": [[0, 1]] } | ||
] | ||
} | ||
}, | ||
"items": [ | ||
{ | ||
"id": "100", | ||
"annotations": [ | ||
{ | ||
"id": 1, | ||
"type": "caption", | ||
"attributes": {}, | ||
"group": 0, | ||
"caption": "hello" | ||
}, | ||
{ | ||
"id": 2, | ||
"type": "caption", | ||
"attributes": {}, | ||
"group": 5, | ||
"caption": "world" | ||
}, | ||
{ | ||
"id": 3, | ||
"type": "label", | ||
"attributes": { "x": 1, "y": "2" }, | ||
"group": 0, | ||
"label_id": 2 | ||
}, | ||
{ | ||
"id": 4, | ||
"type": "bbox", | ||
"attributes": { "score": 1.0 }, | ||
"group": 0, | ||
"label_id": 4, | ||
"z_order": 1, | ||
"bbox": [1.0, 2.0, 3.0, 4.0] | ||
}, | ||
{ | ||
"id": 5, | ||
"type": "bbox", | ||
"attributes": { "a": 1.5, "b": "text" }, | ||
"group": 5, | ||
"label_id": null, | ||
"z_order": 0, | ||
"bbox": [5.0, 6.0, 7.0, 8.0] | ||
}, | ||
{ | ||
"id": 5, | ||
"type": "points", | ||
"attributes": { "x": 1, "y": "2" }, | ||
"group": 0, | ||
"label_id": 0, | ||
"points": [1.0, 2.0, 2.0, 0.0, 1.0, 1.0], | ||
"z_order": 4, | ||
"visibility": [2, 2, 2] | ||
}, | ||
{ | ||
"id": 5, | ||
"type": "mask", | ||
"attributes": { "x": 1, "y": "2" }, | ||
"group": 0, | ||
"label_id": 3, | ||
"rle": { "counts": "06", "size": [2, 3] }, | ||
"z_order": 2 | ||
} | ||
], | ||
"image": { "path": "100.jpg", "size": [10, 6] } | ||
}, | ||
{ | ||
"id": "21", | ||
"annotations": [ | ||
{ | ||
"id": 0, | ||
"type": "caption", | ||
"attributes": {}, | ||
"group": 0, | ||
"caption": "test" | ||
}, | ||
{ | ||
"id": 0, | ||
"type": "label", | ||
"attributes": {}, | ||
"group": 0, | ||
"label_id": 2 | ||
}, | ||
{ | ||
"id": 42, | ||
"type": "bbox", | ||
"attributes": {}, | ||
"group": 42, | ||
"label_id": 5, | ||
"z_order": 0, | ||
"bbox": [1.0, 2.0, 3.0, 4.0] | ||
} | ||
] | ||
} | ||
] | ||
} |
58 changes: 58 additions & 0 deletions
58
tests/assets/datumaro_dataset/diverse/annotations/val.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"info": {}, | ||
"categories": { | ||
"label": { | ||
"labels": [ | ||
{ "name": "cat0", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat1", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat2", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat3", "parent": "", "attributes": ["x", "y"] }, | ||
{ "name": "cat4", "parent": "", "attributes": ["x", "y"] } | ||
], | ||
"attributes": ["a", "b", "score"] | ||
}, | ||
"mask": { | ||
"colormap": [ | ||
{ "label_id": 0, "r": 0, "g": 0, "b": 0 }, | ||
{ "label_id": 1, "r": 128, "g": 0, "b": 0 }, | ||
{ "label_id": 2, "r": 0, "g": 128, "b": 0 }, | ||
{ "label_id": 3, "r": 128, "g": 128, "b": 0 }, | ||
{ "label_id": 4, "r": 0, "g": 0, "b": 128 } | ||
] | ||
}, | ||
"points": { | ||
"items": [ | ||
{ "label_id": 0, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 1, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 2, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 3, "labels": ["cat1", "cat2"], "joints": [[0, 1]] }, | ||
{ "label_id": 4, "labels": ["cat1", "cat2"], "joints": [[0, 1]] } | ||
] | ||
} | ||
}, | ||
"items": [ | ||
{ | ||
"id": "2", | ||
"annotations": [ | ||
{ | ||
"id": 11, | ||
"type": "polyline", | ||
"attributes": {}, | ||
"group": 0, | ||
"label_id": null, | ||
"points": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0], | ||
"z_order": 1 | ||
}, | ||
{ | ||
"id": 12, | ||
"type": "polygon", | ||
"attributes": {}, | ||
"group": 0, | ||
"label_id": null, | ||
"points": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0], | ||
"z_order": 4 | ||
} | ||
] | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.