From 5ace1f858bcd711cc82830065f72615ecfadd745 Mon Sep 17 00:00:00 2001 From: FEIJINTI <83849113+FEIJINTI@users.noreply.github.com> Date: Wed, 27 Jul 2022 08:14:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E6=A8=A1=E5=9E=8B=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 02_classification.ipynb | 106 ++++++---------------------------------- config.py | 4 +- main.py | 8 ++- 3 files changed, 19 insertions(+), 99 deletions(-) diff --git a/02_classification.ipynb b/02_classification.ipynb index 5d37750..e65d8ed 100644 --- a/02_classification.ipynb +++ b/02_classification.ipynb @@ -12,7 +12,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 3, "outputs": [], "source": [ "import numpy as np\n", @@ -30,7 +30,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 4, "outputs": [], "source": [ "train_from_existed = False # 是否从现有数据训练,如果是的话,那就从dataset_file训练,否则就用data_dir里头的数据\n", @@ -38,8 +38,8 @@ "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", @@ -70,7 +70,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 5, "outputs": [], "source": [ "dataset = read_labeled_img(data_dir, color_dict=color_dict, is_ps_color_space=False)\n", @@ -99,7 +99,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 6, "outputs": [], "source": [ "if len(dataset) > 1:\n", @@ -130,7 +130,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 7, "outputs": [], "source": [ "# 对数据进行预处理\n", @@ -147,84 +147,13 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 8, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "\n", - " 0%| | 0/9019 [00:00