模型每类阈值+配置热重载+雷达纯距离触发+速度min不叠加+弯道参数化
This commit is contained in:
+5
-5
@@ -305,7 +305,7 @@ static void model_compute() {
|
||||
nullptr, nullptr, 15, 20, 64, 9, 1, 1, 1, false);
|
||||
}
|
||||
|
||||
static int decode(DetectBoxV10* boxes, int max_boxes, float thr) {
|
||||
static int decode(DetectBoxV10* boxes, int max_boxes, const float* thresh) {
|
||||
const int N = OH * OW;
|
||||
int cnt = 0;
|
||||
|
||||
@@ -323,6 +323,7 @@ static int decode(DetectBoxV10* boxes, int max_boxes, float thr) {
|
||||
}
|
||||
|
||||
for (int c = 0; c < NC && cnt < max_boxes; ++c) {
|
||||
float thr = thresh ? thresh[c] : 0.6f;
|
||||
for (int gy = 0; gy < OH; ++gy) {
|
||||
for (int gx = 0; gx < OW; ++gx) {
|
||||
const int idx = gy * OW + gx;
|
||||
@@ -453,7 +454,7 @@ bool model_v10_init(const char* path) {
|
||||
}
|
||||
|
||||
int model_v10_detect_fmt(const uint8_t* img, int w, int h, MildPixFmt fmt,
|
||||
DetectBoxV10* boxes, int max_boxes, float thr) {
|
||||
DetectBoxV10* boxes, int max_boxes, const float* thresh) {
|
||||
if (!g_rdy || !img || !boxes || max_boxes <= 0 || w <= 1 || h <= 1) return 0;
|
||||
|
||||
const uint8_t* net_in = img;
|
||||
@@ -463,7 +464,7 @@ int model_v10_detect_fmt(const uint8_t* img, int w, int h, MildPixFmt fmt,
|
||||
}
|
||||
preproc_160(net_in, fmt);
|
||||
model_compute();
|
||||
const int n = decode(boxes, max_boxes, thr);
|
||||
const int n = decode(boxes, max_boxes, thresh);
|
||||
|
||||
const float sx = (float)w / (float)IN_W;
|
||||
const float sy = (float)h / (float)IN_H;
|
||||
@@ -475,8 +476,7 @@ int model_v10_detect_fmt(const uint8_t* img, int w, int h, MildPixFmt fmt,
|
||||
}
|
||||
|
||||
int model_v10_detect(const uint8_t* img, int w, int h, DetectBoxV10* boxes, int max_boxes, const float* thresh) {
|
||||
float thr = thresh ? thresh[0] : 0.6f;
|
||||
return model_v10_detect_fmt(img, w, h, MILD_FMT_BGR, boxes, max_boxes, thr);
|
||||
return model_v10_detect_fmt(img, w, h, MILD_FMT_BGR, boxes, max_boxes, thresh);
|
||||
}
|
||||
|
||||
const float* model_v10_forward_debug(const float* chw) {
|
||||
|
||||
Reference in New Issue
Block a user