mirror of
https://github.com/NanjingForestryUniversity/supermachine-tobacco.git
synced 2025-11-08 14:23:55 +00:00
修改了模型适配新的相机镜头
This commit is contained in:
parent
34d9e9a676
commit
d17baceac4
File diff suppressed because one or more lines are too long
@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 3,
|
"execution_count": 7,
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import numpy as np\n",
|
"import numpy as np\n",
|
||||||
@ -30,7 +30,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 4,
|
"execution_count": 8,
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"train_from_existed = False # 是否从现有数据训练,如果是的话,那就从dataset_file训练,否则就用data_dir里头的数据\n",
|
"train_from_existed = False # 是否从现有数据训练,如果是的话,那就从dataset_file训练,否则就用data_dir里头的数据\n",
|
||||||
@ -70,7 +70,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 5,
|
"execution_count": 9,
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"dataset = read_labeled_img(data_dir, color_dict=color_dict, is_ps_color_space=False)\n",
|
"dataset = read_labeled_img(data_dir, color_dict=color_dict, is_ps_color_space=False)\n",
|
||||||
@ -99,7 +99,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 6,
|
"execution_count": 10,
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"if len(dataset) > 1:\n",
|
"if len(dataset) > 1:\n",
|
||||||
@ -130,7 +130,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 7,
|
"execution_count": 11,
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"# 对数据进行预处理\n",
|
"# 对数据进行预处理\n",
|
||||||
@ -147,13 +147,13 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 8,
|
"execution_count": 12,
|
||||||
"outputs": [
|
"outputs": [
|
||||||
{
|
{
|
||||||
"name": "stderr",
|
"name": "stderr",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"38411it [02:01, 316.59it/s] \n"
|
"31173it [01:21, 380.30it/s] \n"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -162,12 +162,12 @@
|
|||||||
"text": [
|
"text": [
|
||||||
" precision recall f1-score support\n",
|
" precision recall f1-score support\n",
|
||||||
"\n",
|
"\n",
|
||||||
" 0 1.00 1.00 1.00 11523\n",
|
" 0 1.00 1.00 1.00 9352\n",
|
||||||
" 1 1.00 1.00 1.00 9603\n",
|
" 1 1.00 1.00 1.00 7793\n",
|
||||||
"\n",
|
"\n",
|
||||||
" accuracy 1.00 21126\n",
|
" accuracy 1.00 17145\n",
|
||||||
" macro avg 1.00 1.00 1.00 21126\n",
|
" macro avg 1.00 1.00 1.00 17145\n",
|
||||||
"weighted avg 1.00 1.00 1.00 21126\n",
|
"weighted avg 1.00 1.00 1.00 17145\n",
|
||||||
"\n"
|
"\n"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,10 +24,10 @@ class Config:
|
|||||||
spec_size_threshold = 3
|
spec_size_threshold = 3
|
||||||
|
|
||||||
# rgb模型参数
|
# rgb模型参数
|
||||||
rgb_tobacco_model_path = r"models/tobacco_dt_2022-07-26_15-57.model"
|
rgb_tobacco_model_path = r"models/tobacco_dt_2022-08-05_10-38.model"
|
||||||
rgb_background_model_path = r"models/background_dt_2022-07-27_08-11.model"
|
rgb_background_model_path = r"models/background_dt_2022-08-05_10-41.model"
|
||||||
threshold_low, threshold_high = 10, 230
|
threshold_low, threshold_high = 10, 230
|
||||||
threshold_s = 175
|
threshold_s = 190
|
||||||
rgb_size_threshold = 4
|
rgb_size_threshold = 4
|
||||||
|
|
||||||
# mask parameter
|
# mask parameter
|
||||||
@ -35,4 +35,3 @@ class Config:
|
|||||||
|
|
||||||
# save part
|
# save part
|
||||||
offset_vertical = 0
|
offset_vertical = 0
|
||||||
|
|
||||||
|
|||||||
@ -176,4 +176,4 @@ if __name__ == '__main__':
|
|||||||
parser = argparse.ArgumentParser(description='Run image test or ')
|
parser = argparse.ArgumentParser(description='Run image test or ')
|
||||||
tester = TestMain()
|
tester = TestMain()
|
||||||
tester.pony_run(test_path=r'E:\zhouchao\8.4\yangeng',
|
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)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user