Deploying ML Models on Edge Devices



Software Setup

In this section you get to set up the software required to train and deploy the models on the hardware. We will set up what we'll utilize for both the baseline model and the camera trap application.

Installation

Start by setting up an Edge Impulse Account
Install the OpenMV IDE

Installation-Windows
  • Clone the dsail-tech4wildlife repository
    git clone https://github.com/DeKUT-DSAIL/dsail-tech4wildlife.git
  • Run the install.bat file with administrative priviledges to install the required dependencies
    Alternatively to set up the required dependencies manually
    • Clone the dsail-tech4wildlife repository
      git clone https://github.com/DeKUT-DSAIL/dsail-tech4wildlife.git
    • Install Edge Impulse CLI
      • Install Node.js 18.17.1
        • For Windows users, install the Additional Node.js tools (called Tools for Native Modules on newer versions) when prompted.
      • Install Python 3.10
      • Install Edge Impulse CLI
        npm install -g edge-impulse-cli --force
    • Install Arduino CLI
      • Install chocolatey
        Run the following command in an administrative powershell prompt
        Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
      • Install Arduino CLI
        choco install arduino-cli
    • Create and activate a virtual environment
      • Run the following commands in a command prompt
      • pip install virtualenv
        python -m virtualenv dsail-tech4wildlife
        .\dsail-tech4wildlife\Scripts\activate
    • Install the required Python dependencies
      • Open a command prompt in the dsail-tech4wildlife directory and run the following command
      • pip install -r requirements.txt
Installation-Linux
  • Clone the dsail-tech4wildlife repository
    git clone https://github.com/DeKUT-DSAIL/dsail-tech4wildlife.git
  • Run the sudo bash install.sh command to install the required dependencies

  • Alternatively to set up the required dependencies manually
    • Clone the dsail-tech4wildlife repository
      git clone https://github.com/DeKUT-DSAIL/dsail-tech4wildlife.git
    • Install Node.js
      • Run the following commands in a terminal
      • curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
        sudo apt-get install -y nodejs
    • Install Edge Impulse CLI
      • Run the following command in a terminal
      • npm install -g edge-impulse-cli
    • Install snap
      • Run the following command in a terminal
      • sudo apt install snapd
    • Install Arduino CLI
      • Run the following commands in a terminal
      • snap install arduino-cli
    • Create and activate a virtual environment
      • Run the following commands in a terminal
      • pip install virtualenv
        python3 -m virtualenv dsail-tech4wildlife
        source dsail-tech4wildlife/bin/activate
    • Install the required Python dependencies
      • Open a terminal in the dsail-tech4wildlife directory and run the following command
      • pip install -r requirements.txt