This repository demonstrates and compares wildfire-segmentation approaches using local ONNX models.
quartus_project/: Quartus project folder including vhdl-model.python_uart/: Python script to run inference on FPGA using PC.model_training/: Training scripts, ONNX export scripts, and utility scripts.models/: Exported model files (.onnx,.tflite).comparison/: Benchmark and video comparison script, plus generated output videos.video/: Input video used for inference.dataset/: Training, validation, and test data.
The Quartus project is set for an ACX3000 board with an A3CY100BM16AE7S. Compile quartus project using Quartus 25.3 and programm FPGA.
Adapt line 22 of the uart_cnn_visualizer.py script according to the COM port of your board. Then run the script:
python .\uart_cnn_visualizer.pyThe script provides further instructions on how to use it. It is possible to either run inference on a video stream (provided by a webcam connected to the PC) or on example images contained in the img/ -folder.
(First unpack the models from models/models.zip)
Runs one or multiple ONNX segmentation models on video/demo_video.mp4, overlays masks, and writes output videos.
Run all models:
python comparison/comparison.py --model all --threads 1Run a single model:
python comparison/comparison.py --model oneai --threads 1
python comparison/comparison.py --model unet --threads 1
python comparison/comparison.py --model deeplab --threads 1Optional thresholds:
python comparison/comparison.py --model all --thr_oneai 0.5 --thr_unet 0.5 --thr_deeplab 0.5Output:
comparison/output_CustomCNN.mp4comparison/output_UNet.mp4comparison/output_DeepLabV3+.mp4
Calculates theoretical Conv FLOPs and parameter counts from ONNX graph metadata.
python comparison/comparison.py --ops --model allpython model_training/wildfire_demo.py --epochs 100 --export_onnxpython model_training/wildfiren_demo_deeplab.py --epochs 300 --export_onnxCounts total parameters from ONNX initializers.
python model_training/count_onnx_params.py- numpy
- opencv-python
- onnxruntime
- onnxscript
- onnx
- torch
- torchvision
- pillow
Install:
pip install numpy opencv-python onnxruntime onnx onnxscript torch torchvision pillow