From 210c7354cf223da38aff3251493c7aad842a7463 Mon Sep 17 00:00:00 2001 From: FEIJINTI <83849113+FEIJINTI@users.noreply.github.com> Date: Sat, 27 Aug 2022 14:58:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BA=86tobacco=EF=BC=8Cyolo?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=92=8CYOLO=E7=9A=84=E7=BD=AE=E4=BF=A1?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 02_classification.ipynb | 25 ++++++++++++++++--------- config.py | 6 +++--- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/02_classification.ipynb b/02_classification.ipynb index d72197f..d73e588 100644 --- a/02_classification.ipynb +++ b/02_classification.ipynb @@ -54,14 +54,14 @@ "dataset_file = \"data/dataset/dataset_2022-07-20_10-04.mat\"\n", "\n", "# color_dict = {(0, 0, 255): \"yangeng\", (255, 0, 0): 'beijing',(0, 255, 0): \"zibian\"} # 颜色对应的类别\n", - "# color_dict = {(0, 0, 255): \"yangeng\"}\n", - "color_dict = {(255, 0, 0): 'beijing'}\n", + "color_dict = {(0, 0, 255): \"yangeng\"}\n", + "# color_dict = {(255, 0, 0): 'beijing'}\n", "# color_dict = {(0, 255, 0): \"zibian\"}\n", "label_index = {\"yangeng\": 1, \"beijing\": 0, \"zibian\":2} # 类别对应的序号\n", "show_samples = False # 是否展示样本\n", "\n", "# 定义一些训练量\n", - "threshold = 2 # 正样本周围多大范围内的还算是正样本\n", + "threshold = 3 # 正样本周围多大范围内的还算是正样本\n", "node_num = 20 # 如果使用ELM作为分类器物,有多少的节点\n", "negative_sample_num = None # None或者一个数字,对应生成的负样本数量" ], @@ -169,7 +169,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "147099it [31:23, 78.09it/s] \n" + "23961it [00:46, 519.87it/s] " ] }, { @@ -178,12 +178,19 @@ "text": [ " precision recall f1-score support\n", "\n", - " 0 1.00 1.00 1.00 44129\n", - " 1 1.00 1.00 1.00 36775\n", + " 0 1.00 1.00 1.00 7188\n", + " 1 1.00 1.00 1.00 5991\n", "\n", - " accuracy 1.00 80904\n", - " macro avg 1.00 1.00 1.00 80904\n", - "weighted avg 1.00 1.00 1.00 80904\n", + " accuracy 1.00 13179\n", + " macro avg 1.00 1.00 1.00 13179\n", + "weighted avg 1.00 1.00 1.00 13179\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ "\n" ] } diff --git a/config.py b/config.py index 6313260..17540d7 100644 --- a/config.py +++ b/config.py @@ -25,13 +25,13 @@ class Config: spec_size_threshold = 3 # rgb模型参数 - rgb_tobacco_model_path = r"weights/tobacco_dt_2022-08-05_10-38.model" + rgb_tobacco_model_path = r"weights/tobacco_dt_2022-08-27_14-43.model" rgb_background_model_path = r"weights/background_dt_2022-08-22_22-15.model" threshold_low, threshold_high = 10, 230 threshold_s = 190 # 饱和度的最高允许值 rgb_size_threshold = 4 # rgb的尺寸限制 - ai_path = 'weights/best0825.pt' - ai_conf_threshold = 0.5 + ai_path = 'weights/best0827.pt' + ai_conf_threshold = 0.6 # mask parameter target_size = (1024, 1024) # (Width, Height) of mask