From 820fdc2abe5a4b257cac102b81e855060b72765f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B0=91=E8=BD=BB=E7=8B=82?= <1677568218@qq.com>
Date: Thu, 8 Dec 2022 20:09:35 +0800
Subject: [PATCH] feat: toggle
---
app/api/api.py | 7 +++++--
app/api/config.json | 18 +++++++++---------
app/main.py | 1 -
src/components/Setting.vue | 10 ++++++++--
src/components/daisy/DSelect.vue | 28 ++++++++++++----------------
src/pages/AdvancedSettings.vue | 1 -
6 files changed, 34 insertions(+), 31 deletions(-)
diff --git a/app/api/api.py b/app/api/api.py
index aa843a3..a26d1a5 100644
--- a/app/api/api.py
+++ b/app/api/api.py
@@ -6,6 +6,7 @@ import json
import datetime
import os
import sys
+from utils.utils import send_notifycation
def getFile(ruleFile):
if getattr(sys, 'frozen', False):
@@ -84,8 +85,8 @@ class API:
self.net = PicoDet(
get_settings_status_name(self.args,"ModelSetting","模型版本设置"),
self.args['classfile'],
- prob_threshold=get_setting_status(self.args,"ModelSetting",'confThreshold'),
- iou_threshold=get_setting_status(self.args,"ModelSetting",'nmsThreshold'))
+ prob_threshold=float(get_setting_status(self.args,"ModelSetting",'confThreshold')),
+ iou_threshold=float(get_setting_status(self.args,"ModelSetting",'nmsThreshold')))
# net.detect_folder(args['img_fold'], args['result_fold'])
@@ -93,6 +94,8 @@ class API:
self.cap = cv2.VideoCapture(0) # 开启摄像头
# cv2.namedWindow('Video Cam', cv2.WINDOW_NORMAL)
+ if(self.args['toggle'] and self.args['tip']):
+ send_notifycation("功能已开启")
diff --git a/app/api/config.json b/app/api/config.json
index d7dd5fe..ea926fd 100644
--- a/app/api/config.json
+++ b/app/api/config.json
@@ -2,12 +2,12 @@
"classfile": "coco_label.txt",
"img_fold": "./imgs",
"result_fold": "results",
- "toggle": false,
- "tip": false,
+ "toggle": true,
+ "tip": true,
"control": [
{
"name": "嘴控",
- "status": false
+ "status": true
},
{
"name": "眼控",
@@ -15,7 +15,7 @@
},
{
"name": "嘴/眼控",
- "status": true
+ "status": false
}
],
"ControlSetting": [
@@ -24,7 +24,7 @@
"status": [
{
"name": "开/关/开",
- "status": true
+ "status": false
},
{
"name": "关/开/关",
@@ -32,7 +32,7 @@
},
{
"name": "闭上持续2S",
- "status": false
+ "status": true
},
{
"name": "张开持续2S",
@@ -69,15 +69,15 @@
},
{
"name": "置信度",
- "status": 0.5
+ "status": "0.5"
},
{
"name": "confThreshold",
- "status": 0.5
+ "status": "0.5"
},
{
"name": "nmsThreshold",
- "status": 0.6
+ "status": "0.6"
},
{
"name": "图片载入方式",
diff --git a/app/main.py b/app/main.py
index 601093b..3a0aa04 100644
--- a/app/main.py
+++ b/app/main.py
@@ -42,6 +42,5 @@ if __name__ == "__main__":
default='False',
help="开发模式")
args = parser.parse_args()
- send_notifycation('EMC程序已启动')
WebViewApp(args.port,args.dev=='True')
diff --git a/src/components/Setting.vue b/src/components/Setting.vue
index 555983e..b2f276f 100644
--- a/src/components/Setting.vue
+++ b/src/components/Setting.vue
@@ -17,6 +17,10 @@ watch(() => props.settingData, () => {
deep: true,
})
+const handleChange = () => {
+
+}
+
const { t } = useI18n()
@@ -38,11 +42,13 @@ const { t } = useI18n()
-->