S
sanjith

  • Nov 17, 2020
  • Joined Jul 28, 2020
  • 0 best answers
  • Quick additional update: YOLO is now supported w/ on-DepthAI parsing before export over SPI:
    We merged the SPI capability with the yolo tensor decoding, and this is now in the spi_esp32 branch.

    The new text format printed by existing ESP32 app looks like below. It is currently limited to 3 simultaneous detections due to 256 bytes packet size.

    [RECV-156478] esp32-cnt:156473 DepthAI 1777
    [RECV-156479] esp32-cnt:156474 DepthAI 1778
    [RECV-156480] esp32-cnt:156475 DepthAI 1779
    0 lbl 27 54.0% xy0xy1 0.537 0.377 0.592 0.527 xyz 0.00 0.00 0.00
    [RECV-156481] esp32-cnt:156476 DepthAI 1780
    0 lbl 0 67.9% xy0xy1 0.471 0.112 0.652 0.540 xyz 0.00 0.00 0.00
    [RECV-156482] esp32-cnt:156477 DepthAI 1781
    [RECV-156483] esp32-cnt:156478 DepthAI 1782
    0 lbl 0 74.5% xy0xy1 0.514 0.129 0.760 0.583 xyz 0.00 0.00 0.00
    1 lbl 27 69.6% xy0xy1 0.634 0.414 0.690 0.556 xyz 0.00 0.00 0.00
    2 lbl 27 51.9% xy0xy1 0.618 0.414 0.670 0.552 xyz 0.00 0.00 0.00
    [RECV-156484] esp32-cnt:156479 DepthAI 1783
    0 lbl 0 52.5% xy0xy1 0.532 0.127 0.739 0.581 xyz 0.00 0.00 0.00
    [RECV-156485] esp32-cnt:156480 DepthAI 1784
    [RECV-156486] esp32-cnt:156481 DepthAI 1785
    [RECV-156487] esp32-cnt:156482 DepthAI 1786
    [RECV-156488] esp32-cnt:156483 DepthAI 1787
    0 lbl 27 67.6% xy0xy1 0.767 0.421 0.828 0.562 xyz 0.00 0.00 0.00
    1 lbl 0 57.6% xy0xy1 0.636 0.135 0.846 0.586 xyz 0.00 0.00 0.00
    [RECV-156489] esp32-cnt:156484 DepthAI 1788
    0 lbl 27 74.3% xy0xy1 0.765 0.406 0.824 0.551 xyz 0.00 0.00 0.00
    [RECV-156490] esp32-cnt:156485 DepthAI 1789

    Below is a quick update guide (assuming the new bootloader is already updated):

    1. Pull the latest changes and update git submodules, then build the python lib (for Linux x86_64 the library is also prebuilt).
    2. Put the device in DFU update mode by shorting SPI2.5 pin to ground and reset or power-cycle. The 1099 SoM LED should start double-blinking once per second.
    3. Build the Flash FW update package, like: ./depthai.py -cnn tiny-yolo-v3 -build. In this case its size is about 23.6MB.
    4. Send it over DFU: dfu-util -D depthai_flash.fw. In this case the entire process will take about 2m57s. The first part (USB transfer) takes 34 seconds -- that's too much and related to DFU, we'll eventually look how to shorten it.
    5. The updated app+blob will boot automatically. If SPI2.5 is still asserted, release it, to not have the device re-enter bootloader after another reset.

    We also tried with the full YOLO model, -cnn yolo-v3 , it works. The package gets to 130.3MB (124.3MiB), so using almost the entire capacity of the SPI Flash -- 128MiB (besides the FW+blob, we also have 0.5MiB reserved for the bootloader).

    The entire update process takes 14m49s, from where the USB transfer is 3m07s.