diff --git a/paddlers/tasks/change_detector.py b/paddlers/tasks/change_detector.py index b3fa32c..8718cd1 100644 --- a/paddlers/tasks/change_detector.py +++ b/paddlers/tasks/change_detector.py @@ -52,9 +52,7 @@ class BaseChangeDetector(BaseModel): if 'with_net' in self.init_params: del self.init_params['with_net'] super(BaseChangeDetector, self).__init__('change_detector') - if model_name not in __all__: - raise ValueError("ERROR: There is no model named {}.".format( - model_name)) + self.model_name = model_name self.num_classes = num_classes self.use_mixed_loss = use_mixed_loss diff --git a/test_tipc/configs/cd/bit/bit.yaml b/test_tipc/configs/cd/bit/bit.yaml deleted file mode 100644 index 3d3c62b..0000000 --- a/test_tipc/configs/cd/bit/bit.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# Basic configurations of BIT - -_base_: ../_base_/airchange.yaml - -save_dir: ./test_tipc/output/cd/bit/ - -model: !Node - type: BIT \ No newline at end of file diff --git a/test_tipc/configs/cd/bit/bit_airchange.yaml b/test_tipc/configs/cd/bit/bit_airchange.yaml index efd6fbb..27e0bb4 100644 --- a/test_tipc/configs/cd/bit/bit_airchange.yaml +++ b/test_tipc/configs/cd/bit/bit_airchange.yaml @@ -1,4 +1,4 @@ -# Basic configurations of BIT with AirChange dataset +# Configurations of BIT with AirChange dataset _base_: ../_base_/airchange.yaml diff --git a/test_tipc/configs/cd/bit/bit_levircd.yaml b/test_tipc/configs/cd/bit/bit_levircd.yaml index 8008901..d9a5dd9 100644 --- a/test_tipc/configs/cd/bit/bit_levircd.yaml +++ b/test_tipc/configs/cd/bit/bit_levircd.yaml @@ -1,4 +1,4 @@ -# Basic configurations of BIT with LEVIR-CD dataset +# Configurations of BIT with LEVIR-CD dataset _base_: ../_base_/levircd.yaml diff --git a/test_tipc/configs/cd/bit/train_infer_python.txt b/test_tipc/configs/cd/bit/train_infer_python.txt index 33ee2f3..3cd2de1 100644 --- a/test_tipc/configs/cd/bit/train_infer_python.txt +++ b/test_tipc/configs/cd/bit/train_infer_python.txt @@ -6,7 +6,7 @@ use_gpu:null|null --precision:null --num_epochs:lite_train_lite_infer=5|lite_train_whole_infer=5|whole_train_whole_infer=10 --save_dir:adaptive ---train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=4 +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=8 --model_path:null --config:lite_train_lite_infer=./test_tipc/configs/cd/bit/bit_airchange.yaml|lite_train_whole_infer=./test_tipc/configs/cd/bit/bit_airchange.yaml|whole_train_whole_infer=./test_tipc/configs/cd/bit/bit_levircd.yaml train_model_name:best_model diff --git a/test_tipc/configs/cd/cdnet/cdnet_airchange.yaml b/test_tipc/configs/cd/cdnet/cdnet_airchange.yaml new file mode 100644 index 0000000..28d3f7a --- /dev/null +++ b/test_tipc/configs/cd/cdnet/cdnet_airchange.yaml @@ -0,0 +1,8 @@ +# Configurations of CDNet with AirChange dataset + +_base_: ../_base_/airchange.yaml + +save_dir: ./test_tipc/output/cd/cdnet/ + +model: !Node + type: CDNet \ No newline at end of file diff --git a/test_tipc/configs/cd/cdnet/cdnet_levircd.yaml b/test_tipc/configs/cd/cdnet/cdnet_levircd.yaml new file mode 100644 index 0000000..586e4e3 --- /dev/null +++ b/test_tipc/configs/cd/cdnet/cdnet_levircd.yaml @@ -0,0 +1,8 @@ +# Configurations of cdnet with LEVIR-CD dataset + +_base_: ../_base_/levircd.yaml + +save_dir: ./test_tipc/output/cd/cdnet/ + +model: !Node + type: CDNet \ No newline at end of file diff --git a/test_tipc/configs/cd/cdnet/train_infer_python.txt b/test_tipc/configs/cd/cdnet/train_infer_python.txt new file mode 100644 index 0000000..00ff523 --- /dev/null +++ b/test_tipc/configs/cd/cdnet/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:cd:cdnet +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=5|lite_train_whole_infer=5|whole_train_whole_infer=10 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=8 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/cd/cdnet/cdnet_airchange.yaml|lite_train_whole_infer=./test_tipc/configs/cd/cdnet/cdnet_airchange.yaml|whole_train_whole_infer=./test_tipc/configs/cd/cdnet/cdnet_levircd.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train cd +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:null +null:null +## +===========================export_params=========================== +--save_dir:adaptive +--model_dir:adaptive +--fixed_input_shape:[-1,3,256,256] +norm_export:deploy/export/export_model.py +quant_export:null +fpgm_export:null +distill_export:null +export1:null +export2:null +===========================infer_params=========================== +infer_model:null +infer_export:null +infer_quant:False +inference:test_tipc/infer.py +--device:cpu|gpu +--enable_mkldnn:True +--cpu_threads:6 +--batch_size:1 +--use_trt:False +--precision:fp32 +--model_dir:null +--config:null +--save_log_path:null +--benchmark:True +--model_name:cdnet +null:null \ No newline at end of file diff --git a/test_tipc/configs/cd/changeformer/changeformer.yaml b/test_tipc/configs/cd/changeformer/changeformer_airchange.yaml similarity index 54% rename from test_tipc/configs/cd/changeformer/changeformer.yaml rename to test_tipc/configs/cd/changeformer/changeformer_airchange.yaml index 785749d..15a37ea 100644 --- a/test_tipc/configs/cd/changeformer/changeformer.yaml +++ b/test_tipc/configs/cd/changeformer/changeformer_airchange.yaml @@ -1,4 +1,4 @@ -# Basic configurations of ChangeFormer +# Configurations of ChangeFormer with AirChange dataset _base_: ../_base_/airchange.yaml diff --git a/test_tipc/configs/cd/changeformer/changeformer_levircd.yaml b/test_tipc/configs/cd/changeformer/changeformer_levircd.yaml new file mode 100644 index 0000000..931a3e8 --- /dev/null +++ b/test_tipc/configs/cd/changeformer/changeformer_levircd.yaml @@ -0,0 +1,8 @@ +# Configurations of ChangeFormer with LEVIR-CD dataset + +_base_: ../_base_/levircd.yaml + +save_dir: ./test_tipc/output/cd/changeformer/ + +model: !Node + type: ChangeFormer \ No newline at end of file diff --git a/test_tipc/configs/cd/changeformer/train_infer_python.txt b/test_tipc/configs/cd/changeformer/train_infer_python.txt index 9ac2cdc..47fe600 100644 --- a/test_tipc/configs/cd/changeformer/train_infer_python.txt +++ b/test_tipc/configs/cd/changeformer/train_infer_python.txt @@ -6,14 +6,14 @@ use_gpu:null|null --precision:null --num_epochs:lite_train_lite_infer=5|lite_train_whole_infer=5|whole_train_whole_infer=10 --save_dir:adaptive ---train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=4 +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=8 --model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/cd/changeformer/changeformer_airchange.yaml|lite_train_whole_infer=./test_tipc/configs/cd/changeformer/changeformer_airchange.yaml|whole_train_whole_infer=./test_tipc/configs/cd/changeformer/changeformer_levircd.yaml train_model_name:best_model -train_infer_file_list:./test_tipc/data/airchange/:./test_tipc/data/airchange/eval.txt null:null ## trainer:norm -norm_train:test_tipc/run_task.py train cd --config ./test_tipc/configs/cd/changeformer/changeformer.yaml +norm_train:test_tipc/run_task.py train cd pact_train:null fpgm_train:null distill_train:null @@ -27,7 +27,7 @@ null:null ===========================export_params=========================== --save_dir:adaptive --model_dir:adaptive ---fixed_input_shape:[1,3,256,256] +--fixed_input_shape:[-1,3,256,256] norm_export:deploy/export/export_model.py quant_export:null fpgm_export:null @@ -46,7 +46,7 @@ inference:test_tipc/infer.py --use_trt:False --precision:fp32 --model_dir:null ---file_list:null:null +--config:null --save_log_path:null --benchmark:True --model_name:changeformer diff --git a/test_tipc/configs/cd/dsamnet/dsamnet_airchange.yaml b/test_tipc/configs/cd/dsamnet/dsamnet_airchange.yaml new file mode 100644 index 0000000..1ede33f --- /dev/null +++ b/test_tipc/configs/cd/dsamnet/dsamnet_airchange.yaml @@ -0,0 +1,8 @@ +# Configurations of DSAMNet with AirChange dataset + +_base_: ../_base_/airchange.yaml + +save_dir: ./test_tipc/output/cd/dsamnet/ + +model: !Node + type: DSAMNet \ No newline at end of file diff --git a/test_tipc/configs/cd/dsamnet/dsamnet_levircd.yaml b/test_tipc/configs/cd/dsamnet/dsamnet_levircd.yaml new file mode 100644 index 0000000..0fa9900 --- /dev/null +++ b/test_tipc/configs/cd/dsamnet/dsamnet_levircd.yaml @@ -0,0 +1,8 @@ +# Configurations of DSAMNet with LEVIR-CD dataset + +_base_: ../_base_/levircd.yaml + +save_dir: ./test_tipc/output/cd/dsamnet/ + +model: !Node + type: DSAMNet \ No newline at end of file diff --git a/test_tipc/configs/cd/dsamnet/train_infer_python.txt b/test_tipc/configs/cd/dsamnet/train_infer_python.txt new file mode 100644 index 0000000..bce8cab --- /dev/null +++ b/test_tipc/configs/cd/dsamnet/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:cd:dsamnet +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=5|lite_train_whole_infer=5|whole_train_whole_infer=10 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=8 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/cd/dsamnet/dsamnet_airchange.yaml|lite_train_whole_infer=./test_tipc/configs/cd/dsamnet/dsamnet_airchange.yaml|whole_train_whole_infer=./test_tipc/configs/cd/dsamnet/dsamnet_levircd.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train cd +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:null +null:null +## +===========================export_params=========================== +--save_dir:adaptive +--model_dir:adaptive +--fixed_input_shape:[-1,3,256,256] +norm_export:deploy/export/export_model.py +quant_export:null +fpgm_export:null +distill_export:null +export1:null +export2:null +===========================infer_params=========================== +infer_model:null +infer_export:null +infer_quant:False +inference:test_tipc/infer.py +--device:cpu|gpu +--enable_mkldnn:True +--cpu_threads:6 +--batch_size:1 +--use_trt:False +--precision:fp32 +--model_dir:null +--config:null +--save_log_path:null +--benchmark:True +--model_name:dsamnet +null:null \ No newline at end of file diff --git a/test_tipc/configs/cd/dsifn/dsifn_airchange.yaml b/test_tipc/configs/cd/dsifn/dsifn_airchange.yaml new file mode 100644 index 0000000..7fc661a --- /dev/null +++ b/test_tipc/configs/cd/dsifn/dsifn_airchange.yaml @@ -0,0 +1,8 @@ +# Configurations of DSIFN with AirChange dataset + +_base_: ../_base_/airchange.yaml + +save_dir: ./test_tipc/output/cd/dsifn/ + +model: !Node + type: DSIFN \ No newline at end of file diff --git a/test_tipc/configs/cd/dsifn/dsifn_levircd.yaml b/test_tipc/configs/cd/dsifn/dsifn_levircd.yaml new file mode 100644 index 0000000..c4454a1 --- /dev/null +++ b/test_tipc/configs/cd/dsifn/dsifn_levircd.yaml @@ -0,0 +1,8 @@ +# Configurations of DSIFN with LEVIR-CD dataset + +_base_: ../_base_/levircd.yaml + +save_dir: ./test_tipc/output/cd/dsifn/ + +model: !Node + type: DSIFN \ No newline at end of file diff --git a/test_tipc/configs/cd/dsifn/train_infer_python.txt b/test_tipc/configs/cd/dsifn/train_infer_python.txt new file mode 100644 index 0000000..e491797 --- /dev/null +++ b/test_tipc/configs/cd/dsifn/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:cd:dsifn +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=5|lite_train_whole_infer=5|whole_train_whole_infer=10 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=8 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/cd/dsifn/dsifn_airchange.yaml|lite_train_whole_infer=./test_tipc/configs/cd/dsifn/dsifn_airchange.yaml|whole_train_whole_infer=./test_tipc/configs/cd/dsifn/dsifn_levircd.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train cd +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:null +null:null +## +===========================export_params=========================== +--save_dir:adaptive +--model_dir:adaptive +--fixed_input_shape:[-1,3,256,256] +norm_export:deploy/export/export_model.py +quant_export:null +fpgm_export:null +distill_export:null +export1:null +export2:null +===========================infer_params=========================== +infer_model:null +infer_export:null +infer_quant:False +inference:test_tipc/infer.py +--device:cpu|gpu +--enable_mkldnn:True +--cpu_threads:6 +--batch_size:1 +--use_trt:False +--precision:fp32 +--model_dir:null +--config:null +--save_log_path:null +--benchmark:True +--model_name:dsifn +null:null \ No newline at end of file diff --git a/test_tipc/configs/cd/fc_ef/fc_ef_airchange.yaml b/test_tipc/configs/cd/fc_ef/fc_ef_airchange.yaml new file mode 100644 index 0000000..fc47737 --- /dev/null +++ b/test_tipc/configs/cd/fc_ef/fc_ef_airchange.yaml @@ -0,0 +1,8 @@ +# Configurations of FC-EF with AirChange dataset + +_base_: ../_base_/airchange.yaml + +save_dir: ./test_tipc/output/cd/fc_ef/ + +model: !Node + type: FCEarlyFusion \ No newline at end of file diff --git a/test_tipc/configs/cd/fc_ef/fc_ef_levircd.yaml b/test_tipc/configs/cd/fc_ef/fc_ef_levircd.yaml new file mode 100644 index 0000000..758d4a0 --- /dev/null +++ b/test_tipc/configs/cd/fc_ef/fc_ef_levircd.yaml @@ -0,0 +1,8 @@ +# Configurations of FC-EF with LEVIR-CD dataset + +_base_: ../_base_/levircd.yaml + +save_dir: ./test_tipc/output/cd/fc_ef/ + +model: !Node + type: FCEarlyFusion \ No newline at end of file diff --git a/test_tipc/configs/cd/fc_ef/train_infer_python.txt b/test_tipc/configs/cd/fc_ef/train_infer_python.txt new file mode 100644 index 0000000..fec5049 --- /dev/null +++ b/test_tipc/configs/cd/fc_ef/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:cd:fc_ef +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=5|lite_train_whole_infer=5|whole_train_whole_infer=10 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=8 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/cd/fc_ef/fc_ef_airchange.yaml|lite_train_whole_infer=./test_tipc/configs/cd/fc_ef/fc_ef_airchange.yaml|whole_train_whole_infer=./test_tipc/configs/cd/fc_ef/fc_ef_levircd.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train cd +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:null +null:null +## +===========================export_params=========================== +--save_dir:adaptive +--model_dir:adaptive +--fixed_input_shape:[-1,3,256,256] +norm_export:deploy/export/export_model.py +quant_export:null +fpgm_export:null +distill_export:null +export1:null +export2:null +===========================infer_params=========================== +infer_model:null +infer_export:null +infer_quant:False +inference:test_tipc/infer.py +--device:cpu|gpu +--enable_mkldnn:True +--cpu_threads:6 +--batch_size:1 +--use_trt:False +--precision:fp32 +--model_dir:null +--config:null +--save_log_path:null +--benchmark:True +--model_name:fc_ef +null:null \ No newline at end of file diff --git a/test_tipc/configs/cd/fc_siam_conc/fc_siam_conc_airchange.yaml b/test_tipc/configs/cd/fc_siam_conc/fc_siam_conc_airchange.yaml new file mode 100644 index 0000000..f4a8111 --- /dev/null +++ b/test_tipc/configs/cd/fc_siam_conc/fc_siam_conc_airchange.yaml @@ -0,0 +1,8 @@ +# Configurations of FC-Siam-conc with AirChange dataset + +_base_: ../_base_/airchange.yaml + +save_dir: ./test_tipc/output/cd/fc_siam_conc/ + +model: !Node + type: FCSiamConc \ No newline at end of file diff --git a/test_tipc/configs/cd/fc_siam_conc/fc_siam_conc_levircd.yaml b/test_tipc/configs/cd/fc_siam_conc/fc_siam_conc_levircd.yaml new file mode 100644 index 0000000..1d49a5d --- /dev/null +++ b/test_tipc/configs/cd/fc_siam_conc/fc_siam_conc_levircd.yaml @@ -0,0 +1,8 @@ +# Configurations of FC-Siam-conc with LEVIR-CD dataset + +_base_: ../_base_/levircd.yaml + +save_dir: ./test_tipc/output/cd/fc_siam_conc/ + +model: !Node + type: FCSiamConc \ No newline at end of file diff --git a/test_tipc/configs/cd/fc_siam_conc/train_infer_python.txt b/test_tipc/configs/cd/fc_siam_conc/train_infer_python.txt new file mode 100644 index 0000000..47e9bdb --- /dev/null +++ b/test_tipc/configs/cd/fc_siam_conc/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:cd:fc_siam_conc +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=5|lite_train_whole_infer=5|whole_train_whole_infer=10 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=8 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/cd/fc_siam_conc/fc_siam_conc_airchange.yaml|lite_train_whole_infer=./test_tipc/configs/cd/fc_siam_conc/fc_siam_conc_airchange.yaml|whole_train_whole_infer=./test_tipc/configs/cd/fc_siam_conc/fc_siam_conc_levircd.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train cd +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:null +null:null +## +===========================export_params=========================== +--save_dir:adaptive +--model_dir:adaptive +--fixed_input_shape:[-1,3,256,256] +norm_export:deploy/export/export_model.py +quant_export:null +fpgm_export:null +distill_export:null +export1:null +export2:null +===========================infer_params=========================== +infer_model:null +infer_export:null +infer_quant:False +inference:test_tipc/infer.py +--device:cpu|gpu +--enable_mkldnn:True +--cpu_threads:6 +--batch_size:1 +--use_trt:False +--precision:fp32 +--model_dir:null +--config:null +--save_log_path:null +--benchmark:True +--model_name:fc_siam_conc +null:null \ No newline at end of file diff --git a/test_tipc/configs/cd/fc_siam_diff/fc_siam_diff_airchange.yaml b/test_tipc/configs/cd/fc_siam_diff/fc_siam_diff_airchange.yaml new file mode 100644 index 0000000..3453d82 --- /dev/null +++ b/test_tipc/configs/cd/fc_siam_diff/fc_siam_diff_airchange.yaml @@ -0,0 +1,8 @@ +# Configurations of FC-Siam-diff with AirChange dataset + +_base_: ../_base_/airchange.yaml + +save_dir: ./test_tipc/output/cd/fc_siam_diff/ + +model: !Node + type: FCSiamDiff \ No newline at end of file diff --git a/test_tipc/configs/cd/fc_siam_diff/fc_siam_diff_levircd.yaml b/test_tipc/configs/cd/fc_siam_diff/fc_siam_diff_levircd.yaml new file mode 100644 index 0000000..2588cb9 --- /dev/null +++ b/test_tipc/configs/cd/fc_siam_diff/fc_siam_diff_levircd.yaml @@ -0,0 +1,8 @@ +# Configurations of FC-Siam-diff with LEVIR-CD dataset + +_base_: ../_base_/levircd.yaml + +save_dir: ./test_tipc/output/cd/fc_siam_diff/ + +model: !Node + type: FCSiamDiff \ No newline at end of file diff --git a/test_tipc/configs/cd/fc_siam_diff/train_infer_python.txt b/test_tipc/configs/cd/fc_siam_diff/train_infer_python.txt new file mode 100644 index 0000000..cba8b57 --- /dev/null +++ b/test_tipc/configs/cd/fc_siam_diff/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:cd:fc_siam_diff +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=5|lite_train_whole_infer=5|whole_train_whole_infer=10 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=8 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/cd/fc_siam_diff/fc_siam_diff_airchange.yaml|lite_train_whole_infer=./test_tipc/configs/cd/fc_siam_diff/fc_siam_diff_airchange.yaml|whole_train_whole_infer=./test_tipc/configs/cd/fc_siam_diff/fc_siam_diff_levircd.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train cd +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:null +null:null +## +===========================export_params=========================== +--save_dir:adaptive +--model_dir:adaptive +--fixed_input_shape:[-1,3,256,256] +norm_export:deploy/export/export_model.py +quant_export:null +fpgm_export:null +distill_export:null +export1:null +export2:null +===========================infer_params=========================== +infer_model:null +infer_export:null +infer_quant:False +inference:test_tipc/infer.py +--device:cpu|gpu +--enable_mkldnn:True +--cpu_threads:6 +--batch_size:1 +--use_trt:False +--precision:fp32 +--model_dir:null +--config:null +--save_log_path:null +--benchmark:True +--model_name:fc_siam_diff +null:null \ No newline at end of file diff --git a/test_tipc/configs/cd/snunet/snunet_airchange.yaml b/test_tipc/configs/cd/snunet/snunet_airchange.yaml new file mode 100644 index 0000000..eee3b1d --- /dev/null +++ b/test_tipc/configs/cd/snunet/snunet_airchange.yaml @@ -0,0 +1,8 @@ +# Configurations of SNUNet with AirChange dataset + +_base_: ../_base_/airchange.yaml + +save_dir: ./test_tipc/output/cd/snunet/ + +model: !Node + type: SNUNet \ No newline at end of file diff --git a/test_tipc/configs/cd/snunet/snunet_levircd.yaml b/test_tipc/configs/cd/snunet/snunet_levircd.yaml new file mode 100644 index 0000000..7af3bcb --- /dev/null +++ b/test_tipc/configs/cd/snunet/snunet_levircd.yaml @@ -0,0 +1,8 @@ +# Configurations of SNUNet with LEVIR-CD dataset + +_base_: ../_base_/levircd.yaml + +save_dir: ./test_tipc/output/cd/snunet/ + +model: !Node + type: SNUNet \ No newline at end of file diff --git a/test_tipc/configs/cd/snunet/train_infer_python.txt b/test_tipc/configs/cd/snunet/train_infer_python.txt new file mode 100644 index 0000000..264ffd9 --- /dev/null +++ b/test_tipc/configs/cd/snunet/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:cd:snunet +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=5|lite_train_whole_infer=5|whole_train_whole_infer=10 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=8 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/cd/snunet/snunet_airchange.yaml|lite_train_whole_infer=./test_tipc/configs/cd/snunet/snunet_airchange.yaml|whole_train_whole_infer=./test_tipc/configs/cd/snunet/snunet_levircd.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train cd +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:null +null:null +## +===========================export_params=========================== +--save_dir:adaptive +--model_dir:adaptive +--fixed_input_shape:[-1,3,256,256] +norm_export:deploy/export/export_model.py +quant_export:null +fpgm_export:null +distill_export:null +export1:null +export2:null +===========================infer_params=========================== +infer_model:null +infer_export:null +infer_quant:False +inference:test_tipc/infer.py +--device:cpu|gpu +--enable_mkldnn:True +--cpu_threads:6 +--batch_size:1 +--use_trt:False +--precision:fp32 +--model_dir:null +--config:null +--save_log_path:null +--benchmark:True +--model_name:snunet +null:null \ No newline at end of file diff --git a/test_tipc/configs/cd/stanet/stanet_airchange.yaml b/test_tipc/configs/cd/stanet/stanet_airchange.yaml new file mode 100644 index 0000000..7c7c05a --- /dev/null +++ b/test_tipc/configs/cd/stanet/stanet_airchange.yaml @@ -0,0 +1,8 @@ +# Configurations of STANet with AirChange dataset + +_base_: ../_base_/airchange.yaml + +save_dir: ./test_tipc/output/cd/stanet/ + +model: !Node + type: STANet \ No newline at end of file diff --git a/test_tipc/configs/cd/stanet/stanet_levircd.yaml b/test_tipc/configs/cd/stanet/stanet_levircd.yaml new file mode 100644 index 0000000..b439ff1 --- /dev/null +++ b/test_tipc/configs/cd/stanet/stanet_levircd.yaml @@ -0,0 +1,8 @@ +# Configurations of STANet with LEVIR-CD dataset + +_base_: ../_base_/levircd.yaml + +save_dir: ./test_tipc/output/cd/stanet/ + +model: !Node + type: STANet \ No newline at end of file diff --git a/test_tipc/configs/cd/stanet/train_infer_python.txt b/test_tipc/configs/cd/stanet/train_infer_python.txt new file mode 100644 index 0000000..0bff7df --- /dev/null +++ b/test_tipc/configs/cd/stanet/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:cd:stanet +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=5|lite_train_whole_infer=5|whole_train_whole_infer=10 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=8 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/cd/stanet/stanet_airchange.yaml|lite_train_whole_infer=./test_tipc/configs/cd/stanet/stanet_airchange.yaml|whole_train_whole_infer=./test_tipc/configs/cd/stanet/stanet_levircd.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train cd +pact_train:null +fpgm_train:null +distill_train:null +null:null +null:null +## +===========================eval_params=========================== +eval:null +null:null +## +===========================export_params=========================== +--save_dir:adaptive +--model_dir:adaptive +--fixed_input_shape:[-1,3,256,256] +norm_export:deploy/export/export_model.py +quant_export:null +fpgm_export:null +distill_export:null +export1:null +export2:null +===========================infer_params=========================== +infer_model:null +infer_export:null +infer_quant:False +inference:test_tipc/infer.py +--device:cpu|gpu +--enable_mkldnn:True +--cpu_threads:6 +--batch_size:1 +--use_trt:False +--precision:fp32 +--model_dir:null +--config:null +--save_log_path:null +--benchmark:True +--model_name:stanet +null:null \ No newline at end of file diff --git a/test_tipc/configs/clas/hrnet/hrnet.yaml b/test_tipc/configs/clas/hrnet/hrnet_ucmerced.yaml similarity index 62% rename from test_tipc/configs/clas/hrnet/hrnet.yaml rename to test_tipc/configs/clas/hrnet/hrnet_ucmerced.yaml index f402c26..088e722 100644 --- a/test_tipc/configs/clas/hrnet/hrnet.yaml +++ b/test_tipc/configs/clas/hrnet/hrnet_ucmerced.yaml @@ -1,4 +1,4 @@ -# Basic configurations of HRNet +# Configurations of HRNet with UCMerced dataset _base_: ../_base_/ucmerced.yaml diff --git a/test_tipc/configs/clas/hrnet/train_infer_python.txt b/test_tipc/configs/clas/hrnet/train_infer_python.txt index 23f3820..1116c77 100644 --- a/test_tipc/configs/clas/hrnet/train_infer_python.txt +++ b/test_tipc/configs/clas/hrnet/train_infer_python.txt @@ -8,12 +8,12 @@ use_gpu:null|null --save_dir:adaptive --train_batch_size:lite_train_lite_infer=16|lite_train_whole_infer=16|whole_train_whole_infer=16 --model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/clas/hrnet/hrnet_ucmerced.yaml|lite_train_whole_infer=./test_tipc/configs/clas/hrnet/hrnet_ucmerced.yaml|whole_train_whole_infer=./test_tipc/configs/clas/hrnet/hrnet_ucmerced.yaml train_model_name:best_model -train_infer_file_list:./test_tipc/data/ucmerced/:./test_tipc/data/ucmerced/val.txt null:null ## trainer:norm -norm_train:test_tipc/run_task.py train clas --config ./test_tipc/configs/clas/hrnet/hrnet.yaml +norm_train:test_tipc/run_task.py train clas pact_train:null fpgm_train:null distill_train:null @@ -46,7 +46,7 @@ inference:test_tipc/infer.py --use_trt:False --precision:fp32 --model_dir:null ---file_list:null:null +--config:null --save_log_path:null --benchmark:True --model_name:hrnet diff --git a/test_tipc/infer.py b/test_tipc/infer.py index 9ad6123..0be439b 100644 --- a/test_tipc/infer.py +++ b/test_tipc/infer.py @@ -13,6 +13,8 @@ from paddle.inference import PrecisionType from paddlers.tasks import load_model from paddlers.utils import logging +from config_utils import parse_configs + class _bool(object): def __new__(cls, x): @@ -285,7 +287,8 @@ class TIPCPredictor(object): if __name__ == '__main__': parser = argparse.ArgumentParser() - parser.add_argument('--file_list', type=str, nargs=2) + parser.add_argument('--config', type=str) + parser.add_argument('--inherit_off', action='store_true') parser.add_argument('--model_dir', type=str, default='./') parser.add_argument( '--device', type=str, choices=['cpu', 'gpu'], default='cpu') @@ -300,6 +303,11 @@ if __name__ == '__main__': args = parser.parse_args() + cfg = parse_configs(args.config, not args.inherit_off) + eval_dataset = cfg['datasets']['eval'] + data_dir = eval_dataset.args['data_dir'] + file_list = eval_dataset.args['file_list'] + predictor = TIPCPredictor( args.model_dir, device=args.device, @@ -310,7 +318,7 @@ if __name__ == '__main__': trt_precision_mode=args.precision, benchmark=args.benchmark) - predictor.predict(args.file_list[0], args.file_list[1]) + predictor.predict(data_dir, file_list) if args.benchmark: predictor.autolog.report() diff --git a/test_tipc/prepare.sh b/test_tipc/prepare.sh index ead48af..ac8267b 100644 --- a/test_tipc/prepare.sh +++ b/test_tipc/prepare.sh @@ -48,6 +48,8 @@ elif [[ ${MODE} == 'whole_train_whole_infer' ]]; then --out_dataset_dir "${DATA_DIR}/levircd" \ --crop_size 256 \ --crop_stride 256 + elif [[ ${task_name} == 'clas' ]]; then + download_and_unzip_dataset "${DATA_DIR}" ucmerced https://paddlers.bj.bcebos.com/datasets/ucmerced.zip fi fi diff --git a/tutorials/train/README.md b/tutorials/train/README.md index c63cf26..9c72107 100644 --- a/tutorials/train/README.md +++ b/tutorials/train/README.md @@ -9,11 +9,11 @@ |change_detection/changeformer.py | 变化检测 | ChangeFormer | |change_detection/dsamnet.py | 变化检测 | DSAMNet | |change_detection/dsifn.py | 变化检测 | DSIFN | -|change_detection/snunet.py | 变化检测 | SNUNet | -|change_detection/stanet.py | 变化检测 | STANet | |change_detection/fc_ef.py | 变化检测 | FC-EF | |change_detection/fc_siam_conc.py | 变化检测 | FC-Siam-conc | |change_detection/fc_siam_diff.py | 变化检测 | FC-Siam-diff | +|change_detection/snunet.py | 变化检测 | SNUNet | +|change_detection/stanet.py | 变化检测 | STANet | |classification/hrnet.py | 场景分类 | HRNet | |classification/mobilenetv3.py | 场景分类 | MobileNetV3 | |classification/resnet50_vd.py | 场景分类 | ResNet50-vd |