-
Notifications
You must be signed in to change notification settings - Fork 5
/
one_hit_install.sh
executable file
·86 lines (74 loc) · 2.51 KB
/
one_hit_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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# Define the DeepStream root directory
DEEPSTREAM_ROOT_DIR="/opt/nvidia/deepstream/"
# Check if the DeepStream root directory exists
if [ ! -d "$DEEPSTREAM_ROOT_DIR" ]; then
echo "DeepStream is not installed in the directory $DEEPSTREAM_ROOT_DIR"
exit 1
fi
# Execute the additional DeepStream installation script
bash /opt/nvidia/deepstream/deepstream/user_additional_install.sh
if [ $? -ne 0 ]; then
echo "Failed to execute additional DeepStream installation script."
exit 1
fi
# Check the DeepStream version based on the directory name
DEEPSTREAM_VERSION_DIR=$(ls -d ${DEEPSTREAM_ROOT_DIR}/deepstream-* | awk -F'/' '{print $NF}')
# Verify if the version was identified correctly
if [[ $DEEPSTREAM_VERSION_DIR =~ deepstream-([0-9]+\.[0-9]+) ]]; then
VERSION="${BASH_REMATCH[1]}"
case "$VERSION" in
"7.1")
bash /opt/nvidia/deepstream/deepstream/user_deepstream_python_apps_install.sh --version 1.2.0
;;
"7.0")
bash /opt/nvidia/deepstream/deepstream/user_deepstream_python_apps_install.sh --version 1.1.11
;;
"6.4")
bash /opt/nvidia/deepstream/deepstream/user_deepstream_python_apps_install.sh --version 1.1.10
;;
"6.3")
bash /opt/nvidia/deepstream/deepstream/user_deepstream_python_apps_install.sh --version 1.1.8
;;
*)
echo "Unsupported DeepStream version: $VERSION"
exit 1
;;
esac
# Check if the previous command was successful
if [ $? -ne 0 ]; then
echo "Failed to install DeepStream Python apps for version $VERSION."
exit 1
fi
else
echo "Unable to identify the DeepStream version in the directory $DEEPSTREAM_ROOT_DIR"
exit 1
fi
# Compile the nvdsinfer_yolo function used by PGIE
cd /apps/deepstream-yolo-e2e || exit
bash scripts/compile_nvdsinfer_yolo.sh
if [ $? -ne 0 ]; then
echo "Failed to compile nvdsinfer_yolo function."
exit 1
fi
# Apply the patch to the nvinfer library
cd /apps/deepstream-yolo-e2e/TensorRTPlugin || exit
bash ./patch_libnvinfer.sh
if [ $? -ne 0 ]; then
echo "Failed to apply patch to the nvinfer library."
exit 1
fi
# Install ffmpeg and yt-dlp
apt-get install ffmpeg -y
if [ $? -ne 0 ]; then
echo "Failed to install ffmpeg."
exit 1
fi
pip3 install yt-dlp prettytable
if [ $? -ne 0 ]; then
echo "Failed to install yt-dlp and prettytable."
exit 1
fi
# Clear the screen at the end
clear
echo "All components have been installed successfully."