Skip to content

Commit 3b6455a

Browse files
authored
VDMS 2.5.0 Release (#162)
1 parent 9249408 commit 3b6455a

File tree

190 files changed

+94018
-26040
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+94018
-26040
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ build/
22
db/
33
*.gcov
44
**/__pycache__/
5+
fr_client
6+
tmp
7+
*.onnx
58

69
# VS Code Specific
710
.devcontainer
8-
.vscode
11+
.vscode
12+
.coverage

CMakeLists.txt

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
cmake_minimum_required (VERSION 3.17)
2+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
3+
set(CMAKE_CXX_STANDARD 17)
24

35
IF(CODE_COVERAGE)
46
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -Wall -coverage -fprofile-arcs -ftest-coverage")
@@ -7,15 +9,17 @@ IF(CODE_COVERAGE)
79
ENDIF()
810

911
project(vdms_application)
10-
add_compile_options(-g -fPIC)
12+
add_compile_options(-g -fPIC -std=c++17)
1113

1214
find_package( OpenCV REQUIRED )
1315
find_package(Protobuf REQUIRED)
16+
find_package( CURL REQUIRED )
17+
find_package(AWSSDK REQUIRED COMPONENTS core s3)
1418

1519
include_directories(${Protobuf_INCLUDE_DIRS})
1620
include_directories(${CMAKE_CURRENT_BINARY_DIR})
1721

18-
execute_process(COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/utils/src/api_schema/createApiString.py ${CMAKE_CURRENT_SOURCE_DIR}/utils/src/api_schema/api_schema.json ${CMAKE_CURRENT_BINARY_DIR}/APISchema.h)
22+
execute_process(COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/utils/src/api_schema/createApiString.py ${CMAKE_CURRENT_SOURCE_DIR}/utils/src/api_schema/api_schema.json ${CMAKE_CURRENT_BINARY_DIR}/APISchema.h)
1923
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS utils/src/protobuf/partitionerMessages.proto utils/src/protobuf/pmgdMessages.proto utils/src/protobuf/queryMessage.proto)
2024
add_library(vdms_protobuf SHARED ${PROTO_SRCS} ${PROTO_HDRS})
2125

@@ -28,7 +32,6 @@ if (CLIENT)
2832
add_subdirectory(utils)
2933
add_subdirectory(client/cpp)
3034

31-
3235
else()
3336
add_subdirectory(src/pmgd)
3437
add_subdirectory(utils)
@@ -41,29 +44,29 @@ else()
4144
link_directories(/usr/local/lib /usr/lib/x86_64-linux-gnu/)
4245
include_directories(/usr/include/jsoncpp utils/include/ src/pmgd/include src/pmgd/util include/ src/vcl /usr/include ${CMAKE_CURRENT_BINARY_DIR}/utils/src/protobuf)
4346
add_library(dms SHARED
44-
src/BoundingBoxCommand.cc
45-
src/BlobCommand.cc
46-
src/CommunicationManager.cc
47-
src/DescriptorsCommand.cc
48-
src/DescriptorsManager.cc
49-
src/ExceptionsCommand.cc
50-
src/ImageCommand.cc
51-
src/PMGDIterators.cc
52-
src/PMGDQuery.cc
53-
src/PMGDQueryHandler.cc
54-
src/QueryHandler.cc
55-
src/QueryMessage.cc
56-
src/RSCommand.cc
57-
src/SearchExpression.cc
58-
src/Server.cc
59-
src/VDMSConfig.cc
60-
src/VideoCommand.cc
61-
src/AutoDeleteNode.cc
62-
${PROTO_SRCS} ${PROTO_HDRS}
63-
)
64-
target_link_libraries(dms vcl pmgd pmgd-util protobuf vdms-utils pthread)
65-
47+
src/BoundingBoxCommand.cc
48+
src/BlobCommand.cc
49+
src/CommunicationManager.cc
50+
src/DescriptorsCommand.cc
51+
src/DescriptorsManager.cc
52+
src/ExceptionsCommand.cc
53+
src/ImageCommand.cc
54+
src/PMGDIterators.cc
55+
src/PMGDQuery.cc
56+
src/PMGDQueryHandler.cc
57+
src/QueryHandler.cc
58+
src/QueryMessage.cc
59+
src/RSCommand.cc
60+
src/SearchExpression.cc
61+
src/Server.cc
62+
src/VDMSConfig.cc
63+
src/VideoCommand.cc
64+
src/AutoDeleteNode.cc
65+
src/ImageLoop.cc
66+
${PROTO_SRCS} ${PROTO_HDRS}
67+
)
68+
target_link_libraries(dms vcl pmgd pmgd-util protobuf tbb tiledb vdms-utils pthread -lcurl -lzmq ${AWSSDK_LINK_LIBRARIES})
6669

