修复靴子颜色检测的配置bug

This commit is contained in:
haotian 2026-03-12 21:21:28 +08:00
parent 4bb08188cc
commit 9658b29fca
2 changed files with 2 additions and 3 deletions

View File

@ -105,7 +105,7 @@
"model_w": 768,
"model_h": 768,
"num_classes": 11,
"conf": 0.1,
"conf": 0.2,
"nms": 0.45,
"debug": {
"stats": true,

View File

@ -105,10 +105,9 @@ private:
config.violation_key = cfg.ValueOr<std::string>("violation_key", "ppe_violation");
config.pass_through = cfg.ValueOr<bool>("pass_through", true);
config.debug = cfg.ValueOr<bool>("debug", false);
config.enable_color_check = cfg.ValueOr<bool>("enable_color_check", true);
// 解析颜色配置
if (const SimpleJson* color = cfg.Find("color_check")) {
config.enable_color_check = color->ValueOr<bool>("enable", true);
std::string method = color->ValueOr<std::string>("method", "hsv");
if (method == "hsv") config.color.method = ColorMethod::HSV;
else if (method == "rgb") config.color.method = ColorMethod::RGB;