From 2052071ffeb03831056afea0b1810847fcec53b3 Mon Sep 17 00:00:00 2001 From: bsw215583320 <baoshiwei121@163.com> Date: 星期四, 10 四月 2025 08:01:17 +0800 Subject: [PATCH] 药材检测输出识别结果转换成类名,调整摄像头顺序 --- config/herb_ai.yaml | 11 ++++------- herb_ai.py | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/config/herb_ai.yaml b/config/herb_ai.yaml index ac86087..636b292 100644 --- a/config/herb_ai.yaml +++ b/config/herb_ai.yaml @@ -1,10 +1,8 @@ win: className: "aimodel" windowName: "aimodel" - tag_win: className: - #windowName: "recv" windowName: "recv" log: path: "./log/herb_ai.log" @@ -12,10 +10,9 @@ safe: './model/safety_det.onnx' cls: './model/herb_identify.onnx' cam: - cam1: 0 - cam2: 1 + cam1: 1 + cam2: 0 sleep: 0.1 frames: 10 - # 鏂板娓呯悊绛栫暐閰嶇疆 - days_threshold: 7 # 淇濈暀鏂囦欢澶╂暟 - max_files: 100 # 鏈�澶ф枃浠舵暟閲� + days_threshold: 7 + max_files: 100 diff --git a/herb_ai.py b/herb_ai.py index c74491e..0ff33a3 100644 --- a/herb_ai.py +++ b/herb_ai.py @@ -199,7 +199,7 @@ # 瀹夊叏妫�娴� boxes, scores, class_ids = safety_detect(frame) draw_img = safety_detect.draw_detections(frame, boxes, scores, class_ids) - print(boxes, scores, class_ids) + det_res = {} if class_ids is not None: # 閬嶅巻class_ids 杞崲鎴愮被鍒悕绉� @@ -211,7 +211,7 @@ det_res[class_name] = det_res[class_name] if det_res[class_name] > scores[i] else scores[i] else: det_res[class_name] = scores[i] - + print(det_res) logger.info(f"瀹夊叏妫�娴嬭瘑鍒粨鏋�, {det_res}") # 濡傛灉cass_ids涓寘鍚�0锛屽垯琛ㄧず鏈夊畨鍏ㄦ娴嬪埌浜轰綋 if 0 in class_ids: -- Gitblit v1.9.3