File size: 1,182 Bytes
e185710
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ce0bf15
e185710
 
 
 
 
 
 
10a9122
e185710
 
10a9122
e185710
 
 
 
 
 
10a9122
 
e185710
 
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
#!/bin/sh

echo "Install environment..."

. /etc/os-release
ubuntu_version="$VERSION_ID"
echo "Ubuntu version: $ubuntu_version"

# Check if the version is 22.04 or later
if [ "$ubuntu_version" \< "22.04" ]; then
    # Print an error message and exit
    echo "Error: Ubuntu version must be 22.04 or later"
    exit 1
fi

# Install packages:
sudo apt-get install -y binutils python3 python3-pip python3-opencv libcurl4-openssl-dev libssl-dev libpcsclite-dev psmisc

# Install requirements:
python3 -m pip install --upgrade pip && python3 -m pip install opencv-python gradio

# Copy libraries to /usr/lib based on Ubuntu version
if [ "$ubuntu_version" = "20.04" ]; then
    # Copy library for Ubuntu 20.04
    sudo cp -f ./id_ocr/dependency/libimutils.so /usr/lib
elif [ "$ubuntu_version" = "22.04" ]; then
    # Copy library for Ubuntu 22.04
    sudo cp -f ./id_ocr/dependency/libimutils.so_for_ubuntu22 /usr/lib/libimutils.so
else
    # Print an error message for unsupported Ubuntu versions
    echo "Error: Unsupported Ubuntu version"
    exit 1
fi

sudo cp -f ./id_ocr/dependency/libttvcore.so /usr/lib
sudo cp -rf ./id_live/dependency/* /usr/lib

echo "Installed successfully!"