Skip to content

Commit

Permalink
Merge branch 'release/19.21.0.20220724'
Browse files Browse the repository at this point in the history
  • Loading branch information
takuya-takeuchi committed Jul 25, 2022
1 parent 295d1fa commit 19c1a91
Show file tree
Hide file tree
Showing 22 changed files with 41 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ItemGroup>
<PackageReference Include="JsonSubTypes" Version="1.8.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Polly" Version="7.2.1" />
<PackageReference Include="RestSharp" Version="106.12.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
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.20220429</version>
<version>19.21.0.20220724</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.20220429</version>
<version>19.21.0.20220724</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.20220429</version>
<version>19.21.0.20220724</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.20220429</version>
<version>19.21.0.20220724</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.20220429</version>
<version>19.21.0.20220724</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.20220429</version>
<version>19.21.0.20220724</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.20220429</version>
<version>19.21.0.20220724</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.20220429</version>
<version>19.21.0.20220724</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.20220429</version>
<version>19.21.0.20220724</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 20220429)
set(VERSION_DATE 20220724)

# Only GCC requires -fPIC
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class LossMulticlassLog : public LossMulticlassLogBase
void convert(void* data,
void* labels,
std::vector<dlib::matrix<ELEMENT>>& out_data,
std::vector<LABEL_ELEMENT>& out_labels)
std::vector<unsigned long>& out_labels)
{
std::vector<dlib::matrix<ELEMENT>*>& tmp_data = *(static_cast<std::vector<dlib::matrix<ELEMENT>*>*>(data));
for (size_t i = 0; i< tmp_data.size(); i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 12 additions & 5 deletions src/DlibDotNet.Native.Dnn/dlib/dnn/loss/multiclass_log/template.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,15 @@ do {\
in_tmp.push_back(mat);\
}\
\
std::vector<loss_multiclass_log_out_type> dets = net->operator()(in_tmp, batch_size);\
*ret = new std::vector<loss_multiclass_log_out_type>(dets);\
std::vector<unsigned long> dets = net->operator()(in_tmp, batch_size);\
const auto dets_size = dets.size();\
auto ret_tmp = new std::vector<loss_multiclass_log_out_type>();\
ret_tmp->reserve(dets_size);\
for (auto i = 0; i< dets_size; i++)\
{\
ret_tmp->push_back(static_cast<loss_multiclass_log_out_type>(dets[i]));\
}\
*ret = ret_tmp;\
} while (0)

#pragma endregion template
Expand Down Expand Up @@ -708,7 +715,7 @@ void LossMulticlassLog<NET, MATRIX_ELEMENT, ELEMENT, LABEL_MATRIX_ELEMENT, LABEL
void* labels)
{
std::vector<dlib::matrix<ELEMENT>> out_data;
std::vector<LABEL_ELEMENT> out_label;
std::vector<unsigned long> out_label;
convert(data, labels, out_data, out_label);

switch(optimizer_id)
Expand Down Expand Up @@ -737,7 +744,7 @@ void LossMulticlassLog<NET, MATRIX_ELEMENT, ELEMENT, LABEL_MATRIX_ELEMENT, LABEL
void* labels)
{
std::vector<dlib::matrix<ELEMENT>> out_data;
std::vector<LABEL_ELEMENT> out_label;
std::vector<unsigned long> out_label;
convert(data, labels, out_data, out_label);

switch(optimizer_id)
Expand Down Expand Up @@ -766,7 +773,7 @@ void LossMulticlassLog<NET, MATRIX_ELEMENT, ELEMENT, LABEL_MATRIX_ELEMENT, LABEL
void* labels)
{
std::vector<matrix<ELEMENT>> out_data;
std::vector<LABEL_ELEMENT> out_label;
std::vector<unsigned long> out_label;
convert(data, labels, out_data, out_label);

switch(optimizer_id)
Expand Down
7 changes: 4 additions & 3 deletions src/DlibDotNet.Native.Dnn/dlib/dnn/output.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,20 @@ using namespace std;
// typedef array2d<T,MM> input_type;
// typedef matrix<rgb_pixel> input_type;

// unsigned long is size 4 in windows and size 8 in linux
#pragma region std::vector<unsigned long>

DLLEXPORT void dnn_output_uint32_t_delete(std::vector<unsigned long>* vector)
DLLEXPORT void dnn_output_uint32_t_delete(std::vector<uint32_t>* vector)
{
delete vector;
}

DLLEXPORT unsigned long dnn_output_uint32_t_getItem(std::vector<unsigned long>* vector, const int index)
DLLEXPORT uint32_t dnn_output_uint32_t_getItem(std::vector<uint32_t>* vector, const int index)
{
return vector->at(index);
}

DLLEXPORT size_t dnn_output_uint32_t_getSize(std::vector<unsigned long>* vector)
DLLEXPORT size_t dnn_output_uint32_t_getSize(std::vector<uint32_t>* vector)
{
return vector->size();
}
Expand Down
2 changes: 1 addition & 1 deletion src/DlibDotNet.Native.Dnn/version-cuda.rc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/DlibDotNet.Native.Dnn/version.rc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 20220429)
set(VERSION_DATE 20220724)

# libjpeg-dev, libpng-dev
set(DLIB_JPEG_SUPPORT True)
Expand Down
8 changes: 4 additions & 4 deletions src/DlibDotNet.Native/dlib/data_io/mnist.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ using namespace std;
DLLEXPORT void load_mnist_dataset(const char* folder_name,
const int folder_name_length,
std::vector<matrix<unsigned char>*>** training_images,
std::vector<unsigned long>** training_labels,
std::vector<uint32_t>** training_labels,
std::vector<matrix<unsigned char>*>** testing_images,
std::vector<unsigned long>** testing_labels)
std::vector<uint32_t>** testing_labels)
{
std::string tmp(folder_name, folder_name_length);
std::vector<matrix<unsigned char>> tmp_training_images;
Expand All @@ -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<matrix<unsigned char>*>();
auto ret_training_labels = new std::vector<unsigned long>();
auto ret_training_labels = new std::vector<uint32_t>();
auto ret_testing_images = new std::vector<matrix<unsigned char>*>();
auto ret_testing_labels = new std::vector<unsigned long>();
auto ret_testing_labels = new std::vector<uint32_t>();

for (int i = 0; i < tmp_training_images.size(); i++)
ret_training_images->push_back(new matrix<unsigned char>(tmp_training_images[i]));
Expand Down
2 changes: 1 addition & 1 deletion src/DlibDotNet.Native/version-cuda.rc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/DlibDotNet.Native/version.rc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/DlibDotNet/DlibDotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Authors>Takuya Takeuchi</Authors>
<Description>.NET wrapper for DLib written in C#</Description>
<Company />
<Copyright>© Takuya Takeuchi 2018-2021</Copyright>
<Copyright>© Takuya Takeuchi 2017-2022</Copyright>
<Configurations>Debug;Release</Configurations>
<Version>19.21.0</Version>
<RepositoryUrl>https://github.com/takuya-takeuchi/DlibDotNet</RepositoryUrl>
Expand Down

0 comments on commit 19c1a91

Please sign in to comment.