-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart_app.sh
More file actions
executable file
·107 lines (89 loc) · 3.02 KB
/
start_app.sh
File metadata and controls
executable file
·107 lines (89 loc) · 3.02 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash -e
#######################################################################################################################
# This script runs the Curation application
#######################################################################################################################
# DEFAULT VARIABLES
INGESTION="object,face"
EXP_TYPE=compose
DEBUG="0"
DEVICE="CPU"
DOCKER_TAR="0"
RESIZE_FLAG="False"
OMIT_DETECTIONS_FLAG="False"
MODEL_NAME=""
DIR=$(dirname $(readlink -f "$0"))
BUILD_DIR=$DIR/build
LONG_LIST=(
"ingestion:"
"type:"
"resize"
"model:"
"omit-det"
"debug"
"device:"
"tars"
)
OPTS=$(getopt \
--longoptions "$(printf "%s," "${LONG_LIST[@]}")" \
--name "$(basename "$0")" \
--options "hdlozi:t:m:e:" \
-- "$@"
)
eval set -- $OPTS
if [ -d "$BUILD_DIR" ]; then
rm -rf $BUILD_DIR
fi
mkdir -p $BUILD_DIR
#######################################################################################################################
# GET SCRIPT OPTIONS
script_usage()
{
cat <<EOF
This script runs the Video Curation Streaming Application
Usage: $0 [ options ]
Options:
-h optional Print this help message
-d or --debug optional Flag to enable debug messages
-e or --device optional Device for inference (CPU, GPU) [Default: CPU]
-i or --ingestion optional Ingestion type (object, face) [Default: "object,face"]
-l or --tars optional Flag to load docker images instead of building from Dockerfiles
-m or --model optional Custom YOLO model name (<model name>.pt). If not provided model YOLO11n is used.
-o or --omit-det optional By default, object detections are printed. To omit printing detections to screen, enable flag.
-t or --type optional Deployment method (compose) [Default: compose]
-z or --resize optional Flag to resize video to model input size
EOF
}
while true; do
case "$1" in
-h) script_usage; exit 0 ;;
-d | --debug) shift; DEBUG="1" ;;
-l | --tars) shift; DOCKER_TAR="1" ;;
-e | --device) shift; DEVICE=$1; shift ;;
-i | --ingestion) shift; INGESTION=$1; shift ;;
-m | --model) shift; MODEL_NAME=$1; shift ;;
-t | --type) shift; EXP_TYPE="$1"; shift ;;
-z | --resize) shift; RESIZE_FLAG="True" ;;
-o | --omit-det) shift; OMIT_DETECTIONS_FLAG="True" ;;
--) shift; break ;;
*) script_usage; exit 0 ;;
esac
done
#######################################################################################################################
# BUILD AND START APP
cd $BUILD_DIR
cmake \
-DDEBUG=$DEBUG \
-DDEVICE=$DEVICE \
-DDOCKER_TAR=$DOCKER_TAR \
-DINGESTION=$INGESTION \
-DMODEL_NAME=$MODEL_NAME \
-DOMIT_DETECTIONS_FLAG=$OMIT_DETECTIONS_FLAG \
-DRESIZE_FLAG=$RESIZE_FLAG \
..
make
if [ $EXP_TYPE == "compose" ]; then
make start_docker_compose
else
echo "INVALID TYPE: ${EXP_TYPE}"
fi
cd $DIR