From 19c1a91a7743eca966da5633e327875372e5ebe4 Mon Sep 17 00:00:00 2001 From: Takuya Takeuchi Date: Mon, 25 Jul 2022 11:15:47 +0900 Subject: [PATCH] Merge branch 'release/19.21.0.20220724' --- .../FaceDetection.Client.csproj | 2 +- nuget/nuspec/DlibDotNet.CPU.nuspec | 2 +- nuget/nuspec/DlibDotNet.CUDA-100.nuspec | 2 +- nuget/nuspec/DlibDotNet.CUDA-101.nuspec | 2 +- nuget/nuspec/DlibDotNet.CUDA-102.nuspec | 2 +- nuget/nuspec/DlibDotNet.CUDA-110.nuspec | 2 +- nuget/nuspec/DlibDotNet.CUDA-111.nuspec | 2 +- nuget/nuspec/DlibDotNet.CUDA-112.nuspec | 2 +- nuget/nuspec/DlibDotNet.CUDA-92.nuspec | 2 +- nuget/nuspec/DlibDotNet.MKL.nuspec | 2 +- src/DlibDotNet.Native.Dnn/CMakeLists.txt | 2 +- .../dnn/loss/multiclass_log/LossMulticlassLog.h | 2 +- .../loss/multiclass_log/LossMulticlassLogBase.h | 5 +++-- .../dlib/dnn/loss/multiclass_log/template.h | 17 ++++++++++++----- src/DlibDotNet.Native.Dnn/dlib/dnn/output.h | 7 ++++--- src/DlibDotNet.Native.Dnn/version-cuda.rc.in | 2 +- src/DlibDotNet.Native.Dnn/version.rc.in | 2 +- src/DlibDotNet.Native/CMakeLists.txt | 2 +- src/DlibDotNet.Native/dlib/data_io/mnist.h | 8 ++++---- src/DlibDotNet.Native/version-cuda.rc.in | 2 +- src/DlibDotNet.Native/version.rc.in | 2 +- src/DlibDotNet/DlibDotNet.csproj | 2 +- 22 files changed, 41 insertions(+), 32 deletions(-) diff --git a/examples/ASP.NET/FaceDetection.Client/FaceDetection.Client.csproj b/examples/ASP.NET/FaceDetection.Client/FaceDetection.Client.csproj index 061d5195..90e4fb69 100644 --- a/examples/ASP.NET/FaceDetection.Client/FaceDetection.Client.csproj +++ b/examples/ASP.NET/FaceDetection.Client/FaceDetection.Client.csproj @@ -13,7 +13,7 @@ - + diff --git a/nuget/nuspec/DlibDotNet.CPU.nuspec b/nuget/nuspec/DlibDotNet.CPU.nuspec index 025d799e..311a90b8 100644 --- a/nuget/nuspec/DlibDotNet.CPU.nuspec +++ b/nuget/nuspec/DlibDotNet.CPU.nuspec @@ -2,7 +2,7 @@ DlibDotNet - 19.21.0.20220429 + 19.21.0.20220724 DlibDotNet Takuya Takeuchi Takuya Takeuchi diff --git a/nuget/nuspec/DlibDotNet.CUDA-100.nuspec b/nuget/nuspec/DlibDotNet.CUDA-100.nuspec index 9b876f96..1c840c43 100644 --- a/nuget/nuspec/DlibDotNet.CUDA-100.nuspec +++ b/nuget/nuspec/DlibDotNet.CUDA-100.nuspec @@ -2,7 +2,7 @@ DlibDotNet.CUDA100 - 19.21.0.20220429 + 19.21.0.20220724 DlibDotNet for CUDA 10.0 Takuya Takeuchi Takuya Takeuchi diff --git a/nuget/nuspec/DlibDotNet.CUDA-101.nuspec b/nuget/nuspec/DlibDotNet.CUDA-101.nuspec index 7e087c55..6a980609 100644 --- a/nuget/nuspec/DlibDotNet.CUDA-101.nuspec +++ b/nuget/nuspec/DlibDotNet.CUDA-101.nuspec @@ -2,7 +2,7 @@ DlibDotNet.CUDA101 - 19.21.0.20220429 + 19.21.0.20220724 DlibDotNet for CUDA 10.1 Takuya Takeuchi Takuya Takeuchi diff --git a/nuget/nuspec/DlibDotNet.CUDA-102.nuspec b/nuget/nuspec/DlibDotNet.CUDA-102.nuspec index afe13023..c97074d9 100644 --- a/nuget/nuspec/DlibDotNet.CUDA-102.nuspec +++ b/nuget/nuspec/DlibDotNet.CUDA-102.nuspec @@ -2,7 +2,7 @@ DlibDotNet.CUDA102 - 19.21.0.20220429 + 19.21.0.20220724 DlibDotNet for CUDA 10.2 Takuya Takeuchi Takuya Takeuchi diff --git a/nuget/nuspec/DlibDotNet.CUDA-110.nuspec b/nuget/nuspec/DlibDotNet.CUDA-110.nuspec index 116462f6..c7e23b74 100644 --- a/nuget/nuspec/DlibDotNet.CUDA-110.nuspec +++ b/nuget/nuspec/DlibDotNet.CUDA-110.nuspec @@ -2,7 +2,7 @@ DlibDotNet.CUDA110 - 19.21.0.20220429 + 19.21.0.20220724 DlibDotNet for CUDA 11.0 Takuya Takeuchi Takuya Takeuchi diff --git a/nuget/nuspec/DlibDotNet.CUDA-111.nuspec b/nuget/nuspec/DlibDotNet.CUDA-111.nuspec index 29538bbe..e6697985 100644 --- a/nuget/nuspec/DlibDotNet.CUDA-111.nuspec +++ b/nuget/nuspec/DlibDotNet.CUDA-111.nuspec @@ -2,7 +2,7 @@ DlibDotNet.CUDA111 - 19.21.0.20220429 + 19.21.0.20220724 DlibDotNet for CUDA 11.1 Takuya Takeuchi Takuya Takeuchi diff --git a/nuget/nuspec/DlibDotNet.CUDA-112.nuspec b/nuget/nuspec/DlibDotNet.CUDA-112.nuspec index bb701faa..57663201 100644 --- a/nuget/nuspec/DlibDotNet.CUDA-112.nuspec +++ b/nuget/nuspec/DlibDotNet.CUDA-112.nuspec @@ -2,7 +2,7 @@ DlibDotNet.CUDA112 - 19.21.0.20220429 + 19.21.0.20220724 DlibDotNet for CUDA 11.2 Takuya Takeuchi Takuya Takeuchi diff --git a/nuget/nuspec/DlibDotNet.CUDA-92.nuspec b/nuget/nuspec/DlibDotNet.CUDA-92.nuspec index 04c939dc..7f1fc531 100644 --- a/nuget/nuspec/DlibDotNet.CUDA-92.nuspec +++ b/nuget/nuspec/DlibDotNet.CUDA-92.nuspec @@ -2,7 +2,7 @@ DlibDotNet.CUDA92 - 19.21.0.20220429 + 19.21.0.20220724 DlibDotNet for CUDA 9.2 Takuya Takeuchi Takuya Takeuchi diff --git a/nuget/nuspec/DlibDotNet.MKL.nuspec b/nuget/nuspec/DlibDotNet.MKL.nuspec index e3b063f3..8fc9b2fa 100644 --- a/nuget/nuspec/DlibDotNet.MKL.nuspec +++ b/nuget/nuspec/DlibDotNet.MKL.nuspec @@ -2,7 +2,7 @@ DlibDotNet.MKL - 19.21.0.20220429 + 19.21.0.20220724 DlibDotNet for MKL Takuya Takeuchi Takuya Takeuchi diff --git a/src/DlibDotNet.Native.Dnn/CMakeLists.txt b/src/DlibDotNet.Native.Dnn/CMakeLists.txt index 7bba9a89..76e2754b 100644 --- a/src/DlibDotNet.Native.Dnn/CMakeLists.txt +++ b/src/DlibDotNet.Native.Dnn/CMakeLists.txt @@ -25,7 +25,7 @@ message("-------------------------------------------------------") set(VERSION_MAJOR 19) set(VERSION_MINOR 21) set(VERSION_PATCH 0) -set(VERSION_DATE 20220429) +set(VERSION_DATE 20220724) # Only GCC requires -fPIC if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") diff --git a/src/DlibDotNet.Native.Dnn/dlib/dnn/loss/multiclass_log/LossMulticlassLog.h b/src/DlibDotNet.Native.Dnn/dlib/dnn/loss/multiclass_log/LossMulticlassLog.h index 7c3d8cfb..db239725 100644 --- a/src/DlibDotNet.Native.Dnn/dlib/dnn/loss/multiclass_log/LossMulticlassLog.h +++ b/src/DlibDotNet.Native.Dnn/dlib/dnn/loss/multiclass_log/LossMulticlassLog.h @@ -150,7 +150,7 @@ class LossMulticlassLog : public LossMulticlassLogBase void convert(void* data, void* labels, std::vector>& out_data, - std::vector& out_labels) + std::vector& out_labels) { std::vector*>& tmp_data = *(static_cast*>*>(data)); for (size_t i = 0; i< tmp_data.size(); i++) diff --git a/src/DlibDotNet.Native.Dnn/dlib/dnn/loss/multiclass_log/LossMulticlassLogBase.h b/src/DlibDotNet.Native.Dnn/dlib/dnn/loss/multiclass_log/LossMulticlassLogBase.h index 38d30f3f..ecf7e0d5 100644 --- a/src/DlibDotNet.Native.Dnn/dlib/dnn/loss/multiclass_log/LossMulticlassLogBase.h +++ b/src/DlibDotNet.Native.Dnn/dlib/dnn/loss/multiclass_log/LossMulticlassLogBase.h @@ -8,8 +8,9 @@ #include "../LossBase.h" -typedef unsigned long loss_multiclass_log_out_type; -typedef unsigned long loss_multiclass_log_train_label_type; +// unsigned long is size 4 in windows and size 8 in linux +typedef uint32_t loss_multiclass_log_out_type; +typedef uint32_t loss_multiclass_log_train_label_type; using namespace dlib; using namespace std; diff --git a/src/DlibDotNet.Native.Dnn/dlib/dnn/loss/multiclass_log/template.h b/src/DlibDotNet.Native.Dnn/dlib/dnn/loss/multiclass_log/template.h index e2068fa4..2d99d5c5 100644 --- a/src/DlibDotNet.Native.Dnn/dlib/dnn/loss/multiclass_log/template.h +++ b/src/DlibDotNet.Native.Dnn/dlib/dnn/loss/multiclass_log/template.h @@ -35,8 +35,15 @@ do {\ in_tmp.push_back(mat);\ }\ \ - std::vector dets = net->operator()(in_tmp, batch_size);\ - *ret = new std::vector(dets);\ + std::vector dets = net->operator()(in_tmp, batch_size);\ + const auto dets_size = dets.size();\ + auto ret_tmp = new std::vector();\ + ret_tmp->reserve(dets_size);\ + for (auto i = 0; i< dets_size; i++)\ + {\ + ret_tmp->push_back(static_cast(dets[i]));\ + }\ + *ret = ret_tmp;\ } while (0) #pragma endregion template @@ -708,7 +715,7 @@ void LossMulticlassLog> out_data; - std::vector out_label; + std::vector out_label; convert(data, labels, out_data, out_label); switch(optimizer_id) @@ -737,7 +744,7 @@ void LossMulticlassLog> out_data; - std::vector out_label; + std::vector out_label; convert(data, labels, out_data, out_label); switch(optimizer_id) @@ -766,7 +773,7 @@ void LossMulticlassLog> out_data; - std::vector out_label; + std::vector out_label; convert(data, labels, out_data, out_label); switch(optimizer_id) diff --git a/src/DlibDotNet.Native.Dnn/dlib/dnn/output.h b/src/DlibDotNet.Native.Dnn/dlib/dnn/output.h index 26f60785..c98c4dea 100644 --- a/src/DlibDotNet.Native.Dnn/dlib/dnn/output.h +++ b/src/DlibDotNet.Native.Dnn/dlib/dnn/output.h @@ -34,19 +34,20 @@ using namespace std; // typedef array2d input_type; // typedef matrix input_type; +// unsigned long is size 4 in windows and size 8 in linux #pragma region std::vector -DLLEXPORT void dnn_output_uint32_t_delete(std::vector* vector) +DLLEXPORT void dnn_output_uint32_t_delete(std::vector* vector) { delete vector; } -DLLEXPORT unsigned long dnn_output_uint32_t_getItem(std::vector* vector, const int index) +DLLEXPORT uint32_t dnn_output_uint32_t_getItem(std::vector* vector, const int index) { return vector->at(index); } -DLLEXPORT size_t dnn_output_uint32_t_getSize(std::vector* vector) +DLLEXPORT size_t dnn_output_uint32_t_getSize(std::vector* vector) { return vector->size(); } diff --git a/src/DlibDotNet.Native.Dnn/version-cuda.rc.in b/src/DlibDotNet.Native.Dnn/version-cuda.rc.in index 5e655623..59d8fa72 100644 --- a/src/DlibDotNet.Native.Dnn/version-cuda.rc.in +++ b/src/DlibDotNet.Native.Dnn/version-cuda.rc.in @@ -72,7 +72,7 @@ BEGIN VALUE "FileDescription", "Dlib wrapper library (deep neural network) with CUDA" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "DlibDotNet.Native.Dnn" - VALUE "LegalCopyright", "Copyright (c) 2017-2021 Takuya Takeuchi." + VALUE "LegalCopyright", "Copyright (c) 2017-2022 Takuya Takeuchi." VALUE "OriginalFilename", "DlibDotNet.Native.Dnn.dll" VALUE "ProductName", "Dlib.Net" VALUE "ProductVersion", VER_PRODUCTVERSION_STR diff --git a/src/DlibDotNet.Native.Dnn/version.rc.in b/src/DlibDotNet.Native.Dnn/version.rc.in index 72ab646c..0f0eccf3 100644 --- a/src/DlibDotNet.Native.Dnn/version.rc.in +++ b/src/DlibDotNet.Native.Dnn/version.rc.in @@ -72,7 +72,7 @@ BEGIN VALUE "FileDescription", "Dlib wrapper library (deep neural network)" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "DlibDotNet.Native.Dnn" - VALUE "LegalCopyright", "Copyright (c) 2017-2021 Takuya Takeuchi." + VALUE "LegalCopyright", "Copyright (c) 2017-2022 Takuya Takeuchi." VALUE "OriginalFilename", "DlibDotNet.Native.Dnn.dll" VALUE "ProductName", "Dlib.Net" VALUE "ProductVersion", VER_PRODUCTVERSION_STR diff --git a/src/DlibDotNet.Native/CMakeLists.txt b/src/DlibDotNet.Native/CMakeLists.txt index 5841dc09..01f5160b 100644 --- a/src/DlibDotNet.Native/CMakeLists.txt +++ b/src/DlibDotNet.Native/CMakeLists.txt @@ -25,7 +25,7 @@ message("-------------------------------------------------------") set(VERSION_MAJOR 19) set(VERSION_MINOR 21) set(VERSION_PATCH 0) -set(VERSION_DATE 20220429) +set(VERSION_DATE 20220724) # libjpeg-dev, libpng-dev set(DLIB_JPEG_SUPPORT True) diff --git a/src/DlibDotNet.Native/dlib/data_io/mnist.h b/src/DlibDotNet.Native/dlib/data_io/mnist.h index e106e91d..5d38106b 100644 --- a/src/DlibDotNet.Native/dlib/data_io/mnist.h +++ b/src/DlibDotNet.Native/dlib/data_io/mnist.h @@ -13,9 +13,9 @@ using namespace std; DLLEXPORT void load_mnist_dataset(const char* folder_name, const int folder_name_length, std::vector*>** training_images, - std::vector** training_labels, + std::vector** training_labels, std::vector*>** testing_images, - std::vector** testing_labels) + std::vector** testing_labels) { std::string tmp(folder_name, folder_name_length); std::vector> tmp_training_images; @@ -25,9 +25,9 @@ DLLEXPORT void load_mnist_dataset(const char* folder_name, load_mnist_dataset(tmp, tmp_training_images, tmp_training_labels, tmp_testing_images, tmp_testing_labels); auto ret_training_images = new std::vector*>(); - auto ret_training_labels = new std::vector(); + auto ret_training_labels = new std::vector(); auto ret_testing_images = new std::vector*>(); - auto ret_testing_labels = new std::vector(); + auto ret_testing_labels = new std::vector(); for (int i = 0; i < tmp_training_images.size(); i++) ret_training_images->push_back(new matrix(tmp_training_images[i])); diff --git a/src/DlibDotNet.Native/version-cuda.rc.in b/src/DlibDotNet.Native/version-cuda.rc.in index 5b64b6d0..80c3f9c8 100644 --- a/src/DlibDotNet.Native/version-cuda.rc.in +++ b/src/DlibDotNet.Native/version-cuda.rc.in @@ -72,7 +72,7 @@ BEGIN VALUE "FileDescription", "Dlib wrapper library (kernel) with CUDA" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "DlibDotNet.Native" - VALUE "LegalCopyright", "Copyright (c) 2017-2021 Takuya Takeuchi." + VALUE "LegalCopyright", "Copyright (c) 2017-2022 Takuya Takeuchi." VALUE "OriginalFilename", "DlibDotNet.Native.dll" VALUE "ProductName", "Dlib.Net" VALUE "ProductVersion", VER_PRODUCTVERSION_STR diff --git a/src/DlibDotNet.Native/version.rc.in b/src/DlibDotNet.Native/version.rc.in index 4617a8ce..116dd366 100644 --- a/src/DlibDotNet.Native/version.rc.in +++ b/src/DlibDotNet.Native/version.rc.in @@ -72,7 +72,7 @@ BEGIN VALUE "FileDescription", "Dlib wrapper library (kernel)" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "DlibDotNet.Native" - VALUE "LegalCopyright", "Copyright (c) 2017-2021 Takuya Takeuchi." + VALUE "LegalCopyright", "Copyright (c) 2017-2022 Takuya Takeuchi." VALUE "OriginalFilename", "DlibDotNet.Native.dll" VALUE "ProductName", "Dlib.Net" VALUE "ProductVersion", VER_PRODUCTVERSION_STR diff --git a/src/DlibDotNet/DlibDotNet.csproj b/src/DlibDotNet/DlibDotNet.csproj index 508bb370..2f388509 100644 --- a/src/DlibDotNet/DlibDotNet.csproj +++ b/src/DlibDotNet/DlibDotNet.csproj @@ -5,7 +5,7 @@ Takuya Takeuchi .NET wrapper for DLib written in C# - © Takuya Takeuchi 2018-2021 + © Takuya Takeuchi 2017-2022 Debug;Release 19.21.0 https://github.com/takuya-takeuchi/DlibDotNet