diff --git a/orangepi5/install-os.md b/orangepi5/00 install-os.md similarity index 100% rename from orangepi5/install-os.md rename to orangepi5/00 install-os.md diff --git a/orangepi5/01 install.sh b/orangepi5/01 install.sh new file mode 100644 index 0000000..a02267e --- /dev/null +++ b/orangepi5/01 install.sh @@ -0,0 +1,26 @@ +# System +sudo apt update +sudo apt upgrade +sudo apt install -y wget git + +# Move/resize windows with Alt + mouse left/right +gsettings set org.gnome.desktop.wm.preferences mouse-button-modifier '' +gsettings set org.gnome.desktop.wm.preferences resize-with-right-button true + +# Firefox +sudo snap install firefox + +# Move top panel down +sudo apt install -y libglib2.0-dev-bin libxml2-utils gettext gnome-shell-extension-manager +git clone https://gitlab.gnome.org/jrahmatzadeh/just-perfection.git +cd just-perfection +./scripts/build.sh -i +cd .. +rm -rf just-perfection +gnome-session-quit --force +# Manually Open Extension Manager, Enter to Just Perfection extension +# then Customize -> Panel Position + +# Signal +sudo snap install signal-desktop + diff --git a/orangepi5/02 install-inference.sh b/orangepi5/02 install-inference.sh new file mode 100644 index 0000000..18a5311 --- /dev/null +++ b/orangepi5/02 install-inference.sh @@ -0,0 +1,38 @@ +# Install proper ssh key into your github acc, you should have an access +# to this repo https://github.com/azaion/autopilot + +# ONNX runtime +wget https://github.com/microsoft/onnxruntime/releases/download/v1.18.0/onnxruntime-linux-x64-1.18.0.tgz +sudo tar xf onnxruntime-linux-x64-1.18.0.tgz -C /opt +rm onnxruntime-linux-x64-1.18.0.tgz + +# ffmpeg & mediamtx +sudo apt install -y ffmpeg +wget https://github.com/bluenviron/mediamtx/releases/download/v1.9.1/mediamtx_v1.9.1_linux_arm64v8.tar.gz +mkdir mediamtx +tar xf mediamtx_v1.9.1_linux_arm64v8.tar.gz -C mediamtx +rm mediamtx_v1.9.1_linux_arm64v8.tar.gz + +# autopilot's ai player's libs and tools +sudo apt install -y qmake6 +sudo apt install -y libopencv-highgui-dev libopencv-video-dev libopencv-imgproc-dev libopencv-dev librga-dev libstb-dev libturbojpeg0-dev libqt6serialport6-dev + +sudo wget https://github.com/rockchip-linux/rknn-toolkit2/raw/refs/heads/master/rknpu2/runtime/Linux/librknn_api/aarch64/librknnrt.so -P /usr/local/lib/ +echo 'export LD_LIBRARY_PATH=/usr/local/lib' >> ~/.bashrc +source ~/.bashrc + +sudo wget https://raw.githubusercontent.com/rockchip-linux/rknn-toolkit2/refs/heads/master/rknpu2/runtime/Linux/librknn_api/include/rknn_api.h -P /usr/local/include +sudo wget https://raw.githubusercontent.com/rockchip-linux/rknn-toolkit2/refs/heads/master/rknpu2/runtime/Linux/librknn_api/include/rknn_custom_op.h -P /usr/local/include +sudo wget https://raw.githubusercontent.com/rockchip-linux/rknn-toolkit2/refs/heads/master/rknpu2/runtime/Linux/librknn_api/include/rknn_matmul_api.h -P /usr/local/include + +# autopilot's ai player +git clone https://github.com/azaion/autopilot +cd ~/autopilot/misc/rtsp_ai_player +mkdir build +cd build + +# Modify ~/autopilot/misc/rtsp_ai_player/aiengineconfig.h and change 192.168.168.91 to IP address of RTSP source +# only after that make a build: +qmake6 CONFIG+=opi5 .. && make -j8 + + diff --git a/orangepi5/03 run_inference.sh b/orangepi5/03 run_inference.sh new file mode 100644 index 0000000..8a4896c --- /dev/null +++ b/orangepi5/03 run_inference.sh @@ -0,0 +1,13 @@ +# 1 terminal: run mediamtx as rtsp server +cd ~/mediamtx +./mediamtx + +# 2 terminal: run rtsp +ffmpeg -re -stream_loop -1 -i ~/videos/ForAI.mp4 -c copy -f rtsp rtsp://localhost:8554/live.stream + +# 3 terminal: test and stop. +ffplay -rtsp_transport tcp rtsp://localhost:8554/live.stream + +# 3 terminal: inference +cd ~/autopilot/misc/rtsp_ai_player/build +./rtsp_ai_player ~/azaion.rknn