-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use DTO for NCNN init parameters
- Loading branch information
Showing
4 changed files
with
118 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/** | ||
* DeepDetect | ||
* Copyright (c) 2021 Jolibrain SASU | ||
* Author: Mehdi Abaakouk <[email protected]> | ||
* | ||
* This file is part of deepdetect. | ||
* | ||
* deepdetect is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* deepdetect is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with deepdetect. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef HTTP_DTO_NCNN_H | ||
#define HTTP_DTO_NCNN_H | ||
|
||
#include "dd_config.h" | ||
#include "oatpp/core/Types.hpp" | ||
#include "oatpp/core/macro/codegen.hpp" | ||
|
||
#include OATPP_CODEGEN_BEGIN(DTO) ///< Begin DTO codegen section | ||
|
||
class NcnnInitDto : public oatpp::DTO | ||
{ | ||
DTO_INIT(NcnnInitDto, DTO /* extends */) | ||
|
||
DTO_FIELD_INFO(nclasses) | ||
{ | ||
info->description = "number of output classes (`supervised` service " | ||
"type), classification only"; | ||
}; | ||
DTO_FIELD(Int32, nclasses) = 0; | ||
|
||
DTO_FIELD_INFO(threads) | ||
{ | ||
info->description = "number of threads"; | ||
}; | ||
DTO_FIELD(Int32, threads) = dd::dd_utils::my_hardware_concurrency(); | ||
|
||
DTO_FIELD_INFO(lightmode) | ||
{ | ||
info->description = "enable light mode"; | ||
}; | ||
DTO_FIELD(Boolean, lightmode) = true; | ||
|
||
DTO_FIELD_INFO(inputBlob) | ||
{ | ||
info->description = "network input blob name"; | ||
}; | ||
DTO_FIELD(String, inputBlob) = "data"; | ||
|
||
DTO_FIELD_INFO(outputBlob) | ||
{ | ||
info->description = "network output blob name (default depends on " | ||
"network type(ie prob or " | ||
"rnn_pred or probs or detection_out)"; | ||
}; | ||
DTO_FIELD(String, outputBlob); | ||
}; | ||
|
||
#include OATPP_CODEGEN_END(DTO) ///< End DTO codegen section | ||
|
||
#endif |