EfficientDet [2] is a family of scalable and efficient object detection models. It is built on top of the EfficientNet [3] backbone and introduces a weighted bi-directional feature pyramid network (BiFPN) for fast, multi-scale feature fusion, together with a compound scaling method that jointly scales the backbone, feature network, and prediction heads.
EfficientDet-lite0 is the smallest, mobile-friendly member of the family, designed for fast object detection on resource-constrained edge devices. Given a 320x320 RGB image, it detects objects from 80 COCO categories and returns decoded, non-maximum-suppressed bounding boxes, classes and scores directly from the graph.
This repository contains the EfficientDet-lite0 model quantized to int8 and compiled for NXP i.MX 8M Plus,
i.MX 93, i.MX 95, and i.MX 952 processors. It also contains the script used to regenerate these assets
(recipe.sh) and an inference example (example.py).
This is a quantized and compiled version of EfficientDet-lite0, optimized for NXP i.MX 8M Plus, i.MX 93, i.MX 95, and i.MX 952 processors.
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. ~97.7% of
operators map to the NPU; the remaining 6 operators (the in-graph detection post-processing / NMS custom op
and surrounding dequantize/resize ops) run on the CPU.3.1.3, 3.2.1, and
3.2.3.Original model available at: EfficientDet (google/automl).
| Information | Value |
|---|---|
| Input shape | RGB image (1, 320, 320, 3), uint8 |
| Input example | (Image source, Public domain) |
| Output shape | Four float32 tensors: boxes (1, 25, 4), classes (1, 25), scores (1, 25), count (1,). Boxes are normalized [ymin, xmin, ymax, xmax] in the [0, 1] range and must be scaled back to the original image size (see example.py). |
| Output example | |
| Output labels | 80 COCO classes, see coco_labels_list.txt |
| FLOPS | 1.9 G |
| Number of parameters | 3.2 M |
| File size (int8) | 4.35 MB (assets/quantized_tflite_model/efficientdet-lite0_quant_int8.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 assets/imx8mplus/ file is identical (same sha256) to the hardware-independent int8 model at
assets/quantized_tflite_model/efficientdet-lite0_quant_int8.tflite, which is also provided for host (x86)
inference and as the input to the Vela/Neutron compilers.
This model inherits all limitations from the original EfficientDet-lite0 model. Additional limitations:
The model was trained by the original authors on the COCO dataset [1], according to the EfficientDet source repository. No NXP-side training or retraining is performed; the int8 weights are downloaded as-is from the pre-quantized Kaggle checkpoint.
This repository does not include an evaluation script. The upstream EfficientDet-lite0 int8 checkpoint was evaluated by the original authors on the COCO validation set; see the EfficientDet source repository for details.
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/
To download the pre-quantized int8 model and compile it for all supported platforms, run:
bash recipe.sh
The script takes two optional positional arguments:
bash recipe.sh [IMX_ETHOS_U_VELA_TAG] [EIQ_NEUTRON_SDK_VERSION]
defaulting to lf-6.18.20_2.0.0 and 3.2.3 respectively. The generated files are:
assets/quantized_tflite_model/efficientdet-lite0_quant_int8.tflite - hardware-independent int8 model,
downloaded from Kaggle (also used for i.MX 8M Plus, see assets/imx8mplus/)assets/imx93/<IMX_ETHOS_U_VELA_TAG>/efficientdet-lite0_quant_int8_vela.tflite - Vela-compiled for i.MX 93assets/imx95/<EIQ_NEUTRON_SDK_VERSION>/efficientdet-lite0_quant_int8_converted.tflite - Neutron-converted
for i.MX 95assets/imx952/<EIQ_NEUTRON_SDK_VERSION>/efficientdet-lite0_quant_int8_converted.tflite - Neutron-converted
for i.MX 952An example of how to use the model is in example.py (run on a PC):
# Run on PC:
python example.py -m assets/quantized_tflite_model/efficientdet-lite0_quant_int8.tflite \
-i example_input.jpg -o example_output.jpg
Please refer to the i.MX Machine Learning User Guide for details on how to run the models on each platform.
Full on-device examples leveraging GStreamer/NNStreamer can be found in nxp-nnstreamer-examples on GitHub.
This model is released under the Apache License 2.0 (see LICENSE), the same license as the original EfficientDet (google/automl) model.
If you use this model, please cite both this work and the original model:
@inproceedings{tan2020efficientdet,
title={EfficientDet: Scalable and Efficient Object Detection},
author={Tan, Mingxing and Pang, Ruoming and Le, Quoc V},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
year={2020}
}
@inproceedings{tan2019efficientnet,
title={EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks},
author={Tan, Mingxing and Le, Quoc V},
booktitle={International Conference on Machine Learning},
year={2019},
organization={PMLR}
}
@inproceedings{lin2014microsoft,
title={Microsoft COCO: Common Objects in Context},
author={Lin, Tsung-Yi and others},
booktitle={European Conference on Computer Vision},
year={2014},
organization={Springer, Cham}
}