Skip to content

Commit

Permalink
Merge branch 'release/19.21.0.20220429'
Browse files Browse the repository at this point in the history
  • Loading branch information
takuya-takeuchi committed Apr 29, 2022
1 parent a03d925 commit 295d1fa
Show file tree
Hide file tree
Showing 16 changed files with 27 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReference Include="JsonSubTypes" Version="1.8.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Polly" Version="7.2.1" />
<PackageReference Include="RestSharp" Version="106.11.7" />
<PackageReference Include="RestSharp" Version="106.12.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Drawing.Common" Version="5.0.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<ItemGroup>
<PackageReference Include="DlibDotNet" Version="19.21.0.20201122" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.10" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.18" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="3.1.10" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
<PackageReference Include="System.Drawing.Common" Version="5.0.1" />
Expand Down
2 changes: 1 addition & 1 deletion nuget/nuspec/DlibDotNet.CPU.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>DlibDotNet</id>
<version>19.21.0.20220130</version>
<version>19.21.0.20220429</version>
<title>DlibDotNet</title>
<authors>Takuya Takeuchi</authors>
<owners>Takuya Takeuchi</owners>
Expand Down
2 changes: 1 addition & 1 deletion nuget/nuspec/DlibDotNet.CUDA-100.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>DlibDotNet.CUDA100</id>
<version>19.21.0.20220130</version>
<version>19.21.0.20220429</version>
<title>DlibDotNet for CUDA 10.0</title>
<authors>Takuya Takeuchi</authors>
<owners>Takuya Takeuchi</owners>
Expand Down
2 changes: 1 addition & 1 deletion nuget/nuspec/DlibDotNet.CUDA-101.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>DlibDotNet.CUDA101</id>
<version>19.21.0.20220130</version>
<version>19.21.0.20220429</version>
<title>DlibDotNet for CUDA 10.1</title>
<authors>Takuya Takeuchi</authors>
<owners>Takuya Takeuchi</owners>
Expand Down
2 changes: 1 addition & 1 deletion nuget/nuspec/DlibDotNet.CUDA-102.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>DlibDotNet.CUDA102</id>
<version>19.21.0.20220130</version>
<version>19.21.0.20220429</version>
<title>DlibDotNet for CUDA 10.2</title>
<authors>Takuya Takeuchi</authors>
<owners>Takuya Takeuchi</owners>
Expand Down
2 changes: 1 addition & 1 deletion nuget/nuspec/DlibDotNet.CUDA-110.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>DlibDotNet.CUDA110</id>
<version>19.21.0.20220130</version>
<version>19.21.0.20220429</version>
<title>DlibDotNet for CUDA 11.0</title>
<authors>Takuya Takeuchi</authors>
<owners>Takuya Takeuchi</owners>
Expand Down
2 changes: 1 addition & 1 deletion nuget/nuspec/DlibDotNet.CUDA-111.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>DlibDotNet.CUDA111</id>
<version>19.21.0.20220130</version>
<version>19.21.0.20220429</version>
<title>DlibDotNet for CUDA 11.1</title>
<authors>Takuya Takeuchi</authors>
<owners>Takuya Takeuchi</owners>
Expand Down
2 changes: 1 addition & 1 deletion nuget/nuspec/DlibDotNet.CUDA-112.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>DlibDotNet.CUDA112</id>
<version>19.21.0.20220130</version>
<version>19.21.0.20220429</version>
<title>DlibDotNet for CUDA 11.2</title>
<authors>Takuya Takeuchi</authors>
<owners>Takuya Takeuchi</owners>
Expand Down
2 changes: 1 addition & 1 deletion nuget/nuspec/DlibDotNet.CUDA-92.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>DlibDotNet.CUDA92</id>
<version>19.21.0.20220130</version>
<version>19.21.0.20220429</version>
<title>DlibDotNet for CUDA 9.2</title>
<authors>Takuya Takeuchi</authors>
<owners>Takuya Takeuchi</owners>
Expand Down
2 changes: 1 addition & 1 deletion nuget/nuspec/DlibDotNet.MKL.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>DlibDotNet.MKL</id>
<version>19.21.0.20220130</version>
<version>19.21.0.20220429</version>
<title>DlibDotNet for MKL</title>
<authors>Takuya Takeuchi</authors>
<owners>Takuya Takeuchi</owners>
Expand Down
2 changes: 1 addition & 1 deletion src/DlibDotNet.Native.Dnn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/DlibDotNet.Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 12 additions & 6 deletions src/DlibDotNet.Native/dlib/clustering/chinese_whispers.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,26 @@
using namespace dlib;
using namespace std;

DLLEXPORT unsigned long clustering_chinese_whispers(std::vector<sample_pair*>* edges,
std::vector<unsigned long>* labels,
const unsigned long num_iterations = 100)
DLLEXPORT uint64_t clustering_chinese_whispers(std::vector<sample_pair*>* edges,
std::vector<uint32_t>* labels,
const uint32_t num_iterations = 100)
{
std::vector<sample_pair*>& e = *(static_cast<std::vector<sample_pair*>*>(edges));
std::vector<sample_pair> edges_tmp;
for (int index = 0; index < e.size(); index++)
for (auto index = 0; index < e.size(); index++)
{
sample_pair& edge = *(static_cast<sample_pair*>(e[index]));
edges_tmp.push_back(edge);
}

std::vector<unsigned long>& l = *(static_cast<std::vector<unsigned long>*>(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<unsigned long> 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
2 changes: 1 addition & 1 deletion src/DlibDotNet/Clustering/ChineseWhispers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static void ChineseWhispers(IEnumerable<SamplePair> edges, uint iteration
using (var e = new StdVector<SamplePair>(edges))
using (var l = new StdVector<uint>())
{
clusters = NativeMethods.clustering_chinese_whispers(e.NativePtr, l.NativePtr, iterations);
clusters = (uint)NativeMethods.clustering_chinese_whispers(e.NativePtr, l.NativePtr, iterations);
labels = l.ToArray();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/DlibDotNet/PInvoke/Clustering/ChineseWhispers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}

Expand Down

0 comments on commit 295d1fa

Please sign in to comment.