Instructions to use nxp/sci-imx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use nxp/sci-imx with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
SCI (Self-Calibrated Illumination)
Overview
SCI [1] is an ultra-lightweight low-light image enhancement model. It takes a low-light RGB image as input and estimates an illumination map that is used to recover a brighter, clearer version of the image with minimal loss of detail, while being noticeably faster than comparable low-light enhancement methods.
This repository contains the medium variant of SCI, quantized to int8 and compiled for NXP i.MX
platforms (i.MX 8M Plus, i.MX 93, i.MX 95 and i.MX 952), together with the scripts used to reproduce the
conversion and an example inference script.
Key Features
- Ultra-lightweight: Only ~5.87K parameters, well suited for edge deployment.
- Low-light enhancement: Produces brighter, clearer images from low-light inputs.
- Flexible resolution: The original model has a dynamic input shape; this repository uses Full HD (1920x1080) as the default.
Model Description
This repository contains pre-compiled model files optimized for NXP i.MX processors.
- Base Model: SCI (medium variant)
- Original Model Authors: Long Ma, Tengyu Ma, Risheng Liu, Xin Fan, Zhongxuan Luo
- Original License: MIT
- Modified by: NXP
Modifications
This model is a derivative work with the following changes from the original:
- Format conversion: The pretrained PyTorch
medium.ptweights are exported to ONNX (opset 14) and converted to TensorFlow with onnx2tf. - Quantization: Post-training integer quantization (int8 weights/activations) with int8 input and float32 output. Calibration uses a commercially-useable ImageNetV2 subset (~100 images resized to 1920x1080 and normalized to [0, 1]).
- Compilation: Compiled for i.MX 93 (Arm Ethos-U65 NPU) using the NXP Vela tool, BSP tags
lf-6.18.20_2.0.0andlf-6.18.37_2.1.0. - Compilation: Converted for i.MX 95 and i.MX 952 (eIQ Neutron NPU) using the eIQ Neutron SDK,
versions
3.1.3,3.2.1and3.2.3.
Original model available at: https://github.com/vis-opt-group/SCI.
Model Information
| Information | Value |
|---|---|
| Input shape | RGB image (1, 1080, 1920, 3), int8 quantized, representing values normalized to [0, 1] |
| Input example | (Image source: LOL dataset [2]) |
| Output shape | Two float32 tensors of shape (1, 1080, 1920, 3): an illumination map and an auxiliary tensor. See example.py for how the enhanced image is recovered from the illumination map (input / illumination). |
| Output example | ![]() |
| FLOPS | 752M |
| Number of parameters | 5.87K |
| File size (int8) | ~5 KB |
| Source framework | PyTorch |
Supported Hardware and Software Configurations
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 asset (assets/imx8mplus/sci.tflite) is a symlink to the host reference model
assets/quantized_tflite_model/sci.tflite; they are the same file. The reference model under
assets/quantized_tflite_model/ is also used as the input to the i.MX 93 / i.MX 95 / i.MX 952
compilation steps and for host (x86) testing with example.py; it is not a separate target asset.
Limitations and Biases
- Task scope: This model only performs low-light image enhancement; it does not perform any denoising beyond what results implicitly from the enhancement, nor any other image restoration task.
- Calibration/training data bias: The original model was trained on the LOL dataset, which consists of paired low-light/normal-light indoor and outdoor scenes; performance on scene types not represented in that dataset (e.g., extreme low light, strong color casts, non-natural images) is not guaranteed. Quantization calibration uses a separate ImageNetV2 subset chosen for its commercial-use license, which may not fully represent the low-light image distribution the model was trained on.
Training
The original model was trained by the original authors on the LOL dataset [2]. The medium variant
used in this repository corresponds to a 'medium' difficulty training configuration; the upstream
repository also provides 'easy' and 'difficult' variants that trade off enhancement strength against
inference time. NXP did not retrain or fine-tune the model; only format conversion, quantization and
compilation were performed, as described in Modifications.
Download and Run
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 reproduce the quantized and compiled model files from scratch, set DATASET_PATH in recipe.sh to
your local ImageNetV2 subset, then run:
bash recipe.sh [VELA_TAG] [NEUTRON_VERSION]
# e.g. default: bash recipe.sh lf-6.18.20_2.0.0 3.2.3
# e.g. other: bash recipe.sh lf-6.18.37_2.1.0 3.2.1
This will produce:
assets/quantized_tflite_model/sci.tflite- int8 model for i.MX 8M Plus (CPU/NPU)assets/imx93/<vela-tag>/sci_vela.tflite- Vela-compiled for i.MX 93 Ethos-U65assets/imx95/<neutron-version>/sci_converted.tflite- Neutron-compiled for i.MX 95assets/imx952/<neutron-version>/sci_converted.tflite- Neutron-compiled for i.MX 952
The original model has a dynamic input shape. To change the resolution, adjust the SIZE_W / SIZE_H
variables in recipe.sh (and SIZE_MODEL in example.py).
An example of how to run inference is provided in example.py (run on a PC):
pip install opencv-python numpy tensorflow
python example.py --model assets/quantized_tflite_model/sci.tflite --input example_input.png --output example_output.png
example.py accepts -m/--model (default assets/quantized_tflite_model/sci.tflite), -i/--input
(default example_input.png) and -o/--output (default example_output.png).
Please refer to the i.MX Machine Learning User Guide for details on running models on each target platform.
License
This model is released under the MIT License, the same license as the original
SCI model. See LICENSE for NXP's license on this repository and
MODEL_LICENSE for the original model's license.
Citation
If you use this model, please cite both this work and the original model:
- Ma, Long and Ma, Tengyu and Liu, Risheng and Fan, Xin and Luo, Zhongxuan. "Toward Fast, Flexible, and Robust Low-Light Image Enhancement." In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5637-5646, 2022.
- Wei Chen, Wenjing Wang, Wenhan Yang, and Jiaying Liu. "Deep retinex decomposition for low-light enhancement." In British Machine Vision Conference, pages 1-12, 2018.
@inproceedings{ma2022toward,
title={Toward Fast, Flexible, and Robust Low-Light Image Enhancement},
author={Ma, Long and Ma, Tengyu and Liu, Risheng and Fan, Xin and Luo, Zhongxuan},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={5637--5646},
year={2022}
}
@inproceedings{Chen2018Retinex,
title={Deep Retinex Decomposition for Low-Light Enhancement},
author={Chen Wei, Wenjing Wang, Wenhan Yang, Jiaying Liu},
booktitle={British Machine Vision Conference},
year={2018},
organization={British Machine Vision Association}
}
- Downloads last month
- 45
(Image source: LOL dataset [2])