Skip to content

Commit

Permalink
✨ add cmake arg: USE_NETWORK_SOURCE , if sets to ON, will use hunter …
Browse files Browse the repository at this point in the history
…to download blobs, otherwise use local file
  • Loading branch information
richard-xx committed Jun 23, 2022
1 parent e508eed commit 9bdacc8
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 102 deletions.
17 changes: 10 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
cmake_minimum_required(VERSION 3.10)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.24.1.tar.gz"
SHA1 "4942227a6e6f5e64414c55b97ef98609de199d18"
# LOCAL
)
if (${USE_NETWORK_SOURCE})
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.24.1.tar.gz"
SHA1 "4942227a6e6f5e64414c55b97ef98609de199d18"
# LOCAL
)
endif ()


project("DepthaiExample")
set(CMAKE_CXX_STANDARD 14)
Expand Down Expand Up @@ -160,7 +163,7 @@ if (OpenCV_FOUND)
endif ()

add_subdirectory(get_network_info)

add_subdirectory(perspectiveMatrix)

if (WIN32)
# https://cmake.org/cmake/help/latest/command/file.html#get-runtime-dependencies
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
+ depthai-core-v{version}-win32-no-opencv.zip
+ depthai-core-v{version}.tar.gz

## Debian/Ubuntu
## Ubuntu

