Create install.sh
Browse files- install.sh +38 -0
install.sh
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
|
| 3 |
+
echo "Install environment..."
|
| 4 |
+
|
| 5 |
+
. /etc/os-release
|
| 6 |
+
ubuntu_version="$VERSION_ID"
|
| 7 |
+
echo "Ubuntu version: $ubuntu_version"
|
| 8 |
+
|
| 9 |
+
# Check if the version is 20.04 or later
|
| 10 |
+
if [ "$ubuntu_version" \< "20.04" ]; then
|
| 11 |
+
# Print an error message and exit
|
| 12 |
+
echo "Error: Ubuntu version must be 20.04 or later"
|
| 13 |
+
exit 1
|
| 14 |
+
fi
|
| 15 |
+
|
| 16 |
+
# Install packages:
|
| 17 |
+
sudo apt-get update -y && sudo apt-get install -y python3 python3-pip python3-opencv libcurl4-openssl-dev libssl-dev libtbb-dev
|
| 18 |
+
|
| 19 |
+
# Install requirements:
|
| 20 |
+
python3 -m pip install --upgrade pip && python3 -m pip install opencv-python flask flask-cors gradio
|
| 21 |
+
|
| 22 |
+
# Copy libraries to /usr/lib based on Ubuntu version
|
| 23 |
+
if [ "$ubuntu_version" = "20.04" ]; then
|
| 24 |
+
# Copy library for Ubuntu 20.04
|
| 25 |
+
sudo cp -f dependency/libimutils.so /usr/lib
|
| 26 |
+
elif [ "$ubuntu_version" = "22.04" ]; then
|
| 27 |
+
# Copy library for Ubuntu 22.04
|
| 28 |
+
sudo cp -f dependency/libimutils.so_for_ubuntu22 /usr/lib/libimutils.so
|
| 29 |
+
else
|
| 30 |
+
# Print an error message for unsupported Ubuntu versions
|
| 31 |
+
echo "Error: Unsupported Ubuntu version"
|
| 32 |
+
exit 1
|
| 33 |
+
fi
|
| 34 |
+
|
| 35 |
+
# Copy OpenVino library
|
| 36 |
+
sudo cp -rf dependency/openvino /usr/lib
|
| 37 |
+
|
| 38 |
+
echo "Installed successfully!"
|