Skip to content
This repository was archived by the owner on Aug 28, 2023. It is now read-only.

Commit 2fc9d13

Browse files
authored
[65311] Transition to Datumaro detection heuristics (#29)
1 parent 2f2653e commit 2fc9d13

26 files changed

+120
-68
lines changed

client/e2e/resources.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2663,7 +2663,7 @@
26632663
}
26642664
},
26652665
"cocoDataset": {
2666-
"path": "datasets/coco200.zip",
2666+
"path": "datasets_v2/coco200.zip",
26672667
"name": "coco200Dataset",
26682668
"format": "Coco",
26692669
"type": "dataset",
@@ -2751,7 +2751,7 @@
27512751
}
27522752
},
27532753
"LFWDataset": {
2754-
"path": "datasets/LFW.tar.gz",
2754+
"path": "datasets_v2/LFW.zip",
27552755
"name": "LFWDataset",
27562756
"type": "dataset",
27572757
"accuracyData": {
@@ -2769,7 +2769,7 @@
27692769
}
27702770
},
27712771
"WiderFaceDataset": {
2772-
"path": "datasets/WIDER_val.zip",
2772+
"path": "datasets_v2/WIDER_val.zip",
27732773
"name": "WIDER FACE",
27742774
"type": "dataset",
27752775
"accuracyData": {

client/e2e/src/accuracy-reports.e2e-spec.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ describe('UI tests on Accuracy Reports', () => {
4646
imageNetNotAnnotated.name = testUtils.helpers.generateName();
4747
await testUtils.uploadDataset(datasetFileVOC);
4848
await testUtils.uploadDataset(datasetFileImageNet);
49-
await testUtils.uploadDataset(dataSetFileSemantic);
50-
await testUtils.uploadDataset(imageNetNotAnnotated);
49+
// TODO: 83042
50+
// await testUtils.uploadDataset(dataSetFileSemantic);
51+
// await testUtils.uploadDataset(imageNetNotAnnotated);
5152

5253
if (browser.params.isDevCloud) {
5354
jasmine.DEFAULT_TIMEOUT_INTERVAL *= 2.5;
@@ -179,7 +180,7 @@ describe('UI tests on Accuracy Reports', () => {
179180
expect(await TestUtils.getAllElementsByDataTestId('predictions-table').count()).toBeGreaterThan(1);
180181
});
181182

182-
// 70558
183+
// TODO: 70558
183184
xit(
184185
'should download a semantic segmentation model (deeplabv3), ' +
185186
'int8 calibration, check that predictions comparison is available and that tensor comparison is available, ' +
@@ -270,7 +271,7 @@ describe('UI tests on Accuracy Reports', () => {
270271
}
271272
);
272273

273-
// 70558
274+
// TODO: 70558, 83248
274275
xit(
275276
'should download a semantic segmentation model (deeplabv3), not-annotated dataset' +
276277
'int8 calibration, check that predictions comparison is available and that tensor comparison is available, ' +
@@ -322,7 +323,7 @@ describe('UI tests on Accuracy Reports', () => {
322323
}
323324
);
324325

325-
// 73953
326+
// TODO: 73953, 83248
326327
xit(
327328
'should create a project with a generic model, calibrate it, configure accuracy (OD), ' +
328329
'create accuracy report (predictions comparison)',
@@ -373,7 +374,7 @@ describe('UI tests on Accuracy Reports', () => {
373374
}
374375
);
375376

376-
// 73953
377+
// TODO: 73953, 83248
377378
xit(
378379
'should create a project with a generic model and not-annotated dataset, calibrate, ' +
379380
'create another project with annotated dataset, ' +
@@ -447,7 +448,7 @@ describe('UI tests on Accuracy Reports', () => {
447448
}
448449
);
449450

450-
// 73953
451+
// TODO: 73953, 83248
451452
xit(
452453
'should create a project with a classification model & ' +
453454
'not-annotated dataset, calibrate it, create accuracy report (predictions comparison), ' +

client/e2e/src/gan.e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ xdescribe('Instance segmentation tests', () => {
7272
await calibrationUtils.runCalibrationWithAccuracyCheck(modelFile, dataSetFileSuperRes, InferenceType.CPU, true);
7373
});
7474

75-
// 43320
75+
// TODO: 43320
7676
xit('Upload GAN model (tensor_layer_srgan), check accuracy, run calibration', async () => {
7777
const modelFile = browser.params.precommit_scope.resources.ganModels.tensorLayerSrgan;
7878
modelFile.name = testUtils.helpers.generateName();

client/e2e/src/inference-test-image.e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ describe('UI tests on Running inference', () => {
122122
await visualizeInferenceResultPage.checkImageLabel(0.9);
123123
});
124124

125-
xit('should create project with Semantic Segmentation model, upload image, test, check for predictions', async () => {
125+
it('should create project with Semantic Segmentation model, upload image, test, check for predictions', async () => {
126126
const model = { name: 'semantic-segmentation-adas-0001', framework: 'openvino' };
127127
const imageFile = browser.params.precommit_scope.resources.testImages.semanticSegmImage;
128128
const inferenceTarget = InferenceType.CPU;

client/e2e/src/int8-basic-cases.e2e-spec.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('UI tests on Running Int8 Calibration', () => {
1616
const datasetFileImageNet = browser.params.precommit_scope.resources.smallImageNetDataset;
1717
const datasetWiderFace = browser.params.precommit_scope.resources.WiderFaceDataset;
1818
const notAnnotatedDataset = browser.params.precommit_scope.resources.imageNetNotAnnotated;
19-
// 73948
19+
// TODO: 73948
2020
// const datasetCityScapes = browser.params.precommit_scope.resources.CityscapesDataset;
2121

2222
beforeAll(async () => {
@@ -35,8 +35,9 @@ describe('UI tests on Running Int8 Calibration', () => {
3535
await testUtils.uploadDataset(datasetFileVOC);
3636
await testUtils.uploadDataset(datasetFileImageNet);
3737
await testUtils.uploadDataset(datasetWiderFace);
38-
await testUtils.uploadDataset(notAnnotatedDataset);
39-
// 73948
38+
// TODO: 83248
39+
// await testUtils.uploadDataset(notAnnotatedDataset);
40+
// TODO: 73948
4041
// await testUtils.uploadDataset(datasetCityScapes);
4142
});
4243

@@ -46,14 +47,14 @@ describe('UI tests on Running Int8 Calibration', () => {
4647
await testUtils.modelManagerPage.goToModelManager();
4748
});
4849

49-
// 76569
50+
// TODO: 76569
5051
xit('Upload FP32 Mobilenet SSD Lite V2, use VOC dataset, infer (CPU), int8 calibrate (batch 1), infer (CPU)', async () => {
5152
const modelFile = browser.params.precommit_scope.resources.ODModels.ssdliteMobileNetV2;
5253
const inferenceTarget = InferenceType.CPU;
5354
await calibrationUtils.runInt8PipelineThroughUpload(modelFile, datasetFileVOC, inferenceTarget);
5455
});
5556

56-
// 76569
57+
// TODO: 76569, 83248
5758
xit(
5859
'Upload FP32 Mobilenet SSD Lite V2, use Not Annotated dataset, ' +
5960
'infer (CPU), int8 calibrate - Simplified Mode, infer (CPU)',
@@ -64,7 +65,8 @@ describe('UI tests on Running Int8 Calibration', () => {
6465
}
6566
);
6667

67-
it(
68+
// TODO: 83248
69+
xit(
6870
'Should upload original Caffe model, convert to IR V10, run inference, run Int-8 Tune with Not Annotated dataset, ' +
6971
'Simplified Mode',
7072
async () => {
@@ -74,7 +76,8 @@ describe('UI tests on Running Int8 Calibration', () => {
7476
}
7577
);
7678

77-
it(
79+
// TODO: 83248
80+
xit(
7881
'Select squeezenet1.1 from table + Not Annotated dataset, infer (CPU), int8 Simplified Mode, ' +
7982
'check wait message ',
8083
async () => {

client/e2e/src/model-visualization.e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ describe('UI tests on Model visualization', () => {
137137
);
138138
});
139139

140-
// 75981
140+
// TODO: 75981
141141
xit('should check visualization GAN single-image-super-resolution-1032 model', async () => {
142142
const model = { name: 'single-image-super-resolution-1032', framework: 'openvino' };
143143
const imageFile = browser.params.precommit_scope.resources.testImages.streetImage;

client/e2e/src/not-annotated-model-visualization.e2e-spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import { VisualizeInferenceResultPage } from './pages/inference-test-image.po';
88
import { TargetMachines, DevCloudTargets } from './pages/target-machines.po';
99
import { Helpers } from './pages/helpers';
1010

11-
describe('UI tests on visualization for model with not annotated dataset', () => {
11+
// TODO: 83248
12+
xdescribe('UI tests on visualization for model with not annotated dataset', () => {
1213
const testUtils = new TestUtils();
1314
const inferenceUtils = new InferenceUtils(testUtils);
1415
const visualizeInferenceResultPage = new VisualizeInferenceResultPage();

client/e2e/src/parent-predictions-visualization.e2e-spec.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ describe('UI tests on parent predictions visualization', () => {
4747
dataSetFileSemantic.name = testUtils.helpers.generateName();
4848
await testUtils.uploadDataset(datasetFileVOC);
4949
await testUtils.uploadDataset(datasetFileImageNet);
50-
await testUtils.uploadDataset(dataSetFileSemantic);
50+
// TODO: 83248
51+
// await testUtils.uploadDataset(dataSetFileSemantic);
5152
});
5253

5354
beforeEach(async () => {
@@ -151,7 +152,7 @@ describe('UI tests on parent predictions visualization', () => {
151152
).toBeTruthy();
152153
});
153154

154-
// 70558
155+
// TODO: 70558
155156
xit(
156157
'should download an instance segmentation model (deeplabv3), ' +
157158
'int8 calibration, check that predictions comparison is not available and that tensor comparison is available',

client/e2e/src/semantic-segmentation.e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ xdescribe('Semantic segmentation tests', () => {
6767
console.log(`Accuracy check end: ${{ accuracy }}`);
6868
});
6969

70-
// 70558
70+
// TODO: 70558
7171
xit('Upload instance segmentation model (deeplabv3), int8 calibration, check accuracy', async () => {
7272
const model = {
7373
name: 'deeplabv3',

client/e2e/src/upload-dataset.e2e-spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ describe('UI tests on Uploading Datasets', () => {
109109
}
110110
);
111111

112-
it(
112+
// TODO: Rework test to expect an error
113+
xit(
113114
'should import COCO dataset with unrelated files and folders inside, ' + 'check that it is uploaded and delete it',
114115
async () => {
115116
const datasetFile = browser.params.precommit_scope.resources.cocoWithUnrelatedFiles;

config/constants.py

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
VGGFACE2_BBOX_LENGTH = 5
6060
LNDREID_LANDMARK_LENGTH = 11
6161
ORIGINAL_FOLDER = 'original'
62+
DATASET_REPORTS_FOLDER = UPLOAD_FOLDER_DATASETS / 'reports'
6263

6364
DEFAULT_LOG_FILE = os.path.join(ROOT_FOLDER, 'server.log') if SERVER_MODE == 'production' else None
6465
LOG_FILE = get_env_var(name='WB_LOG_FILE', default=DEFAULT_LOG_FILE)

docker/dockerfiles/Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ RUN apt update && \
8484
# For E2E in non-headless mode
8585
xvfb \
8686
gnupg2 \
87-
build-essential && \
87+
build-essential \
88+
# for running packages from git commits \
89+
git && \
8890
apt clean && \
8991
rm -rf /var/lib/apt/lists/*
9092

requirements/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cffi==1.15.0
99
chardet==4.0.0
1010
click==8.0.0
1111
cryptography==3.4.8
12-
datumaro==0.2.1
12+
git+https://github.com/openvinotoolkit/datumaro.git@develop#egg=datumaro
1313
defusedxml==0.7.1
1414
distlib==0.3.2
1515
dnspython==1.16.0
@@ -32,6 +32,7 @@ lxml==4.6.5
3232
Mako==1.1.5
3333
MarkupSafe==2.0.1
3434
monotonic==1.6
35+
numpy==1.19.5
3536
packaging==21.3
3637
paramiko==2.7.2
3738
pg8000==1.21.1

wb/main/console_tool_wrapper/datumaro_tool/tool.py

+21-6
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,26 @@ def set_conversion(self, input_format: DatasetTypesEnum, output_format: DatasetT
3535
self.set_parameter('--input-format', input_format.value, ConsoleParametersTypes.dataset_format)
3636
self.set_parameter('--output-format', output_format.value, ConsoleParametersTypes.dataset_format)
3737

38-
def set_input_output_paths(self, input_path: str, output_path: Optional[str]):
39-
self.set_parameter('--input-path', input_path, ConsoleParametersTypes.path)
40-
if output_path:
41-
self.set_parameter('--output-dir', output_path, ConsoleParametersTypes.path)
38+
def _set_path(self, param_name: Optional[str], path: str):
39+
self.set_parameter(param_name, path, ConsoleParametersTypes.path)
4240

43-
def enable_image_copy(self):
41+
def set_input_path(self, path: str):
42+
self._set_path('--input-path', path)
43+
44+
def set_output_path(self, path: str):
45+
self._set_path('--output-dir', path)
46+
47+
def set_report_path(self, path: str):
48+
self._set_path('--json-report', path)
49+
50+
def set_target(self, path: str):
51+
self._set_path('', path)
52+
53+
def _set_flag(self, param_name: str):
54+
self.set_parameter(f'--{param_name}', True, ConsoleParametersTypes.flag)
55+
56+
def enable_image_save(self):
57+
self._set_flag('save-images')
58+
59+
def add_separator(self):
4460
self.set_parameter('--', True, ConsoleParametersTypes.flag)
45-
self.set_parameter('--save-images', True, ConsoleParametersTypes.flag)

wb/main/dataset_utils/dataset_adapters.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -758,13 +758,17 @@ class VGGFace2LandmarkCustomAdapter(VGGFace2BaseAdapter):
758758
class WiderFaceBaseAdapter(BaseImageDatasetAdapter):
759759

760760
def get_images_dir(self) -> Optional[Path]:
761-
for item in self.dataset_path.iterdir():
762-
if item.is_dir() and all(path.is_dir()
763-
and all(subpath.suffix[1:] in ALLOWED_EXTENSIONS_IMG for subpath in path.iterdir())
764-
for path in item.iterdir()):
761+
dirs = self.dataset_path.glob('**/*')
762+
for item in dirs:
763+
if item.is_dir() and item.name == 'images' and all(self.is_event_class_dir(path)
764+
for path in item.iterdir()):
765765
return item
766766
return None
767767

768+
@staticmethod
769+
def is_event_class_dir(path: Path) -> bool:
770+
return path.is_dir() and all(subpath.suffix[1:] in ALLOWED_EXTENSIONS_IMG for subpath in path.iterdir())
771+
768772
def get_task_specific_constants(self) -> dict:
769773
raise NotImplementedError
770774

wb/main/enumerates.py

+1
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ class ModelShapeTypeEnum(enum.Enum):
664664

665665
class DatumaroModesEnum(enum.Enum):
666666
convert = 'convert'
667+
detect_format = 'detect-format'
667668

668669

669670
class TokenizerTypeEnum(enum.Enum):

wb/main/jobs/datasets/convert_dataset_job.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,16 @@ def run_conversion(self, original_dataset: DatasetsModel,
8787
dataset_format: DatasetTypesEnum):
8888
tool = DatumaroTool()
8989
tool.set_mode(DatumaroModesEnum.convert)
90-
tool.set_input_output_paths(original_dataset.path, result_dataset.path)
90+
tool.set_input_path(original_dataset.path)
91+
tool.set_output_path(result_dataset.path)
9192
tool.set_conversion(dataset_format, self._format_conversion_map[dataset_format])
92-
tool.enable_image_copy()
93+
tool.add_separator()
94+
tool.enable_image_save()
9395

9496
runner = LocalRunner(tool)
9597
return_code, _ = runner.run_console_tool()
9698
if return_code:
97-
raise DatumaroError('Error during Datumaro conversion.')
99+
raise DatumaroError('Error during Datumaro conversion.', self.job_id)
98100

99101
result_format = self._format_compatibility_map.get(self._format_conversion_map[dataset_format],
100102
self._format_conversion_map[dataset_format])

0 commit comments

Comments
 (0)