-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·75 lines (60 loc) · 1.8 KB
/
install.sh
File metadata and controls
executable file
·75 lines (60 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
INSTALL_OPENCV=false
INSTALL_PYTHON_BINDINGS=false
case "$1" in
--opencv=true)
INSTALL_OPENCV=true
echo "[INFO]: Installing with OpenCV"
;;
--python=true)
INSTALL_PYTHON_BINDINGS=true
echo "[INFO]: Installing with Python Bindings"
;;
esac
case "$2" in
--python=true)
INSTALL_PYTHON_BINDINGS=true
echo "[INFO]: Installing with Python Bindings"
;;
--opencv=true)
INSTALL_OPENCV=true
echo "[INFO]: Installing with OpenCV"
;;
esac
echo "[INFO]: Installing rknn-toolkit2 dependencies"
cd ~
sudo apt update -y && sudo apt upgrade -y
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt install -y gcc-13 g++-13
sudo apt install git make libomp-dev
echo "[INFO]: Installing rknn-toolkit2"
git clone --depth=1 https://github.com/airockchip/rknn-toolkit2.git
cd ~/rknn-toolkit2-master/rknpu2/runtime/Linux/librknn_api/aarch64
sudo cp ./librknnrt.so /usr/local/lib
cd ~/rknn-toolkit2-master/rknpu2/runtime/Linux/librknn_api/include
sudo cp ./rknn_* /usr/local/include/rknpu
cd ~
sudo rm -rf ./rknn-toolkit2-master
# Check if INSTALL_OPENCV is true and install OpenCV
if [ "$INSTALL_OPENCV" = true ]; then
echo "Installing and Building Opencv"
cd ~
sudo apt install cmake
sudo apt install -y pkg-config ffmpeg libavformat-dev libavcodec-dev libswscale-dev
git clone --depth=1 https://github.com/opencv/opencv.git
cd opencv
cmake -B build
cd build
make -j5
sudo make install
cd ~
rm -rf ./opencv
fi
if [ "$INSTALL_PYTHON_BINDINGS" = true ]; then
cd ~
git clone --depth=1 https://github.com/pybind/pybind11.git
sudo mv pybind11 /usr/local/include
rm -rf pybind11
pip3 install -r requirements.txt
python3 setup.py install --user
fi