6770
add_executable(vdms src/vdms.cc)
68-
target_link_libraries(vdms dms vdms_protobuf vcl tiledb faiss flinng jsoncpp ${OpenCV_LIBS})
71+
target_link_libraries(vdms dms vdms_protobuf vcl tiledb faiss flinng jsoncpp ${OpenCV_LIBS} ${AWSSDK_LINK_LIBRARIES})
6972
endif ()

INSTALL.md

Lines changed: 105 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -2,117 +2,113 @@
22
Here is the detailed process of installation of VDMS dependencies.
33

44
## Dependencies
5-
Here we will install the Ubuntu 20.04 and Python3 packages. We assume `python`/`pip` is an alias for `python3`/`pip3`. If your system has both Python 2 and Python 3, please replace all pip and python commands with pip3 and python3, respectively.
5+
To install VDMS, we must install the necessary dependencies via apt, github, and pip.
6+
7+
### Install Debian Packages
8+
Here we will install the Debian and Python3 packages.
69
```bash
710
sudo apt-get update
8-
sudo apt-get -y install --no-install-recommends software-properties-common
9-
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu focal-security main"
10-
sudo apt-get -y install --no-install-recommends apt-transport-https autoconf automake bison build-essential \
11-
bzip2 ca-certificates curl=7.68.0-1ubuntu2.18 ed flex g++ git gnupg-agent javacc libarchive-tools \
12-
libatlas-base-dev libavcodec-dev libavformat-dev libboost-all-dev libbz2-dev \
13-
libc-ares-dev libdc1394-22-dev libgflags-dev libgoogle-glog-dev libgtest-dev \
14-
libgtk-3-dev libgtk2.0-dev libhdf5-serial-dev libjpeg-dev libjpeg8-dev libjsoncpp-dev \
15-
libleveldb-dev liblmdb-dev liblz4-dev libopenblas-dev libopenmpi-dev \
16-
libpng-dev librdkafka-dev libsnappy-dev libssl-dev libswscale-dev libtbb-dev \
17-
libtbb2 libtiff-dev libtiff5-dev libtool mpich openjdk-11-jdk-headless \
18-
pkg-config python3-dev python3-pip unzip
19-
pip install --no-cache-dir "numpy>=1.23.2" "setuptools>=65.5.1"
20-
```
21-
### Clone/Download Dependencies
22-
Here we clone the repositories for grpc v1.40.0, libpng12, Swig v4.0.2, OpenCV 4.5.3, Valijson v0.6, CMake v3.21.2, Faiss v1.7.1, and FLINNG. Then download necesarry files for zlib v1.2.13, Json-simple v1.1.1, and TileDB v1.3.1.
23-
Here we assume `$VDMS_DEP_DIR` is the working directory for installing dependencies and `python` is Python 3.
11+
sudo apt-get install -y --no-install-suggests --no-install-recommends \
12+
apt-transport-https autoconf automake bison build-essential bzip2 ca-certificates \
13+
curl ed flex g++-9 gcc-9 git gnupg-agent javacc libarchive-tools libatlas-base-dev \
14+
libavcodec-dev libavformat-dev libboost-all-dev libbz2-dev libc-ares-dev libcurl4-openssl-dev \
15+
libdc1394-22-dev libgflags-dev libgoogle-glog-dev libgtest-dev libgtk-3-dev libgtk2.0-dev \
16+
libhdf5-dev libjpeg-dev libjpeg62-turbo-dev libjsoncpp-dev libleveldb-dev liblmdb-dev \
17+
liblz4-dev libopenblas-dev libopenmpi-dev libpng-dev librdkafka-dev libsnappy-dev libssl-dev \
18+
libswscale-dev libtbb-dev libtbb2 libtiff-dev libtiff5-dev libtool libzmq3-dev mpich \
19+
openjdk-11-jdk-headless pkg-config procps python3-dev python3-pip software-properties-common \
20+
swig unzip uuid-dev
21+
```
22+
Note: Your system may have g++ or gcc version 10+. If this is the case, please use version 9 to build VDMS. Optional method for setting version 9 as default:
23+
```bash
24+
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 1
25+
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 1
26+
```
27+
28+
### Install Remaining Dependencies
29+
Here we assume `$VDMS_DEP_DIR` is the directory for installing additional dependencies.
30+
This directory is user-defined but here we use `/dependencies`.
31+
These instructions assume you have full permissions to your system.
32+
If not running as root, add `sudo` where necessary.
2433
```bash
25-
cd $VDMS_DEP_DIR
26-
git clone --branch v3.21.2 https://github.com/Kitware/CMake.git && \
27-
git clone --branch v4.0.2 https://github.com/swig/swig.git && \
28-
git clone --branch v1.7.1 https://github.com/facebookresearch/faiss.git && \
29-
git clone https://github.com/tonyzhang617/FLINNG.git && \
30-
git clone --recurse-submodules -b v1.40.0 https://github.com/grpc/grpc.git && \
31-
git clone --branch 4.5.3 https://github.com/opencv/opencv.git && \
32-
git clone --branch v0.6 https://github.com/tristanpenman/valijson.git
34+
VDMS_DEP_DIR=/dependencies # Set to any directory
35+
BUILD_THREADS="-j`nproc`"
36+
mkdir -p $VDMS_DEP_DIR
37+
```
3338

34-
sudo curl -L -o /usr/share/java/json-simple-1.1.1.jar https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/json-simple/json-simple-1.1.1.jar && \
35-
sudo curl -L -o 1.3.1.tar.gz https://github.com/TileDB-Inc/TileDB/archive/refs/tags/1.3.1.tar.gz && \
36-
sudo curl -L -o zlib-1.2.13.tar.gz http://zlib.net/zlib-1.2.13.tar.gz
39+
#### Python3 Packages
40+
Here we will install the necessary Python3 packages Numpy and Protobuf 3.20.3.
41+
You can also install the coverage package if interested in running the Python unit tests.
42+
```bash
43+
PROTOBUF_VERSION="3.20.3"
44+
pip3 install --no-cache-dir "numpy>=1.25.1" "protobuf==${PROTOBUF_VERSION}" "coverage>=7.2.7"
3745
```
3846

39-
### Install Dependencies
40-
These instructions assume you have full permissions to your system.
41-
If running as root, remove `sudo` where necessary.
4247

43-
#### CMAKE
48+
#### CMAKE v3.26.4
49+
VDMS requires CMake v3.21+. Here we install CMake v3.26.4.
4450
```bash
45-
cd $VDMS_DEP_DIR/CMake && ./bootstrap
46-
make -j && sudo make install
51+
CMAKE_VERSION="v3.26.4"
52+
git clone --branch ${CMAKE_VERSION} https://github.com/Kitware/CMake.git $VDMS_DEP_DIR/CMake
53+
cd $VDMS_DEP_DIR/CMake
54+
./bootstrap
55+
make ${BUILD_THREADS}
56+
make install
4757
```
4858

49-
### Swig
59+
### gtest
60+
Unfortunately apt doesn't build gtest so you need to do the following:
5061
```bash
51-
cd $VDMS_DEP_DIR/swig
52-
./autogen.sh && ./configure
53-
make -j && sudo make install
62+
cd /usr/src/gtest/
63+
cmake .
64+
make ${BUILD_THREADS}
65+
mv lib/libgtest* /usr/lib
5466
```
5567

56-
### Faiss
68+
### Faiss v1.7.3
5769
```bash
70+
FAISS_VERSION="v1.7.3"
71+
git clone --branch ${FAISS_VERSION} https://github.com/facebookresearch/faiss.git $VDMS_DEP_DIR/faiss
5872
cd $VDMS_DEP_DIR/faiss
5973
mkdir build && cd build
6074
cmake -DFAISS_ENABLE_GPU=OFF ..
61-
make -j && sudo make install
75+
make ${BUILD_THREADS}
76+
make install
6277
```
6378

6479
### FLINNG
6580
```bash
81+
git clone https://github.com/tonyzhang617/FLINNG.git $VDMS_DEP_DIR/FLINNG
6682
cd $VDMS_DEP_DIR/FLINNG
6783
mkdir build && cd build
6884
cmake ..
69-
make -j && sudo make install
85+
make ${BUILD_THREADS}
86+
make install
7087
```
7188

72-
### grpc
89+
### Protobuf 3.20.3
7390
```bash
74-
cd $VDMS_DEP_DIR/grpc
75-
pip install --no-cache-dir -r requirements.txt
76-
GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install --no-cache-dir .
77-
78-
cd tools/distrib/python/grpcio_tools
79-
python ../make_grpcio_tools.py
80-
GRPC_PYTHON_BUILD_WITH_CYTHON=1 pip install --no-cache-dir .
81-
82-
cd $VDMS_DEP_DIR/grpc/third_party/zlib/ && mkdir build && cd build
83-
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ..
84-
make -j && sudo make install
85-
86-
cd $VDMS_DEP_DIR/grpc/third_party/protobuf/cmake
87-
mkdir build && cd build
88-
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -Dprotobuf_BUILD_TESTS=OFF ..
89-
make -j && sudo make install
90-
91-
cd ../../../abseil-cpp && mkdir build && cd build
92-
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ..
93-
make -j && sudo make install
94-
95-
cd ../../re2/ && mkdir build && cd build
96-
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ..
97-
make -j && sudo make install
98-
99-
cd $VDMS_DEP_DIR/grpc/cmake && mkdir build && cd build
100-
cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DgRPC_ABSL_PROVIDER=package \
101-
-DgRPC_CARES_PROVIDER=package -DgRPC_PROTOBUF_PROVIDER=package \
102-
-DgRPC_RE2_PROVIDER=package -DgRPC_SSL_PROVIDER=package \
103-
-DgRPC_ZLIB_PROVIDER=package -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ../..
104-
make -j && sudo make install
91+
PROTOBUF_VERSION="3.20.3"
92+
curl -L -o ${VDMS_DEP_DIR}/${PROTOBUF_VERSION}.tar.gz https://github.com/protocolbuffers/protobuf/archive/refs/tags/v${PROTOBUF_VERSION}.tar.gz
93+
cd ${VDMS_DEP_DIR} && tar -xvf ${PROTOBUF_VERSION}.tar.gz
94+
cd protobuf-${PROTOBUF_VERSION}
95+
./autogen.sh
96+
./configure
97+
make ${BUILD_THREADS}
98+
make install
99+
ldconfig
105100
```
106101

107-
### [OpenCV](https://opencv.org/)
108-
109-
Below are instructions for installing ***OpenCV v4.5.3***. It may also work with newer versions of OpenCV.
102+
### [OpenCV](https://opencv.org/) 4.5.5
103+
Below are instructions for installing ***OpenCV v4.5.5***.
110104
```bash
105+
OPENCV_VERSION="4.5.5"
106+
git clone --branch ${OPENCV_VERSION} https://github.com/opencv/opencv.git $VDMS_DEP_DIR/opencv
111107
cd $VDMS_DEP_DIR/opencv
112108
mkdir build && cd build
113-
cmake -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF ..
114-
make -j
115-
sudo make install
109+
cmake -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF ..
110+
make ${BUILD_THREADS}
111+
make install
116112
```
117113

118114
**Note**: When using videos, and getting the following error: "Unable to stop the stream: Inappropriate ioctl for device", you may need to include more flags when compiling OpenCV. Follow these instructions ([source](https://stackoverflow.com/questions/41200201/opencv-unable-to-stop-the-stream-inappropriate-ioctl-for-device)):
@@ -124,51 +120,51 @@ cmake -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D CMAKE_BUILD_TYPE=RELEASE -D
124120
-D WITH_FFMPEG=ON -D WITH_TBB=ON -D WITH_GTK=ON \
125121
-D WITH_V4L=ON -D WITH_OPENGL=ON -D WITH_CUBLAS=ON \
126122
-DWITH_QT=OFF -DCUDA_NVCC_FLAGS="-D_FORCE_INLINES" ..
127-
make -j
123+
make ${BUILD_THREADS}
128124
make install
129125
```
130126

