Skip to content

Commit

Permalink
Added demo for MXNet. And fix accuracy-checker build in docker-file
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav-Denisov committed Sep 25, 2024
1 parent a845190 commit 2ccd06f
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 1 deletion.
17 changes: 17 additions & 0 deletions demo/accuracy_checker_configs/MXNet.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Tests>
<Test>
<Model>
<Task>classification</Task>
<Name>samplenet-0000</Name>
<Precision>FP32</Precision>
<SourceFramework>MXNet</SourceFramework>
<Directory>/media/models</Directory>
</Model>
<Parameters>
<InferenceFramework>MXNet</InferenceFramework>
<Device>CPU</Device>
<Config>{CONFIG_PATH}</Config>
</Parameters>
</Test>
</Tests>
33 changes: 33 additions & 0 deletions demo/accuracy_checker_configs/MXNet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
models:
- name: SampLeNet_example
launchers:
- framework: mxnet
device: CPU
model: samplenet-0000.params
adapter: classification
inputs:
- name: 'data'
type: INPUT
shape: 3, 32, 32

datasets:
- name: sample_dataset
data_source: sample_dataset/test
annotation_conversion:
converter: cifar
data_batch_file: cifar-10-batches-py/test_batch
convert_images: True
converted_images_dir: sample_dataset/test
num_classes: 10

preprocessing:
- type: resize
size: 32
- type: bgr_to_rgb
- type: normalization
mean: (125.307, 122.961, 113.8575)
std: (51.5865, 50.847, 51.255)

metrics:
- type: accuracy
top_k: 1
35 changes: 35 additions & 0 deletions demo/benchmark_configs/MXNet.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Tests>
<Test>
<Model>
<Task>classification</Task>
<Name>SampleNet</Name>
<Precision>FP32</Precision>
<SourceFramework>MXNet</SourceFramework>
<ModelPath>/media/models/samplenet-symbol.json</ModelPath>
<WeightsPath>/media/models/samplenet-0000.params</WeightsPath>
</Model>
<Dataset>
<Name>ImageNET</Name>
<Path>/tmp/{DLI_DATASET_REPO_NAME}/Datasets/ImageNET/</Path>
</Dataset>
<FrameworkIndependent>
<InferenceFramework>MXNet</InferenceFramework>
<BatchSize>1</BatchSize>
<Device>CPU</Device>
<IterationCount>10</IterationCount>
<TestTimeLimit>0</TestTimeLimit>
</FrameworkIndependent>
<FrameworkDependent>
<Mode>Sync</Mode>
<InputName>data</InputName>
<InputShape>1 3 32 32</InputShape>
<Hybridize>True</Hybridize>
<Normalize>True</Normalize>
<Mean></Mean>
<Std></Std>
<ChannelSwap></ChannelSwap>
<Quantization></Quantization>
</FrameworkDependent>
</Test>
</Tests>
2 changes: 1 addition & 1 deletion demo/linux.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

supported_frameworks="OpenVINO_DLDT ONNXRuntime"
supported_frameworks="OpenVINO_DLDT MXNet ONNXRuntime"

usage() {
echo "Usage: $0 [-l LOGIN] [-p PASSWORD] [-f FRAMEWORK] [-d GIT_LINK_TO_DATASET]"
Expand Down
1 change: 1 addition & 0 deletions docker/MXNet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ RUN pip uninstall -y numpy && pip install numpy==1.23.1
# Download Accuracy Checker
WORKDIR /tmp/
WORKDIR /tmp/open_model_zoo/tools/accuracy_checker
RUN python3 setup.py install_core
RUN /bin/bash -c 'accuracy_check -c /tmp/dl-benchmark/docker/MXNet/config.yml -m data/test_models -s sample'
WORKDIR /tmp/

0 comments on commit 2ccd06f

Please sign in to comment.