Skip to content

Commit

Permalink
(bitcraze#35) update dockerfiles, examples and docs to 3.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
knmcguire committed Dec 4, 2020
1 parent 24cf0af commit 1968c8f
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 25 deletions.
2 changes: 2 additions & 0 deletions GAP8/image_processing_examples/FaceDetection/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ static int open_camera_himax(struct pi_device *device)
pi_open_from_conf(device, &cam_conf);
if (pi_camera_open(device))
return -1;

pi_camera_control(device, PI_CAMERA_CMD_AEG_INIT, 0);

return 0;
}
Expand Down
1 change: 1 addition & 0 deletions GAP8/test_functionalities/test_camera/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ static int open_camera(struct pi_device *device)
pi_open_from_conf(device, &cam_conf);
if (pi_camera_open(device))
return -1;
pi_camera_control(device, PI_CAMERA_CMD_AEG_INIT, 0);

return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion GAP8/test_functionalities/wifi_jpeg_streamer/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ static int open_pi_camera_himax(struct pi_device *device)

pi_himax_conf_init(&cam_conf);

cam_conf.format = PI_CAMERA_QQVGA;
cam_conf.format = PI_CAMERA_QVGA;

pi_open_from_conf(device, &cam_conf);
if (pi_camera_open(device))
return -1;
pi_camera_control(device, PI_CAMERA_CMD_AEG_INIT, 0);

return 0;
}
Expand Down
37 changes: 21 additions & 16 deletions docker/gap8/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
FROM ubuntu:18.04

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update && apt-get install -y build-essential git libftdi-dev libftdi1 doxygen python3-pip libsdl2-dev curl cmake libusb-1.0-0-dev scons gtkwave libsndfile1-dev rsync autoconf automake texinfo libtool pkg-config libsdl2-ttf-dev libopencv-dev
ENV DEBIAN_FRONTEND noninteractive
ARG GAP_SDK_VERSION
RUN echo $GAP_SDK_VERSION

RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && apt-get install git-lfs && git lfs install
# Install needed packages
RUN apt-get update && apt-get install -y build-essential git libftdi-dev libftdi1 doxygen python3-pip libsdl2-dev curl cmake libusb-1.0-0-dev scons gtkwave libsndfile1-dev rsync autoconf automake texinfo libtool pkg-config libsdl2-ttf-dev
RUN apt-get install -y wget

# Install gap8 openocd
RUN git clone https://github.com/GreenWaves-Technologies/gap8_openocd.git; cd gap8_openocd; ./bootstrap; ./configure --program-prefix=gap8- --prefix=/usr --datarootdir=/usr/share/gap8-openocd; make -j; make -j install

RUN git clone https://github.com/GreenWaves-Technologies/gap_riscv_toolchain_ubuntu_18.git
# Install toolchain
RUN git clone https://github.com/GreenWaves-Technologies/gap_riscv_toolchain_ubuntu_18.git; cd gap_riscv_toolchain_ubuntu_18 && ./install.sh "/usr/lib/gap_riscv_toolchain" && cd ..

RUN cd gap_riscv_toolchain_ubuntu_18 && ./install.sh "/usr/lib/gap_riscv_toolchain" && cd ..
# Install Gap SDK
RUN git clone https://github.com/GreenWaves-Technologies/gap_sdk.git; cd gap_sdk && git fetch --all --tags && git checkout tags/release-v${GAP_SDK_VERSION} && git submodule update --init --recursive

RUN git clone https://github.com/GreenWaves-Technologies/gap_sdk.git
RUN pip3 install -U pip && cd gap_sdk && pip3 install -r requirements.txt;

ARG GAP_SDK_VERSION
RUN cd gap_sdk && git fetch --all --tags && git checkout tags/release-v${GAP_SDK_VERSION} && git submodule update --init --recursive
# These are needed since python2 is used by standard in 18.04
RUN apt-get install -y python-pip
RUN python -m pip install configparser
#RUN pip3 install requests

RUN pip3 install -U pip && cd gap_sdk && pip3 install -r requirements.txt && pip3 install -r tools/nntool/requirements.txt
#RUN /bin/bash -c "echo 'alias python = python3' >> ~/.bashrc "


RUN /bin/bash -c "cd gap_sdk/; source configs/ai_deck.sh; ls; make all;"

RUN /bin/bash -c "cd gap_sdk/; source configs/ai_deck.sh; ls; make gap_tools"

RUN apt install wget
RUN cd gap_sdk; pip3 install -r tools/nntool/requirements.txt

RUN /bin/bash -c "cd gap_sdk/; source configs/ai_deck.sh; ls; make nntool"

RUN pip3 install requests

RUN /bin/bash -c "cd gap_sdk/; source configs/ai_deck.sh; ls; make openocd"
RUN /bin/bash -c "cd gap_sdk/; source configs/ai_deck.sh; ls; make pulp-os"
RUN apt-get install -y libopencv-dev python3-opencv

RUN pip3 install tensorflow==1.15.2 scikit-image==0.15.0 scikit-learn==0.21.3
RUN /bin/bash -c "cd gap_sdk/; source configs/ai_deck.sh; ls; make gap_tools"

RUN mkdir -p /module/data/
WORKDIR /module/data/
2 changes: 1 addition & 1 deletion docs/ai-examples/gapflow-model-extern.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ page_id: gapflow-model-extern

# MNIST example simplified

