Repo contains:
- Training a simple object detection model (MobileNetv2)
- Quantising TFLite Model
- Generating Autotiler Code for AI-Deck implementation
- Clone repository into
aideck-gap8-examples/examples/ai/
folder - From a terminal with the docker container, or gap_sdk dev environment, in the
aideck-gap8-examples/
folder, execute:docker run --rm -v ${PWD}:/module aideck-with-autotiler tools/build/make-example examples/ai/detection clean model build image
- From another terminal (outside of the container), use the cfloader to flash the example if you have the gap8 bootloader flashed AIdeck. Change the [CRAZYFLIE URI] with your crazyflie URI like
radio://0/90/2M/E7E7E7E726
.cfloader flash examples/ai/detection/BUILD/GAP8_V2/GCC_RISCV_FREERTOS/target.board.devices.flash.img deck-bcAI:gap8-fw -w radio://0/90/2M/E7E7E7E726
- Flashing will take ~10 minutes depending on the model size and it may appear to be stuck at 99%. However, if the crazyflie automatically reboots at 99%, the flashing is usually completed and you can
Ctrl+C
in the terminal. - Reboot the Crazyflie.
When the example is flashing, you should see the GAP8 LED blink fast, which is the bootloader. The example itself can be noticed by a slow blinking LED. You should also receive the detection output in the cfclient console.
- Download dataset from Roboflow in Pascal VOC format.
- Extract them in
aideck-gap8-examples/examples/ai/detection/images/
. - Run
python3 pascal_csv.py
.
- Refer to
model.ipynb
to createdetection_q.tflite
model. Make sure tflite model is saved inmodel/
folder.