-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·62 lines (53 loc) · 1.72 KB
/
install.sh
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
#!/bin/bash
# Update and upgrade
echo "Updating system"
sudo apt update
sudo apt upgrade -y
# Install node
echo "Installing node"
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs
# Show versions
echo "Node version:"
node -v
echo "NPM version:"
npm -v
# Install node dependencies
echo "Installing node dependencies"
npm install
# Install essentials
echo "Installing essentials"
sudo apt install -y build-essential
sudo apt install -y unzip
sudo apt install -y git
sudo apt install -y gcc
# Download models required by this project
echo "Downloading models"
wget https://storage.googleapis.com/download.tensorflow.org/models/tflite/coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip
unzip coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip -d ./models
rm -rf coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip
# Install tflite
echo "Installing tflite"
wget https://github.com/prepkg/tensorflow-lite-raspberrypi/releases/latest/download/tensorflow-lite.deb
sudo apt install -y ./tensorflow-lite.deb
rm -rf tensorflow-lite.deb
# Rebuild libcamera to have libcamera-detect
echo "Installing packages for building libcamera"
sudo apt install -y libcamera-dev libjpeg-dev libtiff5-dev
sudo apt install -y cmake libboost-program-options-dev libdrm-dev libexif-dev
# Download code
echo "Downloading library code"
cd
git clone https://github.com/raspberrypi/libcamera-apps.git
cd libcamera-apps
mkdir build
cd build
# Build
echo "Building library"
cmake .. -DENABLE_DRM=1 -DENABLE_X11=0 -DENABLE_QT=0 -DENABLE_OPENCV=0 -DENABLE_TFLITE=1
# Finish and install
echo "Installing library"
make -j1 # use -j1 on Raspberry Pi 3 or earlier devices
sudo make install
sudo ldconfig # this is only necessary on the first build
echo "Done"