mirror of
https://github.com/NanjingForestryUniversity/supermachine-tobacco.git
synced 2025-11-08 14:23:55 +00:00
Merge commit '677650ff4879ae3b0fb21f0d3ee55fdc3174d758'
This commit is contained in:
commit
dd1e828d3e
File diff suppressed because one or more lines are too long
@ -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"
|
||||
]
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -175,5 +175,5 @@ 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)
|
||||
tester.pony_run(test_path=r'E:\zhouchao\8.4\zazhi',
|
||||
test_rgb=True, test_spectra=True, get_delta=False, convert=False)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user