Training code for the machine learning models that ship with the
OpenMV firmware. Each model has its own
folder with the scripts to capture sensor data, build the training set, train,
and export the int8 .tflite that runs on the camera. The trained models
themselves live in the firmware's lib/models/.
| Folder | Sensor | Upscale | Trained on |
|---|---|---|---|
thermal_sr/ |
FLIR Lepton 3.5 | 160x120 -> 640x480 | PBVS thermal SR set, Tau2-101 |
depth_sr/vl53l9cx/ |
ST VL53L9CX | 54x42 -> 216x168 | Hypersim |
depth_sr/tmf8829/ |
ams-OSRAM TMF8829 | 48x32 -> 192x128 | NYU Depth v2 |
All three are super-resolution models with the same design. The network runs
at the sensor's resolution on the NPU and predicts, for each output pixel, blend
weights over the 3x3 neighboring input pixels (convex upsampling, as in RAFT).
The output is a weighted average of the measured values, computed on the CPU
with ml.convex_upsample(), so it never invents temperatures or distances that
weren't measured. The training data is degraded to match each sensor's measured
noise and blur.
The scripts were run with Python 3.12, TensorFlow 2.18 and Keras 3, in one
virtual environment shared by all models. Run them with python -I <script>.
The datasets are not included in this repository. Download them from their sources, and follow their terms and citation requests.
| Dataset | Used by | Source | License |
|---|---|---|---|
| PBVS thermal SR (FLIR FC-6320, 640x480) | thermal_sr |
CIDIS, ESPOL | None published, cite the paper |
| Tau2-101 (FLIR Tau2, 640x512) | thermal_sr |
CIDIS, ESPOL | None published, cite the paper |
| Hypersim | depth_sr/vl53l9cx |
apple/ml-hypersim | CC BY-SA 3.0 |
| NYU Depth v2 (labeled set) | depth_sr/tmf8829 |
NYU | None stated, cite the paper |
The sensor recordings used for the noise models and for testing are not included either.
- R. E. Rivadeneira, P. L. Suarez, A. D. Sappa and B. X. Vintimilla. Thermal Image SuperResolution Through Deep Convolutional Neural Network. ICIAR 2019.
- R. E. Rivadeneira, A. D. Sappa and B. X. Vintimilla. Thermal Image Super-Resolution: A Novel Architecture and Dataset. VISAPP 2020.
- M. Roberts et al. Hypersim: A Photorealistic Synthetic Dataset for Holistic Indoor Scene Understanding. ICCV 2021.
- N. Silberman et al. Indoor Segmentation and Support Inference from RGBD Images. ECCV 2012.
- Z. Teed and J. Deng. RAFT: Recurrent All-Pairs Field Transforms for Optical Flow. ECCV 2020.