Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 27 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=1)

# Disable in-source builds to prevent source tree corruption.
if(" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "
message(FATAL_ERROR "
FATAL: In-source builds are not allowed.
You should create a separate directory for build files.
If you think this error is wrong, try clearing cache:
Expand Down Expand Up @@ -57,7 +57,7 @@ project(obcpp VERSION 1.0)
set(LOGURU_WITH_STREAMS TRUE)

# =============================
# Dependencies
# Dependencies
set(FETCHCONTENT_QUIET FALSE)
set(DEPS_DIRECTORY ${PROJECT_SOURCE_DIR}/deps)

Expand Down Expand Up @@ -103,11 +103,11 @@ add_definitions( -DMAGICKCORE_HDRI_ENABLE=0 )

find_package(ImageMagick COMPONENTS Magick++ REQUIRED)
# =============================
# Build speed up
# Build speed up

# function to enable unity build for a target
function(set_unity_for_target target_name)
set_target_properties(${target_name} PROPERTIES UNITY_BUILD ON UNITY_BUILD_MODE BATCH UNITY_BUILD_BATCH_SIZE 16 UNITY_BUILD_UNIQUE_ID "MY_UNITY_ID")
set_target_properties(${target_name} PROPERTIES UNITY_BUILD ON UNITY_BUILD_MODE BATCH UNITY_BUILD_BATCH_SIZE 16 UNITY_BUILD_UNIQUE_ID "MY_UNITY_ID")
endfunction()

# =============================
Expand All @@ -120,6 +120,22 @@ add_subdirectory(src)
# =============================
# Integration tests

add_subdirectory(tests/integration)

# cuda_check
add_executable(cuda_check ${SOURCES} tests/integration/cuda_check.cpp)
target_add_torch(cuda_check)
target_add_json(cuda_check)
target_add_httplib(cuda_check)
target_add_mavsdk(cuda_check)
target_add_matplot(cuda_check)
target_add_protobuf(cuda_check)
target_add_opencv(cuda_check)
target_add_loguru(cuda_check)
# for some reason calling target_add_imagemagick here conflicts with, so we are including/linking without the function call
# target_add_imagemagick(cuda_check)
target_include_directories(cuda_check PRIVATE ${ImageMagick_INCLUDE_DIRS})
target_link_libraries(cuda_check PRIVATE -Wl,--copy-dt-needed-entries ${ImageMagick_LIBRARIES})

# =============================

Expand All @@ -131,7 +147,7 @@ add_subdirectory(${DEPS_DIRECTORY}/google-test)

# =============================
# Pull models
add_custom_target(pull_models
add_custom_target(pull_models
DEPENDS pull_saliency pull_matching pull_segmentation
)

Expand All @@ -141,7 +157,7 @@ add_custom_target(pull_saliency
USES_TERMINAL
)

# Matching model
# Matching model
add_custom_target(pull_matching
COMMAND gdown 1NeFiAfSSLXAZWlehfd0ox7p_jFF4YdrO -O ${CMAKE_BINARY_DIR}/../models/target_siamese_1.pt
USES_TERMINAL
Expand All @@ -158,7 +174,7 @@ add_custom_target(pull_segmentation
# =============================
# Pull testing images
add_custom_target(pull_test_images
DEPENDS pull_matching_test_images pull_saliency_test_images
DEPENDS pull_matching_test_images pull_saliency_test_images
)

# pull cropped images from fraternal_targets testing folder
Expand All @@ -176,13 +192,13 @@ add_custom_target(pull_saliency_test_images
# =============================

# =============================
# Linting
# Linting

# Adding lint target if cpplint executable is found
find_program(CPPLINT "cpplint")
if(CPPLINT)
# define lint target
add_custom_target(lint
# define lint target
add_custom_target(lint
COMMAND cpplint
# Do not require licenses, TODO assignment, Google versions of C++ libs
# also don't check for runtime/references since Google's public style guidelines are behind https://github.com/cpplint/cpplint/issues/148
Expand All @@ -195,6 +211,6 @@ if(CPPLINT)
../include
)
else()
message(FATAL_ERROR "cpplint executable not found. Check the README for steps to install it on your system")
message(FATAL_ERROR "cpplint executable not found. Check the README for steps to install it on your system")
endif()
# =============================
7 changes: 5 additions & 2 deletions include/cv/classification.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#ifndef INCLUDE_CV_CLASSIFICATION_HPP_
#define INCLUDE_CV_CLASSIFICATION_HPP_

#include "cv/utilities.hpp"
#include <torch/torch.h>
#include "cv/segmentation.hpp"

#include <map>
#include <string>

#include "cv/utilities.hpp"
#include "cv/segmentation.hpp"



struct ClassificationResults {
Expand Down