131-
### Zlib
127+
### Valijson v0.6
128+
This is a headers-only library, no compilation/installation necessary
132129
```bash
133-
cd $VDMS_DEP_DIR && tar -xvzf zlib-1.2.13.tar.gz
134-
cd zlib-1.2.13 && ./configure
135-
make -j && sudo make install
130+
VALIJSON_VERSION="v0.6"
131+
git clone --branch ${VALIJSON_VERSION} https://github.com/tristanpenman/valijson.git $VDMS_DEP_DIR/valijson
132+
cd $VDMS_DEP_DIR/valijson
133+
cp -r include/* /usr/local/include/
136134
```
137135

138-
### [TileDB](https://tiledb.io/)
139-
VDMS works with ***TileDB v1.3.1.***<br>
140-
The directions below will help you install TileDB v1.3.1 from the source.
141-
You can also follow the directions listed
142-
[here](https://docs.tiledb.io/en/latest/installation.html).
143-
```bash
144-
cd $VDMS_DEP_DIR && tar -xvf 1.3.1.tar.gz
145-
cd TileDB-1.3.1 && mkdir build && cd build
146-
../bootstrap --prefix=/usr/local/
147-
make -j && sudo make install-tiledb
148-
```
149136

150-
### gtest
151-
Unfortunately apt doesn't build gtest;
152-
you need to do the following steps to get it to work correctly:
137+
### [TileDB](https://tiledb.io/) 2.14.1
138+
The directions below will help you install TileDB v2.14.1 from the source.
139+
You can also follow the directions listed [here](https://docs.tiledb.io/en/latest/installation.html).
153140
```bash
154-
cd /usr/src/gtest/
155-
sudo cmake .
156-
sudo make -j
157-
sudo mv lib/libgtest* /usr/lib
141+
TILEDB_VERSION="2.14.1"
142+
curl -L -o $VDMS_DEP_DIR/${TILEDB_VERSION}.tar.gz https://github.com/TileDB-Inc/TileDB/archive/refs/tags/${TILEDB_VERSION}.tar.gz && \
143+
cd $VDMS_DEP_DIR
144+
tar -xvf ${TILEDB_VERSION}.tar.gz
145+
cd TileDB-${TILEDB_VERSION}
146+
mkdir build && cd build
147+
../bootstrap --prefix=/usr/local/
148+
make ${BUILD_THREADS}
149+
make install-tiledb
158150
```
159151

160-
### Valijson
161-
This is a headers-only library, no compilation/installation necessary
152+
### AWS SDK CPP 1.11.0
162153
```bash
163-
cd $VDMS_DEP_DIR/valijson
164-
sudo cp -r include/* /usr/local/include
154+
AWS_SDK_VERSION="1.11.0"
155+
git clone -b ${AWS_SDK_VERSION} --recurse-submodules https://github.com/aws/aws-sdk-cpp ${VDMS_DEP_DIR}/aws-sdk-cpp
156+
mkdir -p ${VDMS_DEP_DIR}/aws-sdk-cpp/build
157+
cd ${VDMS_DEP_DIR}/aws-sdk-cpp/build
158+
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local/ -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBUILD_ONLY="s3" -DCUSTOM_MEMORY_MANAGEMENT=OFF
159+
make ${BUILD_THREADS}
160+
make install
165161
```
166162

167163
## Install VDMS
168164
This version of VDMS treats PMGD as a submodule so both libraries are compiled at one time. After entering the vdms directory, the command `git submodule update --init --recursive` will pull pmgd into the appropriate directory. Furthermore, Cmake is used to compile all directories.
169165
```bash
170-
git clone https://github.com/IntelLabs/vdms.git
171-
cd vdms && git checkout develop
166+
git clone -b develop https://github.com/IntelLabs/vdms.git
167+
cd vdms
172168
git submodule update --init --recursive
173169
```
174170

@@ -186,3 +182,4 @@ mkdir build && cd build
186182
cmake -DCMAKE_CXX_FLAGS='-DPM' ..
187183
make -j
188184
```
185+

0 commit comments

Comments
 (0)