Prepare BDD100k-Dataset
Run the command
.\train\010_prepare_bdd100k.cmd
It first downloads the dataset and extracts it to ./dataset/. Then it uses SAM2 to convert the bounding-boxes to segmentations masks (BDD100k has segmentation masks / polygons but only for 10k images). In this example we are only using 1000 images for teh training and 100 images for the validation. You can chnge this in the prepare_bddk100k.py file.
Train the datset using PaddleSeg
Run the command
.\train\020_train_paddleseg.cmd
It used PaddleSeg with the ppliteseg-config to train the model.
Note1: PaddleSeg uses -1..1 normalization, but it is changed in to 0..1 [pytorch equivalent] by using mean[0,0,0] in the config-file.
Note2: We are using a lower resolution currently 896x504) because it works with EdgeTPU and Hailo8. Hailo8 supports higher resultion (eg 1280x720), then you need to change the config file.
Run the command
.\train\030_export_onnx.cmd
It export the model to onnx.
Note1: If you changed the config you also need to change the export-resolution (currently 896x504 is used in training and export).
Note2: SoftMax is used instead of ArgMax.
Run the command
.\train\040_predict_onnx.cmd
This uses the model and tests it on one image using CPU- and DirectML-Execution-Providers.
Create an account at https://hailo.ai and go to download portal https://hailo.ai/developer-zone/software-downloads/
- Software Package: AI Software Suite
- Software Sub-Package: HailoRT
- Architecture x86
- OS: Windows
- @ HailoRT – Windows installer
- hailort_4.20.0_windows_installer.msi
- @ HailoRT – Windows installer
./hailoai/packages/hailort_4.20.0_windows_installer.msi
hailortcli scan
Hailo Devices:
[-] Device: 0000:04:00.0
- Software Package: AI Software Suite
- Software Sub-Package: Dataflow Compiler
- Architecture x86
- OS: Linux
- @ Hailo Dataflow Compiler – Python package (whl)
- hailo_dataflow_compiler-3.30.0-py3-none-linux_x86_64.whl
- @ Hailo Dataflow Compiler – Python package (whl)
Open commandline and install a copy of Ubuntu-20.04 and the HailAI requirements by running
.\hailoai\010_install_ubuntu_hailoai.cmd
Run the command
.\hailoai\020_convert_onnx2har.cmd
This converts the model from onnx to har in multiple steps (it will take ~20min).
Note1: You have to change the hw-architecture to your device (eg. hailo8l) in the shellscript.
Link to shell-script
Run the command
.\hailoai\030_predict_hailoai.cmd
.\edgetpu\010_convert_onnx2tflite.cmd
This converts the model from onnx to tflite (fp32) and tflite (int8).
Run the command
.\edgetpu\020_predict_tflite.cmd
Run the command
.\edgetpu\030_install_ubuntu_edgetpu_compiler.cmd
Run the command
.\edgetpu\040_convert_tflite2edgetpu.cmd
Run the command
.\edgetpu\050_install_edgetpu_win.cmd
Run the command
.\edgetpu\060_predict_edgetpu.cmd