The *GAP8/ai_examples/mnist_simple/* is a copy of Greenwaves' [MNIST example of GAPflow](https://github.com/GreenWaves-Technologies/gap_sdk/tree/master/examples/nntool/mnist). This example was tested and working in SDK `3.7`.
The *GAP8/ai_examples/mnist_simple/* is a copy of Greenwaves' [MNIST example of GAPflow](https://github.com/GreenWaves-Technologies/gap_sdk/tree/master/examples/nntool/mnist). This was tested on **GAP_SDK version 3.8.1**.

The GAP*flow* is expressed as Makefiles in the 'common' folder. It uses the NNTool and Autotiler tool consecutively as explained in the main folder.

Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started/docker-gap8.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Prebuild the docker image while in the same directory as the docker file.
*Note: Depending on your operating system and docker installation you might need to perform the following commands with `sudo`. For more information see the [docker documentation](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)*.

```
export GAP_SDK_VERSION=3.7
export GAP_SDK_VERSION=3.8.1
```
If you want to permanently use that version, we recommend that you put it inside your `.bashrc`. For example by appending it
```
Expand Down Expand Up @@ -47,7 +47,7 @@ export GAP_SDK_VERSION=3.7
docker commit <container id> gapsdk:${GAP_SDK_VERSION}
```

This will save the install of the autotiler on your image.
This will save the install of the autotiler on your image. You can close the container in the other terminal with 'exit'

### Running an Example
On your host navigate to the `make`-file you want to execute. For example
Expand Down
2 changes: 1 addition & 1 deletion docs/img-proc-examples/face-detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ page_id: face-detection

This is the face detection application based on the example as developed by Greenwaves technologies. It is a bit more tailor made towards the AI-deck and uses the wifi streamer to stream the output to your computer.

This was tested on **GAP_SDK version 3.7**. Make sure that next to `make SDK`, you also do `make gap_tools`.
This was tested on **GAP_SDK version 3.8.1**. Make sure that next to `make SDK`, you also do `make gap_tools`.

> Working directory: AIdeck_examples/GAP8/image_processing_examples/FaceDetection
Expand Down
2 changes: 1 addition & 1 deletion docs/nina-instructions/docker-nina.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ Then use the following line of code in the terminal (make sure to change the --d
> Working directory: AIdeck_examples/NINA/firmware
```
docker run --rm -it -v $PWD:/module/ --device /dev/ttyUSB0 --privileged -P espidf:3.3.1 /bin/bash -c "make menuconfig; make clean; make all; /openocd-esp32/bin/openocd -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -f board/esp-wroom-32.cfg -c 'program_esp32 build/partitions_singleapp.bin 0x8000 verify' -c 'program_esp32 build/bootloader/bootloader.bin 0x1000 verify' -c 'program_esp32 build/ai-deck-jpeg-streamer-demo.bin 0x10000 verify reset exit'"
docker run --rm -it -v $PWD:/module/ --device /dev/ttyUSB0 --privileged -P espidf:3.3.1 /bin/bash -c "make clean; make menuconfig; make all; /openocd-esp32/bin/openocd -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -f board/esp-wroom-32.cfg -c 'program_esp32 build/partitions_singleapp.bin 0x8000 verify' -c 'program_esp32 build/bootloader/bootloader.bin 0x1000 verify' -c 'program_esp32 build/ai-deck-jpeg-streamer-demo.bin 0x10000 verify reset exit'"
```
2 changes: 1 addition & 1 deletion docs/test-functions/test-camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page_id: test-camera
# Testing the Himax camera on the AIdeck


This concerns the example in folder *AIdeck_examples/GAP8/test_functionalities/test_camera/*. This was tested on **GAP_SDK version 3.7**.
This concerns the example in folder *AIdeck_examples/GAP8/test_functionalities/test_camera/*. This was tested on **GAP_SDK version 3.8.1**.

In the makefile enable `APP_CFLAGS += -DASYNC_CAPTURE` if you want to test the asynchronous camera capture and remove it if you want to test the normal one. To save a color image enable `APP_CFLAGS += -DCOLOR_IMAGE`. And, to capture a `324x324` image enable `APP_CFLAGS += -DQVGA_MODE`. *Please note though that capturing an image in non-QVGA mode might not always work correctly.*

Expand Down
2 changes: 1 addition & 1 deletion docs/test-functions/uart-send-char.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ page_id: uart-send-char

# Send character over UART

This concerns the example in the folder *AIdeck_examples/GAP8/test_functionalities/uart_send_char/*
This concerns the example in the folder *AIdeck_examples/GAP8/test_functionalities/uart_send_char/*. This was tested on **GAP_SDK version 3.8.1**.


The uart send character example sends a character over UART1, meant to be read out by the Crazyflie at the other end. Make sure that the AI-deck driver is force compiled in the crazyflie firmware as explained [here](https://www.bitcraze.io/documentation/repository/crazyflie-firmware/master/development/howto/#enabling-the-driver
Expand Down
2 changes: 1 addition & 1 deletion docs/test-functions/wifi-streamer.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ page_id: wifi-streamer

This example streams JPEG images from the GAP8 connected camera to a socket connected on WiFI. This concerns the example in *AIdeck_examples/GAP8/test_functionalities/wifi_jpeg_streamer/*.

This example was tested and working under SDK version `3.5`. There is a reported problem for the wifi example for version 3.6 and up, so please check out this [issue](https://github.com/bitcraze/AIdeck_examples/issues/19).
This was tested on **GAP_SDK version 3.8.1**.


## Prerequisites
Expand Down

0 comments on commit 1968c8f

Please sign in to comment.