The main component of the SOMHunter tool. All models and all the logic is inside this component. Other components can be substituted with other implementetions because the core uses HTTP server (OpenAPI) as its interface. Optionally, you can use the core natively as a C++ class (class Somhunter
).
# Build the container
sudo docker build -t somhunter-core .
# Install the core
sudo docker run -ti --rm -v ${PWD}:/somhunter-core somhunter-core:latest sh install.sh RelWithDebugInfo
# Run it on port 8082
sudo docker run -ti --rm -v ${PWD}:/somhunter-core -p 8082:8082 somhunter-core:latest sh run.sh
libcurl
- https://curl.se/libcurl/OpenCV
- https://opencv.org/cpprestsdk
- https://github.com/microsoft/cpprestsdklibtorch
- https://pytorch.org/- (this will be downloaded and installed during CMake script execution, you shouldn't worry about this)
Because Windows does not have a unified package manager with dev packages, you need to provide the dependency libraries manually OR use some other package manager. We recommend using vcpkg for dependency management. It works quite well with CMake (and also on Linux distros).
- Download and install
vcpkg
- Install required dependencies for your architecture and system (e.g. for x64 windows)
./vcpkg install curl:x64-windows opencv4:x64-windows cpprestsdk:x64-windows openssl:x64-windows
- Get path to the CMake toolchain file
./vcpkg integrate install
# This will output how to tell CMake about this. Something like
CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE="c:/vcpkg/scripts/buildsystems/vcpkg.cmake"
Now just run CMake as usual with this additional option. An example for VS 2019 solution may look like this:
mkdir build
cd build
# Debug
cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="~/source/repos/vcpkg/scripts/buildsystems/vcpkg.cmake"
# Release
cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="~/source/repos/vcpkg/scripts/buildsystems/vcpkg.cmake"
Just use Visual Studio, or
cmake --build . --config Debug
cmake --build . --config Release
You should be able to install all dependencies from the package management. On Debian-based systems (including Ubuntu and Mint) the following should work:
Similar (similarly named) packages should be available on most other distributions.
# Install dependencies
apt-get install build-essential libcurl4-openssl-dev libopencv-dev libcpprest-dev
mkdir build && cd build
# Debug
cmake .. -DCMAKE_BUILD_TYPE="Debug"
# Release
cmake .. -DCMAKE_BUILD_TYPE="Release"
make -j
API documentation is available at <server_address>/api/
(e.g. http://localhost:8082/api/). It requires the running core.
The pre-built version is available here.
doxygen doxygen.cfg
The attached dataset is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
For more information, please see: https://ftp.itec.aau.at/datasets/short-casual-videos/
During the installation, the script will download two third-party models. You will be prompted to accept this. You need to check that the way you're about to use them is OK with their respective licenses.
-
ResNext101: Mettes, P., Koelma, D. C., & Snoek, C. G. (2020). Shuffled ImageNet Banks for Video Event Detection and Search. ACM Transactions on Multimedia Computing, Communications, and Applications (TOMM), 16(2), 1-21.
-
ResNet152: https://mxnet.incubator.apache.org/versions/1.9.0/
Do you have Python 3 installed? Maybe you don't have it aliased on python
command. Consider aliasing it (or use something like apt install python-is-pyton3
).