Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tflite validation #438

Merged
merged 10 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docker/TensorFlowLite/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM ubuntu_for_dli

WORKDIR /root/
ARG TFLITE_VERSION=2.10.0
ARG TF_VERSION=2.13.0
RUN pip3 install --upgrade pip && \
pip3 install opencv-python requests PyYAML docker
RUN export LD_LIBRARY_PATH=/root/miniconda3/lib:${LD_LIBRARY_PATH}

WORKDIR /tmp/
COPY models.lst models.lst
RUN python3 ./open_model_zoo/tools/model_tools/downloader.py --name mobilenet-v1-1.0-224-tf

RUN pip3 install tensorflow==${TF_VERSION}
RUN pip3 install tflite==${TFLITE_VERSION}
RUN pip3 install -r ./dl-benchmark/src/model_converters/requirements.txt
RUN python3 ./open_model_zoo/tools/model_tools/converter.py --name mobilenet-v1-1.0-224-tf
RUN rm models.lst

WORKDIR /tmp/open_model_zoo/tools/accuracy_checker
COPY config_tf2.yml config_tf2.yml


RUN python3 setup.py install_core
RUN accuracy_check -c config_tf2.yml -m ../../../public -s sample

RUN rm config_tf2.yml

WORKDIR /tmp/
31 changes: 31 additions & 0 deletions docker/TensorFlowLite/config_tf2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
models:
- name: mobilenet-v1-1.0-224-tf
launchers:
- framework: tf_lite
device: CPU
model: mobilenet-v1-1.0-224-tf/mobilenet_v1_1.0_224.tflite
saved_model_dir: mobilenet-v1-1.0-224-tf/
adapter: classification
batch: 1

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: 224
- type: bgr_to_rgb
- type: normalization
mean: (127.5, 127.5, 127.5)
std: (127.5, 127.5, 127.5)

metrics:
- type: accuracy
top_k: 1
36 changes: 18 additions & 18 deletions results/tflite_models_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
Model | Availability in OMZ (2023.03.10) | Availability in the validation table |
-|-|-|
densenet-121|+-|+|
googlenet-v1-tf|+-|-|
googlenet-v2-tf|+-|-|
googlenet-v3|+-|-|
googlenet-v1-tf|+-|+|
googlenet-v2-tf|+-|+|
googlenet-v3|+-|+|
googlenet-v4-tf|+-|+|
mobilenet-v1-1.0-224-tf|+-|+|
mobilenet-v2-1.0-224|+-|+|
Expand Down Expand Up @@ -47,21 +47,21 @@ lite-model_mobilenet_v1_100_224_uint8_1.tflite|+ ([link][mobilenet_v1_100_224_ui
lite-model_mobilenet_v2_100_224_uint8_1.tflite|+ ([link][mobilenet_v2_100_224_uint8_1])|+|
lite-model_mobilenet_v3_small_100_224_uint8_1.tflite|+ ([link][mobilenet_v3_small_100_224_uint8_1])|+|
lite-model_mobilenet_v3_large_100_224_uint8_1.tflite|+ ([link][mobilenet_v3_large_100_224_uint8_1])|+|
efficientnet_lite0_fp32_2.tflite|+ ([link][efficientnet_lite0_fp32_2])|-|
efficientnet_lite1_fp32_2.tflite|+ ([link][efficientnet_lite1_fp32_2])|-|
efficientnet_lite2_fp32_2.tflite|+ ([link][efficientnet_lite2_fp32_2])|-|
efficientnet_lite3_fp32_2.tflite|+ ([link][efficientnet_lite3_fp32_2])|-|
efficientnet_lite4_fp32_2.tflite|+ ([link][efficientnet_lite4_fp32_2])|-|
lite-efficientnet_lite0_uint8_2.tflite|+ ([link][efficientnet_lite0_uint8_2])|-|
lite-efficientnet_lite1_uint8_2.tflite|+ ([link][efficientnet_lite1_uint8_2])|-|
lite-efficientnet_lite2_uint8_2.tflite|+ ([link][efficientnet_lite2_uint8_2])|-|
lite-efficientnet_lite3_uint8_2.tflite|+ ([link][efficientnet_lite3_uint8_2])|-|
lite-efficientnet_lite4_uint8_2.tflite|+ ([link][efficientnet_lite4_uint8_2])|-|
efficientnet_lite0_int8_2.tflite|+ ([link][efficientnet_lite0_int8_2])|-|
efficientnet_lite1_int8_2.tflite|+ ([link][efficientnet_lite1_int8_2])|-|
efficientnet_lite2_int8_2.tflite|+ ([link][efficientnet_lite2_int8_2])|-|
efficientnet_lite3_int8_2.tflite|+ ([link][efficientnet_lite3_int8_2])|-|
efficientnet_lite4_int8_2.tflite|+ ([link][efficientnet_lite4_int8_2])|-|
efficientnet_lite0_fp32_2.tflite|+ ([link][efficientnet_lite0_fp32_2])|+|
efficientnet_lite1_fp32_2.tflite|+ ([link][efficientnet_lite1_fp32_2])|+|
efficientnet_lite2_fp32_2.tflite|+ ([link][efficientnet_lite2_fp32_2])|+|
efficientnet_lite3_fp32_2.tflite|+ ([link][efficientnet_lite3_fp32_2])|+|
efficientnet_lite4_fp32_2.tflite|+ ([link][efficientnet_lite4_fp32_2])|+|
lite-efficientnet_lite0_uint8_2.tflite|+ ([link][efficientnet_lite0_uint8_2])|+|
lite-efficientnet_lite1_uint8_2.tflite|+ ([link][efficientnet_lite1_uint8_2])|+|
lite-efficientnet_lite2_uint8_2.tflite|+ ([link][efficientnet_lite2_uint8_2])|+|
lite-efficientnet_lite3_uint8_2.tflite|+ ([link][efficientnet_lite3_uint8_2])|+|
lite-efficientnet_lite4_uint8_2.tflite|+ ([link][efficientnet_lite4_uint8_2])|+|
efficientnet_lite0_int8_2.tflite|+ ([link][efficientnet_lite0_int8_2])|+|
efficientnet_lite1_int8_2.tflite|+ ([link][efficientnet_lite1_int8_2])|+|
efficientnet_lite2_int8_2.tflite|+ ([link][efficientnet_lite2_int8_2])|+|
efficientnet_lite3_int8_2.tflite|+ ([link][efficientnet_lite3_int8_2])|+|
efficientnet_lite4_int8_2.tflite|+ ([link][efficientnet_lite4_int8_2])|+|

**Note:** inference implementation for EfficientNet-models
supported for batch size that equals 1.
Expand Down
Loading