```shell
sudo apt update
Expand Down
206 changes: 112 additions & 94 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,97 +1,115 @@
# NeuralNetwork node, mobilenet example
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/mobilenet-ssd_openvino_2021.4_6shave.blob"
SHA1 "4f4506726e3083981064938a0faaf9af6180d2c6"
FILE "mobilenet-ssd_openvino_2021.4_6shave.blob"
LOCATION mobilenet_blob
)

# YoloV3 资源
hunter_private_data(
URL "http://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/yolo-v3-tiny-tf_openvino_2021.4_6shave.blob"
SHA1 "dedb2d4d96b23e42d15c15e454b8f02eca2713de"
FILE "yolo-v3-tiny-tf_openvino_2021.4_6shave.blob"
LOCATION tiny_yolo_v3_blob
)

# YoloV4 资源
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/yolo-v4-tiny-tf_openvino_2021.4_6shave.blob"
SHA1 "d8d09b697dac298fe83cf8856740a21b1a61ab89"
FILE "yolo-v4-tiny-tf_openvino_2021.4_6shave.blob"
LOCATION tiny_yolo_v4_blob
)

# NeuralNetwork node, mobilenet example, 5 shaves
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/mobilenet-ssd_openvino_2021.4_5shave.blob"
SHA1 "14ab3ef446b8a649d6694d94c2fc8b798efd74a3"
FILE "mobilenet-ssd_openvino_2021.4_5shave.blob"
LOCATION mobilenet_5shaves_blob
)

# NeuralNetwork node, mobilenet example, 8 shaves
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/mobilenet-ssd_openvino_2021.4_8shave.blob"
SHA1 "7e7ea9a680668f3ca9e8f1d22cc8f3f1a02ac018"
FILE "mobilenet-ssd_openvino_2021.4_8shave.blob"
LOCATION mobilenet_8shaves_blob
)

# 带有要检测的对象的视频文件
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/construction_vest.mp4"
SHA1 "271d8d0b702e683ce02957db7c100843de5ceaec"
FILE "construction_vest.mp4"
LOCATION construction_vest
)

# Calibration Sample files
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/misc/depthai_calib.json"
SHA1 "ec50a47496473116c51cec1c8249bff2679383c3"
FILE "depthai_calib.json"
LOCATION calib_v6
)

hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/misc/depthai_v5.calib"
SHA1 "adfe9976b9aacfdaa76ac7138810999988177e71"
FILE "depthai_v5.calib"
LOCATION calib_v5
)

hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/misc/BW1098OBC.json"
SHA1 "1e84b6c339ac51e3b254775090b91235a40fac71"
FILE "BW1098OBC.json"
LOCATION device_config
)

# person-detection
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/person-detection-retail-0013_openvino_2021.4_7shave.blob"
SHA1 "946d102874b287292cdb5952fa66356c8d36025f"
FILE "person-detection-retail-0013_openvino_2021.4_7shave.blob"
LOCATION person_detection
)

# concat model
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/concat_openvino_2021.4_6shave.blob"
SHA1 "e4af6fb2bed39648a2a4424d8bdc5bac56d616df"
FILE "concat_openvino_2021.4_6shave.blob"
LOCATION concat_model
)

# normalization model
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/normalize_openvino_2021.4_4shave.blob"
SHA1 "1435f6d11e0dfdbc60f2dfa45aecd3d530b6153b"
FILE "normalize_openvino_2021.4_4shave.blob"
LOCATION normalization_model
)

if (${USE_NETWORK_SOURCE})
# NeuralNetwork node, mobilenet example
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/mobilenet-ssd_openvino_2021.4_6shave.blob"
SHA1 "4f4506726e3083981064938a0faaf9af6180d2c6"
FILE "mobilenet-ssd_openvino_2021.4_6shave.blob"
LOCATION mobilenet_blob
)

# YoloV3 资源
hunter_private_data(
URL "http://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/yolo-v3-tiny-tf_openvino_2021.4_6shave.blob"
SHA1 "dedb2d4d96b23e42d15c15e454b8f02eca2713de"
FILE "yolo-v3-tiny-tf_openvino_2021.4_6shave.blob"
LOCATION tiny_yolo_v3_blob
)

# YoloV4 资源
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/yolo-v4-tiny-tf_openvino_2021.4_6shave.blob"
SHA1 "d8d09b697dac298fe83cf8856740a21b1a61ab89"
FILE "yolo-v4-tiny-tf_openvino_2021.4_6shave.blob"
LOCATION tiny_yolo_v4_blob
)

# NeuralNetwork node, mobilenet example, 5 shaves
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/mobilenet-ssd_openvino_2021.4_5shave.blob"
SHA1 "14ab3ef446b8a649d6694d94c2fc8b798efd74a3"
FILE "mobilenet-ssd_openvino_2021.4_5shave.blob"
LOCATION mobilenet_5shaves_blob
)

# NeuralNetwork node, mobilenet example, 8 shaves
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/mobilenet-ssd_openvino_2021.4_8shave.blob"
SHA1 "7e7ea9a680668f3ca9e8f1d22cc8f3f1a02ac018"
FILE "mobilenet-ssd_openvino_2021.4_8shave.blob"
LOCATION mobilenet_8shaves_blob
)

# 带有要检测的对象的视频文件
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/construction_vest.mp4"
SHA1 "271d8d0b702e683ce02957db7c100843de5ceaec"
FILE "construction_vest.mp4"
LOCATION construction_vest
)

# Calibration Sample files
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/misc/depthai_calib.json"
SHA1 "ec50a47496473116c51cec1c8249bff2679383c3"
FILE "depthai_calib.json"
LOCATION calib_v6
)

hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/misc/depthai_v5.calib"
SHA1 "adfe9976b9aacfdaa76ac7138810999988177e71"
FILE "depthai_v5.calib"
LOCATION calib_v5
)

hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/misc/BW1098OBC.json"
SHA1 "1e84b6c339ac51e3b254775090b91235a40fac71"
FILE "BW1098OBC.json"
LOCATION device_config
)

# person-detection
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/person-detection-retail-0013_openvino_2021.4_7shave.blob"
SHA1 "946d102874b287292cdb5952fa66356c8d36025f"
FILE "person-detection-retail-0013_openvino_2021.4_7shave.blob"
LOCATION person_detection
)

# concat model
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/concat_openvino_2021.4_6shave.blob"
SHA1 "e4af6fb2bed39648a2a4424d8bdc5bac56d616df"
FILE "concat_openvino_2021.4_6shave.blob"
LOCATION concat_model
)

# normalization model
hunter_private_data(
URL "https://artifacts.luxonis.com/artifactory/luxonis-depthai-data-local/network/normalize_openvino_2021.4_4shave.blob"
SHA1 "1435f6d11e0dfdbc60f2dfa45aecd3d530b6153b"
FILE "normalize_openvino_2021.4_4shave.blob"
LOCATION normalization_model
)
else()
set(mobilenet_blob "models/mobilenet-ssd_openvino_2021.4_6shave.blob")
set(tiny_yolo_v3_blob "models/yolo-v3-tiny-tf_openvino_2021.4_6shave.blob")
set(tiny_yolo_v4_blob "models/yolo-v4-tiny-tf_openvino_2021.4_6shave.blob")
set(mobilenet_5shaves_blob "models/mobilenet-ssd_openvino_2021.4_5shave.blob")
set(mobilenet_8shaves_blob "models/mobilenet-ssd_openvino_2021.4_8shave.blob")
set(construction_vest "models/construction_vest.mp4")
set(calib_v6 "models/depthai_calib.json")
set(calib_v5 "models/depthai_v5.calib")
set(device_config "models/BW1098OBC.json")
set(person_detection "models/person-detection-retail-0013_openvino_2021.4_7shave.blob")
set(concat_model "models/concat_openvino_2021.4_6shave.blob")
set(normalization_model "models/normalize_openvino_2021.4_4shave.blob")
# file(GLOB models "models/*")
file(COPY models DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
file(INSTALL models DESTINATION "${INSTALL_BINDIR}")

endif()

# bootloader
dai_add_example(bootloader_version bootloader/bootloader_version.cpp)
Expand Down

0 comments on commit 9bdacc8

Please sign in to comment.