zhm
2025-07-25 112aace08718ad0ead624286fe09e4bf941dee5a
预警跟图片描述修改--修改检测内容
2个文件已修改
13 ■■■■ 已修改文件
qwen_detect.py 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
qwen_thread.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
qwen_detect.py
@@ -241,11 +241,11 @@
    def shutdown_all(self) -> None:
        """清理所有线程"""
        with self.lock:
            for camera_id, thread in list(self.threads.items()):
                if thread.is_alive():
                    thread.join(timeout=1)
                del self.threads[camera_id]
        for camera_id, thread in list(self.threads.items()):
            if thread.is_alive():
                thread.join(timeout=1)
            del self.threads[camera_id]
    #获取任务
    def getTaskconf(self,isupdate):
@@ -301,6 +301,7 @@
                        thread = pool.threads.get(camera.get("camera_id"))
                        if not thread:
                            logging.info(f"开始创建{camera.get('camera_id')}线程")
                            pool.safe_start(pool.workerWarning, camera.get('camera_id'))
                            pool.safe_start(pool.worker, camera.get('camera_id'))
                            logging.info(f"{camera.get('camera_id')}线程创建完毕")
qwen_thread.py
@@ -125,7 +125,7 @@
                    "role": "user",
                    "content": [
                        {"type": "image", "image": image},
                        {"type": "text", "text": f"请检测图片中{res_data['waning_value']}?请回答yes或no"},
                        {"type": "text", "text": f"请检测图片中是否{res_data['waning_value']}?请回答yes或no"},
                    ],
                }
            ]