-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
125 lines (98 loc) · 3.46 KB
/
CMakeLists.txt
File metadata and controls
125 lines (98 loc) · 3.46 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
cmake_minimum_required (VERSION 2.8)
Project(library_curation NONE)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_HOME_DIRECTORY}/dist")
set(EMPTY " ")
if (NOT DEFINED REGISTRY)
set(REGISTRY "${EMPTY}")
elseif (NOT ${REGISTRY} MATCHES "/$")
set(REGISTRY "${REGISTRY}/")
endif()
if(MODEL_NAME STREQUAL "")
set(MODEL_NAME "yolo11n")
endif()
if (MODEL_NAME STREQUAL "yolo11n")
set(CUSTOM_MODEL_FLAG "False")
else()
set(CUSTOM_MODEL_FLAG "True")
endif()
if (NOT DEFINED PLATFORM)
set(PLATFORM "Xeon")
endif()
if (NOT DEFINED NSTREAMS)
set(NSTREAMS 1)
endif()
if (NOT DEFINED NCURATIONS)
set(NCURATIONS 1)
endif()
if (NOT DEFINED INGESTION)
set(INGESTION "object,face")
endif()
if (NOT DEFINED DEVICE)
set(DEVICE "CPU")
endif()
if(DEVICE MATCHES "CPU")
set(NVIDIA_VISIBLE_DEVICES "all")
else()
set(NVIDIA_VISIBLE_DEVICES "none")
endif()
if (NOT DEFINED DEBUG)
set(DEBUG "0")
endif()
if (NOT DEFINED IN_SOURCE)
set(IN_SOURCE "videos") # Use videos
endif()
if (NOT DEFINED RESIZE_FLAG)
set(RESIZE_FLAG "False")
endif()
if(NOT (RESIZE_FLAG STREQUAL "True" OR RESIZE_FLAG STREQUAL "False"))
set(RESIZE_FLAG "False")
endif()
if (NOT DEFINED OMIT_DETECTIONS_FLAG)
set(OMIT_DETECTIONS_FLAG "False")
endif()
if(NOT (OMIT_DETECTIONS_FLAG STREQUAL "True" OR OMIT_DETECTIONS_FLAG STREQUAL "False"))
set(OMIT_DETECTIONS_FLAG "False")
endif()
if (NOT DEFINED NCPU)
set(NCPU 0)
endif()
if (NOT DEFINED DOCKER_TAR)
set(DOCKER_TAR "0")
endif()
if (RESIZE_FLAG STREQUAL "True")
set(DOCKER_TAR_DIR ${CMAKE_HOME_DIRECTORY}/deployment/DockerImageTars/resize)
else()
set(DOCKER_TAR_DIR ${CMAKE_HOME_DIRECTORY}/deployment/DockerImageTars/full)
endif()
if(DOCKER_TAR MATCHES "1")
set(TAR_FILES
"${DOCKER_TAR_DIR}/lcc_frontend_stream.tar"
"${DOCKER_TAR_DIR}/lcc_video_stream.${DEVICE}.tar"
"${DOCKER_TAR_DIR}/lcc_vdms_stream.tar"
"${DOCKER_TAR_DIR}/lcc_certificate_stream.tar"
)
# Check if all files exist
set(ALL_TARS_EXIST TRUE)
foreach(TAR_FILE ${TAR_FILES})
if(NOT EXISTS "${TAR_FILE}")
set(ALL_TARS_EXIST FALSE)
endif()
endforeach()
if(NOT ALL_TARS_EXIST)
message(WARNING "All required tar files do not exist.")
set(DOCKER_TAR "0")
set(DOCKER_TAR_DIR "${EMPTY}")
endif()
endif()
file(GLOB dirs "deployment" "*")
list(REMOVE_DUPLICATES dirs)
foreach (dir ${dirs})
if(EXISTS ${dir}/CMakeLists.txt)
add_subdirectory(${dir})
endif()
endforeach()
# legal message
execute_process(COMMAND printf "\n\nThis script will build third party components licensed under various open source licenses into your container images. The terms under which those components may be used and distributed can be found with the license document that is provided with those components. Please familiarize yourself with those terms to ensure your distribution of those components complies with the terms of those licenses.\n\n")
execute_process(COMMAND printf "INGESTION=${INGESTION}, DEVICE=${DEVICE}, DEBUG=${DEBUG}, RESIZE_FLAG=${RESIZE_FLAG}, OMIT_DETECTIONS_FLAG=${OMIT_DETECTIONS_FLAG}\n")
execute_process(COMMAND printf "DOCKER_TAR=${DOCKER_TAR}, DOCKER_TAR_DIR=${DOCKER_TAR_DIR}, MODEL_NAME=${MODEL_NAME}, CUSTOM_MODEL_FLAG=${CUSTOM_MODEL_FLAG}\n")
execute_process(COMMAND printf "PLATFORM=${PLATFORM}, NSTREAMS=${NSTREAMS}, NCURATIONS=${NCURATIONS}, IN_SOURCE=${IN_SOURCE}, NCPU=${NCPU}, REGISTRY=${REGISTRY}\n\n")