-
Build the base docker image
docker build -t armv7_openvino ./rpi-docker
-
Run the initial CMake command
docker run -v D:\Git\ai-drone:/root/build --rm armv7_openvino cmake -DCMAKE_TOOLCHAIN_FILE="/root/arm-openvino.toolchain.cmake" -B buildArm -S .
-
Build the project
docker run -v D:\Git\ai-drone:/root/build --rm armv7_openvino make -j7 -C buildArm docker run -v D:\Git\drone-c++:/root/build armv7_openvino make -j10 -C buildArm && scp -r ./buildArm/armv7l/Debug/ pi@rpi-3:/home/pi/drone/
-
Copy the drone binary and libs folder (found in
buildArm\armv7l\Release
) over to the raspberry pi. -
Copy any required inference models over. They should be placed in a folder named models right beside the executable.
-
Navigate to the directory that contains the binary and run the following command:
LD_LIBRARY_PATH=Release/lib:opencv-4.1.1/lib/:inference_engine/lib/arm ./Release/drone -m ~/drone/models/Transportation/object_detection/vehicle/mobilenet-reduced-ssd/dldt/FP16/vehicle-detection-adas-0002.xml -i ~/drone/vids/fly_up_480p.mp4 -d MYRIAD -msp_port_name /dev/serial0 -ma ~/drone/models/Security/object_attributes/vehicle/resnet10_update_1/dldt/FP16/vehicle-attributes-recognition-barrier-0039.xml LD_LIBRARY_PATH=lib:/home/pi/qeum-test/bin/armv7l/Release/lib:/home/pi/qeum-test/opencv-4.1.0/lib ./drone \ -m models/Transportation/object_detection/vehicle/mobilenet-reduced-ssd/dldt/FP16/vehicle-detection-adas-0002.xml \ -ma models/Security/object_attributes/vehicle/resnet10_update_1/dldt/FP16/vehicle-attributes-recognition-barrier-0039.xml \ -d MYRIAD \ -msp_port_name /dev/serial0 \ -i car_smaller.mp4 LD_LIBRARY_PATH=~/opencv/lib:~/inference-engine/bin/aarch64/Release/lib:lib ./drone \ -m ~/drone/models/Transportation/object_detection/vehicle/mobilenet-reduced-ssd/dldt/FP16/vehicle-detection-adas-0002.xml \ -ma ~/drone/models/Security/object_attributes/vehicle/resnet10_update_1/dldt/FP16/vehicle-attributes-recognition-barrier-0039.xml \ -d MYRIAD \ -msp_port_name /dev/serial0 \ -i ~/drone/vids/fly_up_480p.mp4
This is helpful for debugging since you can run the project from right within Visual Studio.
-
Create a
build
directory and run CMake.mkdir build && cd build cmake ..
-
Open
build/Drone.sln
with Visual Studioa. You should be able to build from within VS but running might be a bit tricky due to the necessary environment variables required for OpenVINO to run. I normally just run the app from the command line anyways.
-
Run the command:
drone.exe -m "..\models\Transportation\object_detection\vehicle\mobilenet-reduced-ssd\dldt\FP16\vehicle-detection-adas-0002.xml" -ma "..\models\Security\object_attributes\vehicle\resnet10_update_1\dldt\FP16\vehicle-attributes-recognition-barrier-0039.xml" -d MYRIAD -msp_port_name COM3 -i ..\vids\car_480p.mp4
cd /root && mkdir bundle
cp -r opencv/build/ bundle/ && mv bundle/build/ bundle/opencv
cp -r dldt/inference-engine/ bundle/
cd bundle && zip -r bundle opencv/ inference-engine/
cp bundle.zip /root/build/from-dock/