DeepLabV3+ with a MobileNetEdgeTPUV2-XS backbone is a semantic segmentation network. Given an RGB image, it predicts, for every pixel, which of 32 ADE20K classes that pixel belongs to. The variant in this repository uses a "fused argmax" graph: the class-index computation (bilinear resize + argmax) is merged into the TFLite graph, so the model directly outputs a class-index map and no post-processing argmax is required.
This repository contains a pre-quantized int8 TFLite model, taken as-is from the original TensorFlow EdgeTPU vision release, compiled by NXP for:
It also contains the scripts used to regenerate these assets (recipe.sh) and an inference example
(example.py).
This is a pre-quantized, compiled version of the DeepLabV3+ MobileNetEdgeTPUV2-XS (fused argmax) model from the TensorFlow Models EdgeTPU vision project, optimized for NXP i.MX platforms.
This model is a derivative work with the following changes from the original:
lf-6.18.20_2.0.0 and lf-6.18.37_2.1.0.3.1.3, 3.2.1
and 3.2.3.Original model available at: https://github.com/tensorflow/models/tree/master/official/projects/edgetpu/vision.
| Information | Value |
|---|---|
| Input shape | RGB image (1, 512, 512, 3), int8 [-128, 127] (subtract 128 from uint8 RGB) |
| Input example | |
| Output shape | (1, 512, 512), float32 class-index map, values 0-31 (argmax + squeeze fused into the graph; no additional argmax needed) |
| Output example | |
| FLOPS | Not published by the original authors |
| Number of parameters | 3.6M |
| File size (int8) | 3.75 MB (3,934,592 bytes, assets/quantized_tflite_model/deeplabv3plus_mobilenet_edgetpuv2_xs_fused_quant.tflite) |
| Source framework | TensorFlow |
All models run with the eIQ LiteRT (TensorFlow Lite) runtime and the corresponding NPU delegate (VX for i.MX 8M Plus, Ethos-U for i.MX 93, Neutron for i.MX 95 / i.MX 952). The same information is captured in release_manifest.json.
| Asset | Runtime | Precision | HW target | BSP & SDK versions | Link to asset |
|---|---|---|---|---|---|
| i.MX 8M Plus Quantized | LiteRT | INT8 | i.MX 8M Plus | - | Download |
| i.MX 93 Precompiled | LiteRT | INT8 | i.MX 93 | BSP lf-6.18.20_2.0.0, VELA_TAG = lf-6.18.20_2.0.0 | Download |
| i.MX 93 Precompiled | LiteRT | INT8 | i.MX 93 | BSP lf-6.18.37_2.1.0, VELA_TAG = lf-6.18.37_2.1.0 | Download |
| i.MX 95 Precompiled | LiteRT | INT8 | i.MX 95 | BSP lf-6.18.20_2.0.0, Neutron SDK v3.1.3 | Download |
| i.MX 95 Precompiled | LiteRT | INT8 | i.MX 95 | BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.1 | Download |
| i.MX 95 Precompiled | LiteRT | INT8 | i.MX 95 | BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.3 | Download |
| i.MX 952 Precompiled | LiteRT | INT8 | i.MX 952 | BSP lf-6.18.20_2.0.0, Neutron SDK v3.1.3 | Download |
| i.MX 952 Precompiled | LiteRT | INT8 | i.MX 952 | BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.1 | Download |
| i.MX 952 Precompiled | LiteRT | INT8 | i.MX 952 | BSP lf-6.18.37_2.1.0, Neutron SDK v3.2.3 | Download |
The i.MX 8M Plus Quantized asset (assets/imx8mplus/) is identical to the hardware-independent
reference model in assets/quantized_tflite_model/ (same file, provided for host/x86 inference and as
the input to the Vela and Neutron compilation steps below).
This model inherits all limitations from the original DeepLabV3+ MobileNetEdgeTPUV2-XS model. Additional limitations:
The model was trained and evaluated by the TensorFlow EdgeTPU vision team on the ADE20K 32-class subset of the ADE20K dataset (dataset license: BSD 3-Clause). NXP did not retrain or re-quantize the model; the weights are used as released by the original authors.
The recipe installs the eIQ Neutron SDK from the NXP eIQ PyPI Distribution Portal. Configure pip once to use it:
python -m pip config --user set global.index https://eiq.nxp.com/repository
python -m pip config --user set global.index-url https://eiq.nxp.com/repository
python -m pip config --user set global.trusted-host eiq.nxp.com
python -m pip config --user set global.extra-index-url https://pypi.org/simple
python -m pip config --user set global.find-links https://eiq.nxp.com/repository/
Use recipe.sh to download the original model and compile it for the target platforms. The Vela tag
and Neutron SDK version are optional positional arguments:
# Defaults: Vela lf-6.18.20_2.0.0, Neutron SDK 3.2.3
bash recipe.sh
# Other toolchain versions
bash recipe.sh lf-6.18.37_2.1.0 3.2.1
This generates:
assets/quantized_tflite_model/deeplabv3plus_mobilenet_edgetpuv2_xs_fused_quant.tflite - the
downloaded int8 model (also used for i.MX 8M Plus and for host/x86 inference)assets/imx93/<VELA_TAG>/deeplabv3plus_mobilenet_edgetpuv2_xs_fused_quant_vela.tflite - Vela-compiled
for i.MX 93assets/imx95/<NEUTRON_SDK_VERSION>/deeplabv3plus_mobilenet_edgetpuv2_xs_fused_quant_converted.tfliteassets/imx952/<NEUTRON_SDK_VERSION>/deeplabv3plus_mobilenet_edgetpuv2_xs_fused_quant_converted.tfliteRun inference on a sample image using example.py (run on a PC), after installing the dependencies
from requirements.txt:
python3 example.py \
--model assets/imx95/3.2.1/deeplabv3plus_mobilenet_edgetpuv2_xs_fused_quant_converted.tflite \
--input example_input.jpg \
--output example_output.jpg
The output is a segmentation overlay saved as example_output.jpg. The raw output tensor already
contains class indices (argmax and squeeze are fused into the graph) - do not apply an additional
argmax over the class dimension.
To run the model on an i.MX MPU target with the NPU delegates, see the i.MX Machine Learning User Guide.
The scripts in this repository are released by NXP under the MIT License (see LICENSE). The model weights are released under the original Apache License 2.0 (see MODEL_LICENSE).
If you use this model, please cite both this work and the original model:
@inproceedings{zhou2017scene,
title={Scene parsing through ade20k dataset},
author={Zhou, Bolei and Zhao, Hang and Puig, Xavier and Fidler, Sanja and Barriuso, Adela and Torralba, Antonio},
booktitle={2017 IEEE conference on computer vision and pattern recognition (CVPR)},
pages={5122--5130},
year={2017},
organization={IEEE}
}
@inproceedings{chen2018encoder,
title={Encoder-decoder with atrous separable convolution for semantic image segmentation},
author={Chen, Liang-Chieh and Zhu, Yukun and Papandreou, George and Schroff, Florian and Adam, Hartwig},
booktitle={European conference on computer vision},
pages={833--851},
year={2018},
organization={Springer}
}