16 if (argv.size() < 2) {
22 int score = std::atoi(argv[1].c_str());
23 if (score <= 0 || score > 100) {
28 MA_STORAGE_SET_POD(ret,
static_resource->device->getStorage(),
"ma#score_threshold", score);
37 auto value =
static_cast<uint64_t
>(std::round(
static_resource->shared_threshold_score * 100));
40 transport.
send(
reinterpret_cast<const char*
>(encoder.
data()), encoder.
size());
46 if (argv.size() < 2) {
52 int nms = std::atoi(argv[1].c_str());
53 if (nms <= 0 || nms > 100) {
58 MA_STORAGE_SET_POD(ret,
static_resource->device->getStorage(),
"ma#nms_threshold",
nms);
67 auto value =
static_cast<uint64_t
>(std::round(
static_resource->shared_threshold_nms * 100));
70 transport.
send(
reinterpret_cast<const char*
>(encoder.
data()), encoder.
size());
77 MA_STORAGE_GET_POD(
static_resource->device->getStorage(),
"ma#score_threshold", score, score);
81 transport.
send(
reinterpret_cast<const char*
>(encoder.
data()), encoder.
size());
92 transport.
send(
reinterpret_cast<const char*
>(encoder.
data()), encoder.
size());
Definition: ma_codec_base.h:14
virtual ma_err_t end()=0
Encoder type for end.
virtual const void * data() const =0
Encoder type for get data.
virtual ma_err_t begin()=0
Encoder type for begin.
virtual const size_t size() const =0
Encoder type for get size.
Definition: ma_transport.h:12
virtual size_t send(const char *data, size_t length) noexcept=0
@ MA_MSG_TYPE_RESP
Definition: ma_types.h:252
ma_err_t
Definition: ma_types.h:21
@ MA_OK
Definition: ma_types.h:23
@ MA_EINVAL
Definition: ma_types.h:28
Definition: algorithm.hpp:11
void setNMSThreshold(const std::vector< std::string > &argv, Transport &transport, Encoder &encoder)
Definition: config.hpp:43
void getNMSThreshold(const std::vector< std::string > &argv, Transport &transport, Encoder &encoder)
Definition: config.hpp:84
void getScoreThreshold(const std::vector< std::string > &argv, Transport &transport, Encoder &encoder)
Definition: config.hpp:73
void setScoreThreshold(const std::vector< std::string > &argv, Transport &transport, Encoder &encoder)
Definition: config.hpp:13
void nms(std::forward_list< ma_bbox_t > &bboxes, float threshold_iou, float threshold_score, bool soft_nms, bool multi_target)
Definition: ma_nms.cpp:62
#define static_resource
Definition: resource.hpp:64