|
| 1 | +/** |
| 2 | + * DeepDetect |
| 3 | + * Copyright (c) 2021 Jolibrain SASU |
| 4 | + * Author: Mehdi Abaakouk <[email protected]> |
| 5 | + * |
| 6 | + * This file is part of deepdetect. |
| 7 | + * |
| 8 | + * deepdetect is free software: you can redistribute it and/or modify |
| 9 | + * it under the terms of the GNU Lesser General Public License as published by |
| 10 | + * the Free Software Foundation, either version 3 of the License, or |
| 11 | + * (at your option) any later version. |
| 12 | + * |
| 13 | + * deepdetect is distributed in the hope that it will be useful, |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | + * GNU Lesser General Public License for more details. |
| 17 | + * |
| 18 | + * You should have received a copy of the GNU Lesser General Public License |
| 19 | + * along with deepdetect. If not, see <http://www.gnu.org/licenses/>. |
| 20 | + */ |
| 21 | + |
| 22 | +#ifndef DTO_MLLIB_H |
| 23 | +#define DTO_MLLIB_H |
| 24 | + |
| 25 | +#include "dd_config.h" |
| 26 | +#include "utils/utils.hpp" |
| 27 | +#include "oatpp/core/Types.hpp" |
| 28 | +#include "oatpp/core/macro/codegen.hpp" |
| 29 | + |
| 30 | +namespace dd |
| 31 | +{ |
| 32 | + namespace DTO |
| 33 | + { |
| 34 | +#include OATPP_CODEGEN_BEGIN(DTO) ///< Begin DTO codegen section |
| 35 | + |
| 36 | +class MLLib : public oatpp::DTO |
| 37 | +{ |
| 38 | + DTO_INIT(MLLib, DTO /* extends */) |
| 39 | + |
| 40 | + // NCNN Options |
| 41 | + DTO_FIELD_INFO(nclasses) |
| 42 | + { |
| 43 | + info->description = "number of output classes (`supervised` service " |
| 44 | + "type), classification only"; |
| 45 | + }; |
| 46 | + DTO_FIELD(Int32, nclasses) = 0; |
| 47 | + |
| 48 | + DTO_FIELD_INFO(threads) |
| 49 | + { |
| 50 | + info->description = "number of threads"; |
| 51 | + }; |
| 52 | + DTO_FIELD(Int32, threads) = dd::dd_utils::my_hardware_concurrency(); |
| 53 | + |
| 54 | + DTO_FIELD_INFO(lightmode) |
| 55 | + { |
| 56 | + info->description = "enable light mode"; |
| 57 | + }; |
| 58 | + DTO_FIELD(Boolean, lightmode) = true; |
| 59 | + |
| 60 | + DTO_FIELD_INFO(inputBlob) |
| 61 | + { |
| 62 | + info->description = "network input blob name"; |
| 63 | + }; |
| 64 | + DTO_FIELD(String, inputBlob) = "data"; |
| 65 | + |
| 66 | + DTO_FIELD_INFO(outputBlob) |
| 67 | + { |
| 68 | + info->description = "network output blob name (default depends on " |
| 69 | + "network type(ie prob or " |
| 70 | + "rnn_pred or probs or detection_out)"; |
| 71 | + }; |
| 72 | + DTO_FIELD(String, outputBlob); |
| 73 | + |
| 74 | + DTO_FIELD_INFO(datatype) |
| 75 | + { |
| 76 | + info->description = "fp16 or fp32"; |
| 77 | + }; |
| 78 | + |
| 79 | + DTO_FIELD(String, datatype) = "fp16"; |
| 80 | +}; |
| 81 | +#include OATPP_CODEGEN_END(DTO) ///< End DTO codegen section |
| 82 | + |
| 83 | + } |
| 84 | +} |
| 85 | +#endif |
0 commit comments