修改了模型适配新的相机镜头

This commit is contained in:
FEIJINTI 2022-08-05 11:02:54 +08:00
parent 34d9e9a676
commit d17baceac4
4 changed files with 22 additions and 25 deletions

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 7,
"outputs": [],
"source": [
"import numpy as np\n",
@ -30,7 +30,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 8,
"outputs": [],
"source": [
"train_from_existed = False # 是否从现有数据训练如果是的话那就从dataset_file训练否则就用data_dir里头的数据\n",
@ -70,7 +70,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 9,
"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": 6,
"execution_count": 10,
"outputs": [],
"source": [
"if len(dataset) > 1:\n",
@ -130,7 +130,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 11,
"outputs": [],
"source": [
"# 对数据进行预处理\n",
@ -147,13 +147,13 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 12,
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"38411it [02:01, 316.59it/s] \n"
"31173it [01:21, 380.30it/s] \n"
]
},
{
@ -162,12 +162,12 @@
"text": [
" precision recall f1-score support\n",
"\n",
" 0 1.00 1.00 1.00 11523\n",
" 1 1.00 1.00 1.00 9603\n",
" 0 1.00 1.00 1.00 9352\n",
" 1 1.00 1.00 1.00 7793\n",
"\n",
" accuracy 1.00 21126\n",
" macro avg 1.00 1.00 1.00 21126\n",
"weighted avg 1.00 1.00 1.00 21126\n",
" accuracy 1.00 17145\n",
" macro avg 1.00 1.00 1.00 17145\n",
"weighted avg 1.00 1.00 1.00 17145\n",
"\n"
]
}

View File

@ -24,10 +24,10 @@ class Config:
spec_size_threshold = 3
# rgb模型参数
rgb_tobacco_model_path = r"models/tobacco_dt_2022-07-26_15-57.model"
rgb_background_model_path = r"models/background_dt_2022-07-27_08-11.model"
rgb_tobacco_model_path = r"models/tobacco_dt_2022-08-05_10-38.model"
rgb_background_model_path = r"models/background_dt_2022-08-05_10-41.model"
threshold_low, threshold_high = 10, 230
threshold_s = 175
threshold_s = 190
rgb_size_threshold = 4
# mask parameter
@ -35,4 +35,3 @@ class Config:
# save part
offset_vertical = 0

View File

@ -176,4 +176,4 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Run image test or ')
tester = TestMain()
tester.pony_run(test_path=r'E:\zhouchao\8.4\yangeng',
test_rgb=True, test_spectra=True, get_delta=False, convert=True)
test_rgb=True, test_spectra=False, get_delta=False, convert=False)