)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-inference.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-set(PC_NAME ${fw_name}-object-detection)
-set(PC_LDFLAGS "-l${MV_OBJECT_DETECTION_LIB_NAME} -l${MV_COMMON_LIB_NAME}")
-configure_file(
- ${fw_name}.pc.in
- ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-object-detection.pc
- @ONLY
-)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-object-detection.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mv_machine_learning/object_detection/meta/object_detection.json DESTINATION ${CMAKE_INSTALL_DATADIR}/${fw_name})
+if (${ENABLE_ML_OBJECT_DETECTION})
+ set(PC_NAME ${fw_name}-object-detection)
+ set(PC_LDFLAGS "-l${MV_OBJECT_DETECTION_LIB_NAME} -l${MV_COMMON_LIB_NAME}")
+ configure_file(
+ ${fw_name}.pc.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-object-detection.pc
+ @ONLY
+ )
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-object-detection.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mv_machine_learning/object_detection/meta/object_detection.json DESTINATION ${CMAKE_INSTALL_DATADIR}/${fw_name})
+endif()
-set(PC_NAME ${fw_name}-object-detection-3d)
-set(PC_LDFLAGS "-l${MV_OBJECT_DETECTION_3D_LIB_NAME} -l${MV_COMMON_LIB_NAME}")
-configure_file(
- ${fw_name}.pc.in
- ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-object-detection-3d.pc
- @ONLY
-)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-object-detection-3d.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mv_machine_learning/object_detection_3d/meta/object_detection_3d.json DESTINATION ${CMAKE_INSTALL_DATADIR}/${fw_name})
+if (${ENABLE_ML_OBJECT_DETECTION_3D})
+ set(PC_NAME ${fw_name}-object-detection-3d)
+ set(PC_LDFLAGS "-l${MV_OBJECT_DETECTION_3D_LIB_NAME} -l${MV_COMMON_LIB_NAME}")
+ configure_file(
+ ${fw_name}.pc.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-object-detection-3d.pc
+ @ONLY
+ )
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-object-detection-3d.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mv_machine_learning/object_detection_3d/meta/object_detection_3d.json DESTINATION ${CMAKE_INSTALL_DATADIR}/${fw_name})
+endif()
-set(PC_NAME ${fw_name}-image-classification)
-set(PC_LDFLAGS "-l${MV_IMAGE_CLASSIFICATION_LIB_NAME} -l${MV_COMMON_LIB_NAME}")
-configure_file(
- ${fw_name}.pc.in
- ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-image-classification.pc
- @ONLY
-)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-image-classification.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mv_machine_learning/image_classification/meta/image_classification.json DESTINATION ${CMAKE_INSTALL_DATADIR}/${fw_name})
+if (${ENABLE_ML_IMAGE_CLASSIFICATION})
+ set(PC_NAME ${fw_name}-image-classification)
+ set(PC_LDFLAGS "-l${MV_IMAGE_CLASSIFICATION_LIB_NAME} -l${MV_COMMON_LIB_NAME}")
+ configure_file(
+ ${fw_name}.pc.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-image-classification.pc
+ @ONLY
+ )
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-image-classification.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mv_machine_learning/image_classification/meta/image_classification.json DESTINATION ${CMAKE_INSTALL_DATADIR}/${fw_name})
+endif()
if (${ENABLE_ML_FACE_RECOGNITION})
set(PC_NAME ${fw_name}-training)
add_subdirectory(inference)
-add_subdirectory(image_classification)
-add_subdirectory(object_detection)
-add_subdirectory(object_detection_3d)
+
+if (${ENABLE_ML_IMAGE_CLASSIFICATION})
+ message("Enabled machine learning image classification task group.")
+ add_subdirectory(image_classification)
+endif()
+if (${ENABLE_ML_OBJECT_DETECTION})
+ message("Enabled machine learning object detection task group.")
+ add_subdirectory(object_detection)
+endif()
+if (${ENABLE_ML_OBJECT_DETECTION_3D})
+ message("Enabled machine learning object detection 3d task group.")
+ add_subdirectory(object_detection_3d)
+endif()
if (${ENABLE_ML_FACE_RECOGNITION})
message("Enabled machine learning face recognition feature.")
BuildRequires: pkgconfig(training-engine-interface-common)
Requires: training-engine-interface-common
+%define enable_ml_image_classification 1
+%define enable_ml_object_detection 1
+%define enable_ml_object_detection_3d 1
+
%define build_depth_stream_testsuite 1
BuildRequires: pkgconfig(vision-source)
%ifarch aarch64
BuildRequires: Open3D-devel
%endif
%endif
-%define build_options -DENABLE_INFERENCE_PROFILER=0 -DENABLE_ML_FACE_RECOGNITION=%{enable_ml_face_recognition} -DBUILD_DEPTH_STREAM_TESTSUITE=%{build_depth_stream_testsuite} -DMV_3D_POINTCLOUD_IS_AVAILABLE=%{enable_mv3d_pointcloud}
-
+%define build_options -DENABLE_INFERENCE_PROFILER=0 -DBUILD_DEPTH_STREAM_TESTSUITE=%{build_depth_stream_testsuite} -DMV_3D_POINTCLOUD_IS_AVAILABLE=%{enable_mv3d_pointcloud}
+%define task_group_options -DENABLE_ML_FACE_RECOGNITION=%{enable_ml_face_recognition} -DENABLE_ML_IMAGE_CLASSIFICATION=%{enable_ml_image_classification} -DENABLE_ML_OBJECT_DETECTION=%{enable_ml_object_detection} -DENABLE_ML_OBJECT_DETECTION_3D=%{enable_ml_object_detection_3d}
Requires: %{name}-machine_learning
Requires: inference-engine-interface-common
%if !0%{?ml_only:1}
export LDFLAGS+=" -lgcov"
%endif
-%cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo %{build_options} \
+%cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo %{build_options} %{task_group_options} \
%if 0%{?ml_only:1}
-DBUILD_ML_ONLY=ON \
%endif
%manifest %{name}.manifest
%license LICENSE.APLv2 LICENSE.BSD-3-Clause
%{_libdir}/libmv_inference*.so
+%if "%{enable_ml_object_detection}" == "1"
%{_datadir}/%{name}/object_detection.json
-%{_libdir}/libmv_object_detection*.so
+%{_libdir}/libmv_object_detection.so
+%endif
+%if "%{enable_ml_object_detection_3d}" == "1"
%{_datadir}/%{name}/object_detection_3d.json
-%{_libdir}/libmv_object_detection_3d*.so
+%{_libdir}/libmv_object_detection_3d.so
+%endif
+%if "%{enable_ml_image_classification}" == "1"
%{_datadir}/%{name}/image_classification.json
-%{_libdir}/libmv_image_classification*.so
+%{_libdir}/libmv_image_classification.so
+%endif
%if "%{enable_ml_face_recognition}" == "1"
%{_datadir}/%{name}/face_recognition.json
%{_libdir}/libmv_training.so
%files machine_learning-devel
%{_includedir}/media/mv_infer*.h
-%{_includedir}/media/mv_object_detection*.h
-%{_includedir}/media/mv_object_detection_3d*.h
-%{_includedir}/media/mv_image_classification*.h
-%{_libdir}/pkgconfig/*inference.pc
+%if "%{enable_ml_object_detection}" == "1"
+%{_includedir}/media/mv_object_detection_internal.h
+%{_includedir}/media/mv_object_detection_type.h
%{_libdir}/pkgconfig/*object-detection.pc
+%endif
+%if "%{enable_ml_object_detection_3d}" == "1"
+%{_includedir}/media/mv_object_detection_3d_internal.h
+%{_includedir}/media/mv_object_detection_3d_type.h
%{_libdir}/pkgconfig/*object-detection-3d.pc
+%endif
+%if "%{enable_ml_image_classification}" == "1"
+%{_includedir}/media/mv_image_classification_internal.h
+%{_includedir}/media/mv_image_classification_type.h
%{_libdir}/pkgconfig/*image-classification.pc
+%endif
+%{_libdir}/pkgconfig/*inference.pc
%if "%{enable_ml_face_recognition}" == "1"
%{_includedir}/media/mv_face_recognition*.h
%{_libdir}/pkgconfig/*training.pc
%endif
%{_libdir}/libmv_testsuite*.so
%{_bindir}/mv_*
+%if "%{enable_ml_image_classification}" == "1"
%{_bindir}/test_image_classification
+%endif
+%if "%{enable_ml_object_detection}" == "1"
%{_bindir}/test_object_detection
+%endif
+%if "%{enable_ml_object_detection_3d}" == "1"
%{_bindir}/test_object_detection_3d
+%endif
%if "%{enable_ml_face_recognition}" == "1"
%{_bindir}/test_face_recognition
%{_bindir}/test_face_recognition_multi_threads
cmake_minimum_required(VERSION 2.6...3.13)
add_subdirectory(${PROJECT_SOURCE_DIR}/inference)
-add_subdirectory(${PROJECT_SOURCE_DIR}/image_classification)
-add_subdirectory(${PROJECT_SOURCE_DIR}/object_detection)
-add_subdirectory(${PROJECT_SOURCE_DIR}/object_detection_3d)
+if (${ENABLE_ML_IMAGE_CLASSIFICATION})
+ message("Enabled image classification test case.")
+ add_subdirectory(${PROJECT_SOURCE_DIR}/image_classification)
+endif()
+if (${ENABLE_ML_OBJECT_DETECTION})
+ message("Enabled object detection test case.")
+ add_subdirectory(${PROJECT_SOURCE_DIR}/object_detection)
+endif()
+if (${ENABLE_ML_OBJECT_DETECTION_3D})
+ message("Enabled object detection 3d test case.")
+ add_subdirectory(${PROJECT_SOURCE_DIR}/object_detection_3d)
+endif()
if (${ENABLE_ML_FACE_RECOGNITION})
- message("Enabled machine learning face recognition test cases.")
+ message("Enabled machine learning face recognition test case.")
add_subdirectory(${PROJECT_SOURCE_DIR}/face_recognition)
endif()