diff --git a/examples/ASP.NET/FaceDetection.Client/FaceDetection.Client.csproj b/examples/ASP.NET/FaceDetection.Client/FaceDetection.Client.csproj
index 3dd4783e..061d5195 100644
--- a/examples/ASP.NET/FaceDetection.Client/FaceDetection.Client.csproj
+++ b/examples/ASP.NET/FaceDetection.Client/FaceDetection.Client.csproj
@@ -15,7 +15,7 @@
-
+
diff --git a/examples/ASP.NET/FaceDetection.Server/FaceDetection.Server.csproj b/examples/ASP.NET/FaceDetection.Server/FaceDetection.Server.csproj
index 44a6132b..baf4828b 100644
--- a/examples/ASP.NET/FaceDetection.Server/FaceDetection.Server.csproj
+++ b/examples/ASP.NET/FaceDetection.Server/FaceDetection.Server.csproj
@@ -18,7 +18,7 @@
-
+
diff --git a/nuget/nuspec/DlibDotNet.CPU.nuspec b/nuget/nuspec/DlibDotNet.CPU.nuspec
index 89a98785..025d799e 100644
--- a/nuget/nuspec/DlibDotNet.CPU.nuspec
+++ b/nuget/nuspec/DlibDotNet.CPU.nuspec
@@ -2,7 +2,7 @@
DlibDotNet
- 19.21.0.20220130
+ 19.21.0.20220429
DlibDotNet
Takuya Takeuchi
Takuya Takeuchi
diff --git a/nuget/nuspec/DlibDotNet.CUDA-100.nuspec b/nuget/nuspec/DlibDotNet.CUDA-100.nuspec
index aa1bcfe8..9b876f96 100644
--- a/nuget/nuspec/DlibDotNet.CUDA-100.nuspec
+++ b/nuget/nuspec/DlibDotNet.CUDA-100.nuspec
@@ -2,7 +2,7 @@
DlibDotNet.CUDA100
- 19.21.0.20220130
+ 19.21.0.20220429
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 f0921fb0..7e087c55 100644
--- a/nuget/nuspec/DlibDotNet.CUDA-101.nuspec
+++ b/nuget/nuspec/DlibDotNet.CUDA-101.nuspec
@@ -2,7 +2,7 @@
DlibDotNet.CUDA101
- 19.21.0.20220130
+ 19.21.0.20220429
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 c15e2c6c..afe13023 100644
--- a/nuget/nuspec/DlibDotNet.CUDA-102.nuspec
+++ b/nuget/nuspec/DlibDotNet.CUDA-102.nuspec
@@ -2,7 +2,7 @@
DlibDotNet.CUDA102
- 19.21.0.20220130
+ 19.21.0.20220429
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 62c1a680..116462f6 100644
--- a/nuget/nuspec/DlibDotNet.CUDA-110.nuspec
+++ b/nuget/nuspec/DlibDotNet.CUDA-110.nuspec
@@ -2,7 +2,7 @@
DlibDotNet.CUDA110
- 19.21.0.20220130
+ 19.21.0.20220429
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 202ed2ee..29538bbe 100644
--- a/nuget/nuspec/DlibDotNet.CUDA-111.nuspec
+++ b/nuget/nuspec/DlibDotNet.CUDA-111.nuspec
@@ -2,7 +2,7 @@
DlibDotNet.CUDA111
- 19.21.0.20220130
+ 19.21.0.20220429
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 2b52f1c4..bb701faa 100644
--- a/nuget/nuspec/DlibDotNet.CUDA-112.nuspec
+++ b/nuget/nuspec/DlibDotNet.CUDA-112.nuspec
@@ -2,7 +2,7 @@
DlibDotNet.CUDA112
- 19.21.0.20220130
+ 19.21.0.20220429
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 ae8f51c5..04c939dc 100644
--- a/nuget/nuspec/DlibDotNet.CUDA-92.nuspec
+++ b/nuget/nuspec/DlibDotNet.CUDA-92.nuspec
@@ -2,7 +2,7 @@
DlibDotNet.CUDA92
- 19.21.0.20220130
+ 19.21.0.20220429
DlibDotNet for CUDA 9.2
Takuya Takeuchi
Takuya Takeuchi
diff --git a/nuget/nuspec/DlibDotNet.MKL.nuspec b/nuget/nuspec/DlibDotNet.MKL.nuspec
index 871e5b50..e3b063f3 100644
--- a/nuget/nuspec/DlibDotNet.MKL.nuspec
+++ b/nuget/nuspec/DlibDotNet.MKL.nuspec
@@ -2,7 +2,7 @@
DlibDotNet.MKL
- 19.21.0.20220130
+ 19.21.0.20220429
DlibDotNet for MKL
Takuya Takeuchi
Takuya Takeuchi
diff --git a/src/DlibDotNet.Native.Dnn/CMakeLists.txt b/src/DlibDotNet.Native.Dnn/CMakeLists.txt
index c5011eb0..7bba9a89 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 20220130)
+set(VERSION_DATE 20220429)
# Only GCC requires -fPIC
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
diff --git a/src/DlibDotNet.Native/CMakeLists.txt b/src/DlibDotNet.Native/CMakeLists.txt
index da3b656a..5841dc09 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 20220130)
+set(VERSION_DATE 20220429)
# libjpeg-dev, libpng-dev
set(DLIB_JPEG_SUPPORT True)
diff --git a/src/DlibDotNet.Native/dlib/clustering/chinese_whispers.h b/src/DlibDotNet.Native/dlib/clustering/chinese_whispers.h
index 5ead28b4..dd83d3cf 100644
--- a/src/DlibDotNet.Native/dlib/clustering/chinese_whispers.h
+++ b/src/DlibDotNet.Native/dlib/clustering/chinese_whispers.h
@@ -8,20 +8,26 @@
using namespace dlib;
using namespace std;
-DLLEXPORT unsigned long clustering_chinese_whispers(std::vector* edges,
- std::vector* labels,
- const unsigned long num_iterations = 100)
+DLLEXPORT uint64_t clustering_chinese_whispers(std::vector* edges,
+ std::vector* labels,
+ const uint32_t num_iterations = 100)
{
std::vector& e = *(static_cast*>(edges));
std::vector edges_tmp;
- for (int index = 0; index < e.size(); index++)
+ for (auto index = 0; index < e.size(); index++)
{
sample_pair& edge = *(static_cast(e[index]));
edges_tmp.push_back(edge);
}
- std::vector& l = *(static_cast*>(labels));
- return dlib::chinese_whispers(edges_tmp, l, num_iterations);
+ // unsigned long is 4byte in windows but 8 byte in SILP64, ILP64, LP64 (UNIX/Linux, macOS/iOS)
+ std::vector tmp;
+ const auto ret = dlib::chinese_whispers(edges_tmp, tmp, num_iterations);
+
+ for (auto index = 0; index < tmp.size(); index++)
+ labels->push_back(tmp[index]);
+
+ return ret;
}
#endif
\ No newline at end of file
diff --git a/src/DlibDotNet/Clustering/ChineseWhispers.cs b/src/DlibDotNet/Clustering/ChineseWhispers.cs
index 22e0597e..af790b2f 100644
--- a/src/DlibDotNet/Clustering/ChineseWhispers.cs
+++ b/src/DlibDotNet/Clustering/ChineseWhispers.cs
@@ -21,7 +21,7 @@ public static void ChineseWhispers(IEnumerable edges, uint iteration
using (var e = new StdVector(edges))
using (var l = new StdVector())
{
- clusters = NativeMethods.clustering_chinese_whispers(e.NativePtr, l.NativePtr, iterations);
+ clusters = (uint)NativeMethods.clustering_chinese_whispers(e.NativePtr, l.NativePtr, iterations);
labels = l.ToArray();
}
}
diff --git a/src/DlibDotNet/PInvoke/Clustering/ChineseWhispers.cs b/src/DlibDotNet/PInvoke/Clustering/ChineseWhispers.cs
index ac28796f..31afbfa9 100644
--- a/src/DlibDotNet/PInvoke/Clustering/ChineseWhispers.cs
+++ b/src/DlibDotNet/PInvoke/Clustering/ChineseWhispers.cs
@@ -9,7 +9,7 @@ internal sealed partial class NativeMethods
{
[DllImport(NativeLibrary, CallingConvention = CallingConvention)]
- public static extern uint clustering_chinese_whispers(IntPtr edges, IntPtr labels, uint num_iterations);
+ public static extern ulong clustering_chinese_whispers(IntPtr edges, IntPtr labels, uint num_iterations);
}