From 3e33d6e0d43f0e53241003536599eec92c05b62c Mon Sep 17 00:00:00 2001 From: teja1412-hub <126779948+teja1412-hub@users.noreply.github.com> Date: Fri, 29 Mar 2024 18:41:17 +0530 Subject: [PATCH] [GSoc2024] Added labels in dataset_meta.json of widerface_dataset to solve import issue #7258 of opencv/cvat (#36) * Add labels in dataset_meta.json of widerface_dataset * Update dataset_meta.json, relevant tests in test_wilderface_format.py for wilderface_dataset --- tests/assets/widerface_dataset/dataset_meta.json | 2 +- tests/test_widerface_format.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/assets/widerface_dataset/dataset_meta.json b/tests/assets/widerface_dataset/dataset_meta.json index 0983e2f489..55b4b8b4c1 100644 --- a/tests/assets/widerface_dataset/dataset_meta.json +++ b/tests/assets/widerface_dataset/dataset_meta.json @@ -1,3 +1,3 @@ { -"label_map": {"0": "Parade", "1": "Handshaking"} +"labels": ["face"] } diff --git a/tests/test_widerface_format.py b/tests/test_widerface_format.py index 974d72c370..926985579f 100644 --- a/tests/test_widerface_format.py +++ b/tests/test_widerface_format.py @@ -430,8 +430,8 @@ def test_can_import(self): "pose": "0", "invalid": "0", }, + label=0, ), - Label(0), ], ), DatasetItem( @@ -452,6 +452,7 @@ def test_can_import(self): "pose": "0", "invalid": "0", }, + label=0, ), Bbox( 5, @@ -466,8 +467,8 @@ def test_can_import(self): "pose": "0", "invalid": "0", }, + label=0, ), - Label(1), ], ), DatasetItem( @@ -488,6 +489,7 @@ def test_can_import(self): "pose": "2", "invalid": "0", }, + label=0, ), Bbox( 3, @@ -502,6 +504,7 @@ def test_can_import(self): "pose": "0", "invalid": "0", }, + label=0, ), Bbox( 5, @@ -516,12 +519,12 @@ def test_can_import(self): "pose": "2", "invalid": "0", }, + label=0, ), - Label(0), ], ), ], - categories=["Parade", "Handshaking"], + categories=["face"], ) dataset = Dataset.import_from(DUMMY_DATASET_DIR, "wider_face")