diff --git a/docs/intro/model_zoo.md b/docs/intro/model_zoo.md index 0fbafc7..9281df8 100644 --- a/docs/intro/model_zoo.md +++ b/docs/intro/model_zoo.md @@ -10,19 +10,20 @@ PaddleRS目前已支持的全部模型如下(标注\*的为遥感专用模型 |--------|---------|------| | 变化检测 | \*BIT | 是 | | 变化检测 | \*CDNet | 是 | +| 变化检测 | \*ChangeFormer | 是 | +| 变化检测 | \*ChangeStar | 否 | | 变化检测 | \*DSAMNet | 是 | | 变化检测 | \*DSIFN | 否 | -| 变化检测 | \*SNUNet | 是 | -| 变化检测 | \*STANet | 是 | | 变化检测 | \*FC-EF | 是 | | 变化检测 | \*FC-Siam-conc | 是 | | 变化检测 | \*FC-Siam-diff | 是 | -| 变化检测 | \*ChangeStar | 否 | -| 变化检测 | \*ChangeFormer | 是 | +| 变化检测 | \*FCCDN | 是 | +| 变化检测 | \*SNUNet | 是 | +| 变化检测 | \*STANet | 是 | +| 场景分类 | CondenseNetV2 | 是 | | 场景分类 | HRNet | 是 | | 场景分类 | MobileNetV3 | 是 | | 场景分类 | ResNet50-vd | 是 | -| 场景分类 | CondenseNetV2 | 是 | | 图像复原 | DRN | 否 | | 图像复原 | ESRGAN | 否 | | 图像复原 | LESRCNN | 否 | @@ -32,5 +33,5 @@ PaddleRS目前已支持的全部模型如下(标注\*的为遥感专用模型 | 目标检测 | PP-YOLOv2 | 是 | | 目标检测 | YOLOv3 | 是 | | 图像分割 | DeepLab V3+ | 是 | -| 图像分割 | UNet | 是 | | 图像分割 | \*FarSeg | 否 | +| 图像分割 | UNet | 是 | diff --git a/docs/intro/transforms.md b/docs/intro/transforms.md index 8bc25ee..a86e63e 100644 --- a/docs/intro/transforms.md +++ b/docs/intro/transforms.md @@ -6,27 +6,27 @@ PaddleRS对不同遥感任务需要的数据预处理/数据增强(合称为 | 数据变换算子名 | 用途 | 任务 | ... | | -------------------- | ------------------------------------------------- | -------- | ---- | -| Resize | 调整输入影像大小。 | 所有任务 | ... | -| RandomResize | 随机调整输入影像大小。 | 所有任务 | ... | -| ResizeByShort | 调整输入影像大小,保持纵横比不变(根据短边计算缩放系数)。 | 所有任务 | ... | -| RandomResizeByShort | 随机调整输入影像大小,保持纵横比不变(根据短边计算缩放系数)。 | 所有任务 | ... | -| ResizeByLong | 调整输入影像大小,保持纵横比不变(根据长边计算缩放系数)。 | 所有任务 | ... | -| RandomHorizontalFlip | 随机水平翻转输入影像。 | 所有任务 | ... | -| RandomVerticalFlip | 随机垂直翻转输入影像。 | 所有任务 | ... | -| Normalize | 对输入影像应用标准化。 | 所有任务 | ... | | CenterCrop | 对输入影像进行中心裁剪。 | 所有任务 | ... | -| RandomCrop | 对输入影像进行随机中心裁剪。 | 所有任务 | ... | -| RandomScaleAspect | 裁剪输入影像并重新缩放到原始尺寸。 | 所有任务 | ... | -| RandomExpand | 根据随机偏移扩展输入影像。 | 所有任务 | ... | -| Pad | 将输入影像填充到指定的大小。 | 所有任务 | ... | -| MixupImage | 将两幅影像(及对应的目标检测标注)混合在一起作为新的样本。 | 目标检测 | ... | +| Dehaze | 对输入图像进行去雾。 | 所有任务 | ... | | MatchRadiance | 对两个时相的输入影像进行相对辐射校正。 | 变化检测 | ... | -| RandomDistort | 对输入施加随机色彩变换。 | 所有任务 | ... | +| MixupImage | 将两幅影像(及对应的目标检测标注)混合在一起作为新的样本。 | 目标检测 | ... | +| Normalize | 对输入影像应用标准化。 | 所有任务 | ... | +| Pad | 将输入影像填充到指定的大小。 | 所有任务 | ... | | RandomBlur | 对输入施加随机模糊。 | 所有任务 | ... | -| Dehaze | 对输入图像进行去雾。 | 所有任务 | ... | +| RandomCrop | 对输入影像进行随机中心裁剪。 | 所有任务 | ... | +| RandomDistort | 对输入施加随机色彩变换。 | 所有任务 | ... | +| RandomExpand | 根据随机偏移扩展输入影像。 | 所有任务 | ... | +| RandomHorizontalFlip | 随机水平翻转输入影像。 | 所有任务 | ... | +| RandomResize | 随机调整输入影像大小。 | 所有任务 | ... | +| RandomResizeByShort | 随机调整输入影像大小,保持纵横比不变(根据短边计算缩放系数)。 | 所有任务 | ... | +| RandomScaleAspect | 裁剪输入影像并重新缩放到原始尺寸。 | 所有任务 | ... | +| RandomSwap | 随机交换两个时相的输入影像。 | 变化检测 | ... | +| RandomVerticalFlip | 随机竖直翻转输入影像。 | 所有任务 | ... | | ReduceDim | 对输入图像进行波段降维。 | 所有任务 | ... | +| Resize | 调整输入影像大小。 | 所有任务 | ... | +| ResizeByLong | 调整输入影像大小,保持纵横比不变(根据长边计算缩放系数)。 | 所有任务 | ... | +| ResizeByShort | 调整输入影像大小,保持纵横比不变(根据短边计算缩放系数)。 | 所有任务 | ... | | SelectBand | 对输入影像进行波段选择。 | 所有任务 | ... | -| RandomSwap | 随机交换两个时相的输入影像。 | 变化检测 | ... | | ... | ... | ... | ... | ## 组合算子 diff --git a/examples/rs_research/config_utils.py b/examples/rs_research/config_utils.py index 1effc1a..10e7129 100644 --- a/examples/rs_research/config_utils.py +++ b/examples/rs_research/config_utils.py @@ -132,7 +132,7 @@ def parse_args(*args, **kwargs): conflict_handler='resolve', parents=[cfg_parser]) # Global settings parser.add_argument('cmd', choices=['train', 'eval']) - parser.add_argument('task', choices=['cd', 'clas', 'det', 'seg']) + parser.add_argument('task', choices=['cd', 'clas', 'det', 'res', 'seg']) # Data parser.add_argument('--datasets', type=dict, default={}) diff --git a/paddlers/deploy/predictor.py b/paddlers/deploy/predictor.py index a73d43d..1b2c493 100644 --- a/paddlers/deploy/predictor.py +++ b/paddlers/deploy/predictor.py @@ -105,7 +105,7 @@ class Predictor(object): logging.warning( "Semantic segmentation models do not support TensorRT acceleration, " "TensorRT is forcibly disabled.") - elif 'RCNN' in self._model.__class__.__name__: + elif self._model.model_type == 'detector' and 'RCNN' in self._model.__class__.__name__: logging.warning( "RCNN models do not support TensorRT acceleration, " "TensorRT is forcibly disabled.") diff --git a/paddlers/tasks/base.py b/paddlers/tasks/base.py index 8eb8b14..34e684f 100644 --- a/paddlers/tasks/base.py +++ b/paddlers/tasks/base.py @@ -368,7 +368,7 @@ class BaseModel(metaclass=ModelMeta): else: outputs = self.train_step(step, data, self.net) - scheduler_step(self.optimizer) + scheduler_step(self.optimizer, outputs['loss']) train_avg_metrics.update(outputs) lr = self.optimizer.get_lr() diff --git a/paddlers/tasks/object_detector.py b/paddlers/tasks/object_detector.py index 3086bd5..6531481 100644 --- a/paddlers/tasks/object_detector.py +++ b/paddlers/tasks/object_detector.py @@ -255,32 +255,18 @@ class BaseDetector(BaseModel): """ args = self._pre_train(locals()) + args.pop('self') return self._real_train(**args) def _pre_train(self, in_args): return in_args - def _real_train(self, - num_epochs, - train_dataset, - train_batch_size=64, - eval_dataset=None, - optimizer=None, - save_interval_epochs=1, - log_interval_steps=10, - save_dir='output', - pretrain_weights='IMAGENET', - learning_rate=.001, - warmup_steps=0, - warmup_start_lr=0.0, - lr_decay_epochs=(216, 243), - lr_decay_gamma=0.1, - metric=None, - use_ema=False, - early_stop=False, - early_stop_patience=5, - use_vdl=True, - resume_checkpoint=None): + def _real_train( + self, num_epochs, train_dataset, train_batch_size, eval_dataset, + optimizer, save_interval_epochs, log_interval_steps, save_dir, + pretrain_weights, learning_rate, warmup_steps, warmup_start_lr, + lr_decay_epochs, lr_decay_gamma, metric, use_ema, early_stop, + early_stop_patience, use_vdl, resume_checkpoint): if self.status == 'Infer': logging.error( diff --git a/paddlers/tasks/restorer.py b/paddlers/tasks/restorer.py index f68264d..fe17f82 100644 --- a/paddlers/tasks/restorer.py +++ b/paddlers/tasks/restorer.py @@ -651,7 +651,7 @@ class DRN(BaseRestorer): def __init__(self, losses=None, sr_factor=4, - scale=(2, 4), + scales=(2, 4), n_blocks=30, n_feats=16, n_colors=3, @@ -660,10 +660,10 @@ class DRN(BaseRestorer): lq_loss_weight=0.1, dual_loss_weight=0.1, **params): - if sr_factor != max(scale): - raise ValueError(f"`sr_factor` must be equal to `max(scale)`.") + if sr_factor != max(scales): + raise ValueError(f"`sr_factor` must be equal to `max(scales)`.") params.update({ - 'scale': scale, + 'scale': scales, 'n_blocks': n_blocks, 'n_feats': n_feats, 'n_colors': n_colors, @@ -672,6 +672,7 @@ class DRN(BaseRestorer): }) self.lq_loss_weight = lq_loss_weight self.dual_loss_weight = dual_loss_weight + self.scales = scales super(DRN, self).__init__( model_name='DRN', losses=losses, sr_factor=sr_factor, **params) @@ -703,7 +704,7 @@ class DRN(BaseRestorer): lr.extend([ F.interpolate( inputs[0], scale_factor=s, mode='bicubic') - for s in net.generator.scale[:-1] + for s in self.scales[:-1] ]) loss = self.losses(sr[-1], inputs[1]) for i in range(1, len(sr)): @@ -716,7 +717,7 @@ class DRN(BaseRestorer): elif gan_mode == 'forward_dual': sr, lr = inputs[0], inputs[1] sr2lr = [] - n_scales = len(net.generator.scale) + n_scales = len(self.scales) for i in range(n_scales): sr2lr_i = net.generators[1 + i](sr[i - n_scales]) sr2lr.append(sr2lr_i) @@ -741,6 +742,7 @@ class DRN(BaseRestorer): (outputs['loss_prim'] + outputs['loss_dual']).backward() self.optimizer.step() return { + 'loss': outputs['loss_prim'] + outputs['loss_dual'], 'loss_prim': outputs['loss_prim'], 'loss_dual': outputs['loss_dual'] } diff --git a/paddlers/utils/utils.py b/paddlers/utils/utils.py index 5f0794a..90e32aa 100644 --- a/paddlers/utils/utils.py +++ b/paddlers/utils/utils.py @@ -243,20 +243,17 @@ class Timer(Times): def to_data_parallel(layers, *args, **kwargs): from paddlers.tasks.utils.res_adapters import GANAdapter if isinstance(layers, GANAdapter): - # Inplace modification for efficiency - layers.generators = [ - paddle.DataParallel(g, *args, **kwargs) for g in layers.generators - ] - layers.discriminators = [ - paddle.DataParallel(d, *args, **kwargs) - for d in layers.discriminators - ] + layers = GANAdapter( + [to_data_parallel(g, *args, **kwargs) for g in layers.generators], [ + to_data_parallel(d, *args, **kwargs) + for d in layers.discriminators + ]) else: layers = paddle.DataParallel(layers, *args, **kwargs) return layers -def scheduler_step(optimizer): +def scheduler_step(optimizer, loss=None): from paddlers.tasks.utils.res_adapters import OptimizerAdapter if not isinstance(optimizer, OptimizerAdapter): optimizer = [optimizer] diff --git a/test_tipc/README.md b/test_tipc/README.md index 8f72eb8..70fd203 100644 --- a/test_tipc/README.md +++ b/test_tipc/README.md @@ -23,11 +23,29 @@ | 任务类别 | 模型名称 | 基础
训练预测 | 更多
训练方式 | 更多
部署方式 | Slim
训练部署 | 更多
训练环境 | | :--- | :--- | :----: | :--------: | :----: | :----: | :----: | | 变化检测 | BIT | 支持 | - | - | - | +| 变化检测 | CDNet | 支持 | - | - | - | +| 变化检测 | DSAMNet | 支持 | - | - | - | +| 变化检测 | DSIFN | 支持 | - | - | - | +| 变化检测 | SNUNet | 支持 | - | - | - | +| 变化检测 | STANet | 支持 | - | - | - | +| 变化检测 | FC-EF | 支持 | - | - | - | +| 变化检测 | FC-Siam-conc | 支持 | - | - | - | +| 变化检测 | FC-Siam-diff | 支持 | - | - | - | +| 变化检测 | ChangeFormer | 支持 | - | - | - | | 场景分类 | HRNet | 支持 | - | - | - | +| 场景分类 | MobileNetV3 | 支持 | - | - | - | +| 场景分类 | ResNet50-vd | 支持 | - | - | - | +| 图像复原 | DRN | 支持 | - | - | - | +| 图像复原 | EARGAN | 支持 | - | - | - | +| 图像复原 | LESRCNN | 支持 | - | - | - | +| 目标检测 | Faster R-CNN | 支持 | - | - | - | | 目标检测 | PP-YOLO | 支持 | - | - | - | +| 目标检测 | PP-YOLO Tiny | 支持 | - | - | - | +| 目标检测 | PP-YOLOv2 | 支持 | - | - | - | +| 目标检测 | YOLOv3 | 支持 | - | - | - | +| 图像分割 | DeepLab V3+ | 支持 | - | - | - | | 图像分割 | UNet | 支持 | - | - | - | - ## 3 测试工具简介 ### 3.1 目录介绍 diff --git a/test_tipc/common_func.sh b/test_tipc/common_func.sh index 0690d87..d6b4bd4 100644 --- a/test_tipc/common_func.sh +++ b/test_tipc/common_func.sh @@ -86,12 +86,14 @@ function download_and_unzip_dataset() { rm -rf "${ds_path}" fi - wget -nc -P "${ds_dir}" "${url}" --no-check-certificate + wget -O "${ds_dir}/${zip_name}" "${url}" --no-check-certificate # The extracted file/directory must have the same name as the zip file. - cd "${ds_dir}" && unzip "${zip_name}" \ - && mv "${zip_name%.*}" ${ds_name} && cd - \ - && echo "Successfully downloaded ${zip_name} from ${url}. File saved in ${ds_path}. " + cd "${ds_dir}" && unzip "${zip_name}" + if [ "${zip_name%.*}" != "${ds_name}" ]; then + mv "${zip_name%.*}" "${ds_name}" + fi + cd - } function parse_extra_args() { diff --git a/test_tipc/config_utils.py b/test_tipc/config_utils.py index 9f1b6fc..6e677b4 100644 --- a/test_tipc/config_utils.py +++ b/test_tipc/config_utils.py @@ -118,7 +118,7 @@ def parse_args(*args, **kwargs): conflict_handler='resolve', parents=[cfg_parser]) # Global settings parser.add_argument('cmd', choices=['train', 'eval']) - parser.add_argument('task', choices=['cd', 'clas', 'det', 'seg']) + parser.add_argument('task', choices=['cd', 'clas', 'det', 'res', 'seg']) # Data parser.add_argument('--datasets', type=dict, default={}) diff --git a/test_tipc/configs/cd/_base_/airchange.yaml b/test_tipc/configs/cd/_base_/airchange.yaml index 38ec406..f41f05a 100644 --- a/test_tipc/configs/cd/_base_/airchange.yaml +++ b/test_tipc/configs/cd/_base_/airchange.yaml @@ -60,7 +60,7 @@ download_path: ./test_tipc/data/ num_epochs: 5 train_batch_size: 4 -save_interval_epochs: 3 +save_interval_epochs: 5 log_interval_steps: 50 save_dir: ./test_tipc/output/cd/ learning_rate: 0.01 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_airchange.yaml b/test_tipc/configs/cd/changeformer/changeformer_airchange.yaml new file mode 100644 index 0000000..15a37ea --- /dev/null +++ b/test_tipc/configs/cd/changeformer/changeformer_airchange.yaml @@ -0,0 +1,8 @@ +# Configurations of ChangeFormer with AirChange dataset + +_base_: ../_base_/airchange.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/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..73da148 --- /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=20 +--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..db1ade5 --- /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=20 +--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..245e4ed --- /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=20 +--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/fccdn/fccdn_airchange.yaml b/test_tipc/configs/cd/fccdn/fccdn_airchange.yaml new file mode 100644 index 0000000..12fc83e --- /dev/null +++ b/test_tipc/configs/cd/fccdn/fccdn_airchange.yaml @@ -0,0 +1,13 @@ +# Configurations of FCCDN with AirChange dataset + +_base_: ../_base_/airchange.yaml + +save_dir: ./test_tipc/output/cd/fccdn/ + +model: !Node + type: FCCDN + +learning_rate: 0.07 +lr_decay_power: 0.6 +log_interval_steps: 100 +save_interval_epochs: 3 \ No newline at end of file diff --git a/test_tipc/configs/cd/fccdn/fccdn_levircd.yaml b/test_tipc/configs/cd/fccdn/fccdn_levircd.yaml new file mode 100644 index 0000000..02586cb --- /dev/null +++ b/test_tipc/configs/cd/fccdn/fccdn_levircd.yaml @@ -0,0 +1,8 @@ +# Configurations of FCCDN with LEVIR-CD dataset + +_base_: ../_base_/levircd.yaml + +save_dir: ./test_tipc/output/cd/fccdn/ + +model: !Node + type: FCCDN \ No newline at end of file diff --git a/test_tipc/configs/cd/fccdn/train_infer_python.txt b/test_tipc/configs/cd/fccdn/train_infer_python.txt index 26147e5..b18ae87 100644 --- a/test_tipc/configs/cd/fccdn/train_infer_python.txt +++ b/test_tipc/configs/cd/fccdn/train_infer_python.txt @@ -1,19 +1,19 @@ ===========================train_params=========================== model_name:cd:fccdn python:python -gpu_list:0 +gpu_list:0|0,1 use_gpu:null|null --precision:null ---num_epochs:lite_train_lite_infer=15|lite_train_whole_infer=15|whole_train_whole_infer=15 +--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/fccdn/fccdn_airchange.yaml|lite_train_whole_infer=./test_tipc/configs/cd/fccdn/fccdn_airchange.yaml|whole_train_whole_infer=./test_tipc/configs/cd/fccdn/fccdn_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/fccdn/fccdn.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,8 +46,8 @@ 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:fccdn -null:null +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/_base_/ucmerced.yaml b/test_tipc/configs/clas/_base_/ucmerced.yaml index bff0b8f..1b3b79d 100644 --- a/test_tipc/configs/clas/_base_/ucmerced.yaml +++ b/test_tipc/configs/clas/_base_/ucmerced.yaml @@ -62,7 +62,7 @@ download_path: ./test_tipc/data/ num_epochs: 2 train_batch_size: 16 -save_interval_epochs: 5 +save_interval_epochs: 10 log_interval_steps: 50 save_dir: ./test_tipc/output/clas/ learning_rate: 0.01 diff --git a/test_tipc/configs/clas/hrnet/hrnet.yaml b/test_tipc/configs/clas/hrnet/hrnet.yaml index f402c26..4c9879f 100644 --- a/test_tipc/configs/clas/hrnet/hrnet.yaml +++ b/test_tipc/configs/clas/hrnet/hrnet.yaml @@ -6,5 +6,5 @@ save_dir: ./test_tipc/output/clas/hrnet/ model: !Node type: HRNet_W18_C - args: - num_classes: 21 \ No newline at end of file + args: + num_classes: 21 \ No newline at end of file diff --git a/test_tipc/configs/clas/hrnet/hrnet_ucmerced.yaml b/test_tipc/configs/clas/hrnet/hrnet_ucmerced.yaml new file mode 100644 index 0000000..3a09756 --- /dev/null +++ b/test_tipc/configs/clas/hrnet/hrnet_ucmerced.yaml @@ -0,0 +1,10 @@ +# Configurations of HRNet with UCMerced dataset + +_base_: ../_base_/ucmerced.yaml + +save_dir: ./test_tipc/output/clas/hrnet/ + +model: !Node + type: HRNet_W18_C + args: + num_classes: 21 \ No newline at end of file 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/configs/clas/mobilenetv3/mobilenetv3_ucmerced.yaml b/test_tipc/configs/clas/mobilenetv3/mobilenetv3_ucmerced.yaml new file mode 100644 index 0000000..becdd5f --- /dev/null +++ b/test_tipc/configs/clas/mobilenetv3/mobilenetv3_ucmerced.yaml @@ -0,0 +1,10 @@ +# Configurations of MobileNetV3 with UCMerced dataset + +_base_: ../_base_/ucmerced.yaml + +save_dir: ./test_tipc/output/clas/mobilenetv3/ + +model: !Node + type: MobileNetV3_small_x1_0 + args: + num_classes: 21 \ No newline at end of file diff --git a/test_tipc/configs/clas/mobilenetv3/train_infer_python.txt b/test_tipc/configs/clas/mobilenetv3/train_infer_python.txt new file mode 100644 index 0000000..50406f6 --- /dev/null +++ b/test_tipc/configs/clas/mobilenetv3/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:clas:mobilenetv3 +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|whole_train_whole_infer=10 +--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/mobilenetv3/mobilenetv3_ucmerced.yaml|lite_train_whole_infer=./test_tipc/configs/clas/mobilenetv3/mobilenetv3_ucmerced.yaml|whole_train_whole_infer=./test_tipc/configs/clas/mobilenetv3/mobilenetv3_ucmerced.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train clas +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:mobilenetv3 +null:null \ No newline at end of file diff --git a/test_tipc/configs/clas/resnet50_vd/resnet50_vd_ucmerced.yaml b/test_tipc/configs/clas/resnet50_vd/resnet50_vd_ucmerced.yaml new file mode 100644 index 0000000..4978cfc --- /dev/null +++ b/test_tipc/configs/clas/resnet50_vd/resnet50_vd_ucmerced.yaml @@ -0,0 +1,10 @@ +# Configurations of ResNet50-vd with UCMerced dataset + +_base_: ../_base_/ucmerced.yaml + +save_dir: ./test_tipc/output/clas/resnet50_vd/ + +model: !Node + type: ResNet50_vd + args: + num_classes: 21 \ No newline at end of file diff --git a/test_tipc/configs/clas/resnet50_vd/train_infer_python.txt b/test_tipc/configs/clas/resnet50_vd/train_infer_python.txt new file mode 100644 index 0000000..2295361 --- /dev/null +++ b/test_tipc/configs/clas/resnet50_vd/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:clas:resnet50_vd +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|whole_train_whole_infer=10 +--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/resnet50_vd/resnet50_vd_ucmerced.yaml|lite_train_whole_infer=./test_tipc/configs/clas/resnet50_vd/resnet50_vd_ucmerced.yaml|whole_train_whole_infer=./test_tipc/configs/clas/resnet50_vd/resnet50_vd_ucmerced.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train clas +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:resnet50_vd +null:null \ No newline at end of file diff --git a/test_tipc/configs/det/_base_/rsod.yaml b/test_tipc/configs/det/_base_/rsod.yaml new file mode 100644 index 0000000..a4fcf69 --- /dev/null +++ b/test_tipc/configs/det/_base_/rsod.yaml @@ -0,0 +1,72 @@ +# Basic configurations of RSOD dataset + +datasets: + train: !Node + type: VOCDetDataset + args: + data_dir: ./test_tipc/data/rsod/ + file_list: ./test_tipc/data/rsod/train.txt + label_list: ./test_tipc/data/rsod/labels.txt + shuffle: True + eval: !Node + type: VOCDetDataset + args: + data_dir: ./test_tipc/data/rsod/ + file_list: ./test_tipc/data/rsod/val.txt + label_list: ./test_tipc/data/rsod/labels.txt + shuffle: False +transforms: + train: + - !Node + type: DecodeImg + - !Node + type: RandomDistort + - !Node + type: RandomExpand + - !Node + type: RandomCrop + - !Node + type: RandomHorizontalFlip + - !Node + type: BatchRandomResize + args: + target_sizes: [320, 352, 384, 416, 448, 480, 512, 544, 576, 608] + interp: RANDOM + - !Node + type: Normalize + args: + mean: [0.485, 0.456, 0.406] + std: [0.229, 0.224, 0.225] + - !Node + type: ArrangeDetector + args: ['train'] + eval: + - !Node + type: DecodeImg + - !Node + type: Resize + args: + target_size: 608 + interp: CUBIC + - !Node + type: Normalize + args: + mean: [0.485, 0.456, 0.406] + std: [0.229, 0.224, 0.225] + - !Node + type: ArrangeDetector + args: ['eval'] +download_on: False + +num_epochs: 10 +train_batch_size: 4 +save_interval_epochs: 10 +log_interval_steps: 4 +save_dir: ./test_tipc/output/det/ +learning_rate: 0.0001 +use_vdl: False +resume_checkpoint: '' +train: + pretrain_weights: COCO + warmup_steps: 0 + warmup_start_lr: 0.0 \ No newline at end of file diff --git a/test_tipc/configs/det/_base_/sarship.yaml b/test_tipc/configs/det/_base_/sarship.yaml index c7c6afe..ba38220 100644 --- a/test_tipc/configs/det/_base_/sarship.yaml +++ b/test_tipc/configs/det/_base_/sarship.yaml @@ -62,10 +62,10 @@ download_path: ./test_tipc/data/ num_epochs: 10 train_batch_size: 4 -save_interval_epochs: 5 +save_interval_epochs: 10 log_interval_steps: 4 save_dir: ./test_tipc/output/det/ -learning_rate: 0.0005 +learning_rate: 0.0001 use_vdl: False resume_checkpoint: '' train: diff --git a/test_tipc/configs/det/faster_rcnn/faster_rcnn_rsod.yaml b/test_tipc/configs/det/faster_rcnn/faster_rcnn_rsod.yaml new file mode 100644 index 0000000..c9c3aa4 --- /dev/null +++ b/test_tipc/configs/det/faster_rcnn/faster_rcnn_rsod.yaml @@ -0,0 +1,10 @@ +# Configurations of Faster R-CNN with RSOD dataset + +_base_: ../_base_/rsod.yaml + +save_dir: ./test_tipc/output/det/faster_rcnn/ + +model: !Node + type: FasterRCNN + args: + num_classes: 4 \ No newline at end of file diff --git a/test_tipc/configs/det/faster_rcnn/faster_rcnn_sarship.yaml b/test_tipc/configs/det/faster_rcnn/faster_rcnn_sarship.yaml new file mode 100644 index 0000000..b958be3 --- /dev/null +++ b/test_tipc/configs/det/faster_rcnn/faster_rcnn_sarship.yaml @@ -0,0 +1,10 @@ +# Configurations of Faster R-CNN with SARShip dataset + +_base_: ../_base_/sarship.yaml + +save_dir: ./test_tipc/output/det/faster_rcnn/ + +model: !Node + type: FasterRCNN + args: + num_classes: 1 \ No newline at end of file diff --git a/test_tipc/configs/det/faster_rcnn/train_infer_python.txt b/test_tipc/configs/det/faster_rcnn/train_infer_python.txt new file mode 100644 index 0000000..679d81e --- /dev/null +++ b/test_tipc/configs/det/faster_rcnn/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:det:faster_rcnn +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|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 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/det/faster_rcnn/faster_rcnn_sarship.yaml|lite_train_whole_infer=./test_tipc/configs/det/faster_rcnn/faster_rcnn_sarship.yaml|whole_train_whole_infer=./test_tipc/configs/det/faster_rcnn/faster_rcnn_rsod.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train det +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,608,608] +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:faster_rcnn +null:null \ No newline at end of file diff --git a/test_tipc/configs/det/ppyolo/ppyolo_rsod.yaml b/test_tipc/configs/det/ppyolo/ppyolo_rsod.yaml new file mode 100644 index 0000000..32c7fca --- /dev/null +++ b/test_tipc/configs/det/ppyolo/ppyolo_rsod.yaml @@ -0,0 +1,10 @@ +# Configurations of PP-YOLO with RSOD dataset + +_base_: ../_base_/rsod.yaml + +save_dir: ./test_tipc/output/det/ppyolo/ + +model: !Node + type: PPYOLO + args: + num_classes: 4 \ No newline at end of file diff --git a/test_tipc/configs/det/ppyolo/ppyolo.yaml b/test_tipc/configs/det/ppyolo/ppyolo_sarship.yaml similarity index 56% rename from test_tipc/configs/det/ppyolo/ppyolo.yaml rename to test_tipc/configs/det/ppyolo/ppyolo_sarship.yaml index f36919c..a3fbf58 100644 --- a/test_tipc/configs/det/ppyolo/ppyolo.yaml +++ b/test_tipc/configs/det/ppyolo/ppyolo_sarship.yaml @@ -1,4 +1,4 @@ -# Basic configurations of PP-YOLO +# Configurations of PP-YOLO with SARShip dataset _base_: ../_base_/sarship.yaml @@ -6,5 +6,5 @@ save_dir: ./test_tipc/output/det/ppyolo/ model: !Node type: PPYOLO - args: - num_classes: 1 \ No newline at end of file + args: + num_classes: 1 \ No newline at end of file diff --git a/test_tipc/configs/det/ppyolo/train_infer_python.txt b/test_tipc/configs/det/ppyolo/train_infer_python.txt index 43a47fa..eadaaf4 100644 --- a/test_tipc/configs/det/ppyolo/train_infer_python.txt +++ b/test_tipc/configs/det/ppyolo/train_infer_python.txt @@ -4,16 +4,16 @@ python:python gpu_list:0|0,1 use_gpu:null|null --precision:null ---num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|whole_train_whole_infer=10 +--num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|whole_train_whole_infer=20 --save_dir:adaptive --train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=4 --model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/det/ppyolo/ppyolo_sarship.yaml|lite_train_whole_infer=./test_tipc/configs/det/ppyolo/ppyolo_sarship.yaml|whole_train_whole_infer=./test_tipc/configs/det/ppyolo/ppyolo_rsod.yaml train_model_name:best_model -train_infer_file_list:./test_tipc/data/sarship/:./test_tipc/data/sarship/eval.txt null:null ## trainer:norm -norm_train:test_tipc/run_task.py train det --config ./test_tipc/configs/det/ppyolo/ppyolo.yaml +norm_train:test_tipc/run_task.py train det 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:ppyolo diff --git a/test_tipc/configs/det/ppyolo_tiny/ppyolo_tiny_rsod.yaml b/test_tipc/configs/det/ppyolo_tiny/ppyolo_tiny_rsod.yaml new file mode 100644 index 0000000..cdd20a4 --- /dev/null +++ b/test_tipc/configs/det/ppyolo_tiny/ppyolo_tiny_rsod.yaml @@ -0,0 +1,10 @@ +# Configurations of PP-YOLO Tiny with RSOD dataset + +_base_: ../_base_/rsod.yaml + +save_dir: ./test_tipc/output/det/ppyolo_tiny/ + +model: !Node + type: PPYOLOTiny + args: + num_classes: 4 \ No newline at end of file diff --git a/test_tipc/configs/det/ppyolo_tiny/ppyolo_tiny_sarship.yaml b/test_tipc/configs/det/ppyolo_tiny/ppyolo_tiny_sarship.yaml new file mode 100644 index 0000000..24f67a6 --- /dev/null +++ b/test_tipc/configs/det/ppyolo_tiny/ppyolo_tiny_sarship.yaml @@ -0,0 +1,10 @@ +# Configurations of PP-YOLO Tiny with SARShip dataset + +_base_: ../_base_/sarship.yaml + +save_dir: ./test_tipc/output/det/ppyolo_tiny/ + +model: !Node + type: PPYOLOTiny + args: + num_classes: 1 \ No newline at end of file diff --git a/test_tipc/configs/det/ppyolo_tiny/train_infer_python.txt b/test_tipc/configs/det/ppyolo_tiny/train_infer_python.txt new file mode 100644 index 0000000..106610f --- /dev/null +++ b/test_tipc/configs/det/ppyolo_tiny/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:det:ppyolo_tiny +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|whole_train_whole_infer=20 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=4 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/det/ppyolo_tiny/ppyolo_tiny_sarship.yaml|lite_train_whole_infer=./test_tipc/configs/det/ppyolo_tiny/ppyolo_tiny_sarship.yaml|whole_train_whole_infer=./test_tipc/configs/det/ppyolo_tiny/ppyolo_tiny_rsod.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train det +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,608,608] +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:ppyolo_tiny +null:null \ No newline at end of file diff --git a/test_tipc/configs/det/ppyolov2/ppyolov2_rsod.yaml b/test_tipc/configs/det/ppyolov2/ppyolov2_rsod.yaml new file mode 100644 index 0000000..ec5c423 --- /dev/null +++ b/test_tipc/configs/det/ppyolov2/ppyolov2_rsod.yaml @@ -0,0 +1,10 @@ +# Configurations of PP-YOLOv2 with RSOD dataset + +_base_: ../_base_/rsod.yaml + +save_dir: ./test_tipc/output/det/ppyolov2/ + +model: !Node + type: PPYOLOv2 + args: + num_classes: 4 \ No newline at end of file diff --git a/test_tipc/configs/det/ppyolov2/ppyolov2_sarship.yaml b/test_tipc/configs/det/ppyolov2/ppyolov2_sarship.yaml new file mode 100644 index 0000000..45a9d36 --- /dev/null +++ b/test_tipc/configs/det/ppyolov2/ppyolov2_sarship.yaml @@ -0,0 +1,10 @@ +# Configurations of PP-YOLOv2 with SARShip dataset + +_base_: ../_base_/sarship.yaml + +save_dir: ./test_tipc/output/det/ppyolov2/ + +model: !Node + type: PPYOLOv2 + args: + num_classes: 1 \ No newline at end of file diff --git a/test_tipc/configs/det/ppyolov2/train_infer_python.txt b/test_tipc/configs/det/ppyolov2/train_infer_python.txt new file mode 100644 index 0000000..3825157 --- /dev/null +++ b/test_tipc/configs/det/ppyolov2/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:det:ppyolov2 +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|whole_train_whole_infer=20 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=4 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/det/ppyolov2/ppyolov2_sarship.yaml|lite_train_whole_infer=./test_tipc/configs/det/ppyolov2/ppyolov2_sarship.yaml|whole_train_whole_infer=./test_tipc/configs/det/ppyolov2/ppyolov2_rsod.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train det +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,608,608] +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:ppyolov2 +null:null \ No newline at end of file diff --git a/test_tipc/configs/det/yolov3/train_infer_python.txt b/test_tipc/configs/det/yolov3/train_infer_python.txt new file mode 100644 index 0000000..b60be01 --- /dev/null +++ b/test_tipc/configs/det/yolov3/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:det:yolov3 +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|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 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/det/yolov3/yolov3_sarship.yaml|lite_train_whole_infer=./test_tipc/configs/det/yolov3/yolov3_sarship.yaml|whole_train_whole_infer=./test_tipc/configs/det/yolov3/yolov3_rsod.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train det +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,608,608] +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:yolov3 +null:null \ No newline at end of file diff --git a/test_tipc/configs/det/yolov3/yolov3_rsod.yaml b/test_tipc/configs/det/yolov3/yolov3_rsod.yaml new file mode 100644 index 0000000..ce1d4df --- /dev/null +++ b/test_tipc/configs/det/yolov3/yolov3_rsod.yaml @@ -0,0 +1,10 @@ +# Configurations of YOLOv3 with RSOD dataset + +_base_: ../_base_/rsod.yaml + +save_dir: ./test_tipc/output/det/yolov3/ + +model: !Node + type: YOLOv3 + args: + num_classes: 4 \ No newline at end of file diff --git a/test_tipc/configs/det/yolov3/yolov3_sarship.yaml b/test_tipc/configs/det/yolov3/yolov3_sarship.yaml new file mode 100644 index 0000000..3e2659d --- /dev/null +++ b/test_tipc/configs/det/yolov3/yolov3_sarship.yaml @@ -0,0 +1,10 @@ +# Configurations of YOLOv3 with SARShip dataset + +_base_: ../_base_/sarship.yaml + +save_dir: ./test_tipc/output/det/yolov3/ + +model: !Node + type: YOLOv3 + args: + num_classes: 1 \ No newline at end of file diff --git a/test_tipc/configs/res/_base_/rssr.yaml b/test_tipc/configs/res/_base_/rssr.yaml new file mode 100644 index 0000000..c2d5265 --- /dev/null +++ b/test_tipc/configs/res/_base_/rssr.yaml @@ -0,0 +1,72 @@ +# Basic configurations of RSSR dataset + +datasets: + train: !Node + type: ResDataset + args: + data_dir: ./test_tipc/data/rssr/ + file_list: ./test_tipc/data/rssr/train.txt + num_workers: 0 + shuffle: True + sr_factor: 4 + eval: !Node + type: ResDataset + args: + data_dir: ./test_tipc/data/rssr/ + file_list: ./test_tipc/data/rssr/val.txt + num_workers: 0 + shuffle: False + sr_factor: 4 +transforms: + train: + - !Node + type: DecodeImg + - !Node + type: RandomCrop + args: + crop_size: 32 + - !Node + type: RandomHorizontalFlip + args: + prob: 0.5 + - !Node + type: RandomVerticalFlip + args: + prob: 0.5 + - !Node + type: Normalize + args: + mean: [0.0, 0.0, 0.0] + std: [1.0, 1.0, 1.0] + - !Node + type: ArrangeRestorer + args: ['train'] + eval: + - !Node + type: DecodeImg + - !Node + type: Resize + args: + target_size: 256 + - !Node + type: Normalize + args: + mean: [0.0, 0.0, 0.0] + std: [1.0, 1.0, 1.0] + - !Node + type: ArrangeRestorer + args: ['eval'] +download_on: False +download_url: https://paddlers.bj.bcebos.com/datasets/rssr.zip +download_path: ./test_tipc/data/ + +num_epochs: 10 +train_batch_size: 4 +save_interval_epochs: 10 +log_interval_steps: 10 +save_dir: ./test_tipc/output/res/ +learning_rate: 0.0005 +early_stop: False +early_stop_patience: 5 +use_vdl: False +resume_checkpoint: '' \ No newline at end of file diff --git a/test_tipc/configs/res/drn/drn_rssr.yaml b/test_tipc/configs/res/drn/drn_rssr.yaml new file mode 100644 index 0000000..52625cf --- /dev/null +++ b/test_tipc/configs/res/drn/drn_rssr.yaml @@ -0,0 +1,8 @@ +# Configurations of DRN with RSSR dataset + +_base_: ../_base_/rssr.yaml + +save_dir: ./test_tipc/output/res/drn/ + +model: !Node + type: DRN \ No newline at end of file diff --git a/test_tipc/configs/res/drn/train_infer_python.txt b/test_tipc/configs/res/drn/train_infer_python.txt new file mode 100644 index 0000000..c3ba4b0 --- /dev/null +++ b/test_tipc/configs/res/drn/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:res:drn +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|whole_train_whole_infer=20 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=4 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/res/drn/drn_rssr.yaml|lite_train_whole_infer=./test_tipc/configs/res/drn/drn_rssr.yaml|whole_train_whole_infer=./test_tipc/configs/res/drn/drn_rssr.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train res +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:drn +null:null \ No newline at end of file diff --git a/test_tipc/configs/res/esrgan/esrgan_rssr.yaml b/test_tipc/configs/res/esrgan/esrgan_rssr.yaml new file mode 100644 index 0000000..9dbb2f5 --- /dev/null +++ b/test_tipc/configs/res/esrgan/esrgan_rssr.yaml @@ -0,0 +1,8 @@ +# Configurations of ESRGAN with RSSR dataset + +_base_: ../_base_/rssr.yaml + +save_dir: ./test_tipc/output/res/esrgan/ + +model: !Node + type: ESRGAN \ No newline at end of file diff --git a/test_tipc/configs/res/esrgan/train_infer_python.txt b/test_tipc/configs/res/esrgan/train_infer_python.txt new file mode 100644 index 0000000..9aaab9b --- /dev/null +++ b/test_tipc/configs/res/esrgan/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:res:esrgan +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|whole_train_whole_infer=20 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=4 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/res/esrgan/esrgan_rssr.yaml|lite_train_whole_infer=./test_tipc/configs/res/esrgan/esrgan_rssr.yaml|whole_train_whole_infer=./test_tipc/configs/res/esrgan/esrgan_rssr.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train res +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:esrgan +null:null \ No newline at end of file diff --git a/test_tipc/configs/res/lesrcnn/lesrcnn_rssr.yaml b/test_tipc/configs/res/lesrcnn/lesrcnn_rssr.yaml new file mode 100644 index 0000000..6b4c193 --- /dev/null +++ b/test_tipc/configs/res/lesrcnn/lesrcnn_rssr.yaml @@ -0,0 +1,8 @@ +# Configurations of LESRCNN with RSSR dataset + +_base_: ../_base_/rssr.yaml + +save_dir: ./test_tipc/output/res/lesrcnn/ + +model: !Node + type: LESRCNN \ No newline at end of file diff --git a/test_tipc/configs/res/lesrcnn/train_infer_python.txt b/test_tipc/configs/res/lesrcnn/train_infer_python.txt new file mode 100644 index 0000000..97fac6f --- /dev/null +++ b/test_tipc/configs/res/lesrcnn/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:res:lesrcnn +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|whole_train_whole_infer=20 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=4 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/res/lesrcnn/lesrcnn_rssr.yaml|lite_train_whole_infer=./test_tipc/configs/res/lesrcnn/lesrcnn_rssr.yaml|whole_train_whole_infer=./test_tipc/configs/res/lesrcnn/lesrcnn_rssr.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train res +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:lesrcnn +null:null \ No newline at end of file diff --git a/test_tipc/configs/seg/_base_/rsseg.yaml b/test_tipc/configs/seg/_base_/rsseg.yaml index 2f1d588..de5b469 100644 --- a/test_tipc/configs/seg/_base_/rsseg.yaml +++ b/test_tipc/configs/seg/_base_/rsseg.yaml @@ -58,7 +58,7 @@ download_path: ./test_tipc/data/ num_epochs: 10 train_batch_size: 4 -save_interval_epochs: 5 +save_interval_epochs: 10 log_interval_steps: 4 save_dir: ./test_tipc/output/seg/ learning_rate: 0.001 diff --git a/test_tipc/configs/seg/deeplabv3p/deeplabv3p_rsseg.yaml b/test_tipc/configs/seg/deeplabv3p/deeplabv3p_rsseg.yaml new file mode 100644 index 0000000..c7e1248 --- /dev/null +++ b/test_tipc/configs/seg/deeplabv3p/deeplabv3p_rsseg.yaml @@ -0,0 +1,11 @@ +# Configurations of DeepLab V3+ with RSSeg dataset + +_base_: ../_base_/rsseg.yaml + +save_dir: ./test_tipc/output/seg/deeplabv3p/ + +model: !Node + type: DeepLabV3P + args: + in_channels: 10 + num_classes: 5 \ No newline at end of file diff --git a/test_tipc/configs/seg/deeplabv3p/train_infer_python.txt b/test_tipc/configs/seg/deeplabv3p/train_infer_python.txt new file mode 100644 index 0000000..de7cac6 --- /dev/null +++ b/test_tipc/configs/seg/deeplabv3p/train_infer_python.txt @@ -0,0 +1,53 @@ +===========================train_params=========================== +model_name:seg:deeplabv3p +python:python +gpu_list:0|0,1 +use_gpu:null|null +--precision:null +--num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|whole_train_whole_infer=30 +--save_dir:adaptive +--train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=4 +--model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/seg/deeplabv3p/deeplabv3p_rsseg.yaml|lite_train_whole_infer=./test_tipc/configs/seg/deeplabv3p/deeplabv3p_rsseg.yaml|whole_train_whole_infer=./test_tipc/configs/seg/deeplabv3p/deeplabv3p_rsseg.yaml +train_model_name:best_model +null:null +## +trainer:norm +norm_train:test_tipc/run_task.py train seg +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,10,512,512] +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:deeplabv3p +null:null \ No newline at end of file diff --git a/test_tipc/configs/seg/unet/train_infer_python.txt b/test_tipc/configs/seg/unet/train_infer_python.txt index 1a548e1..8abf325 100644 --- a/test_tipc/configs/seg/unet/train_infer_python.txt +++ b/test_tipc/configs/seg/unet/train_infer_python.txt @@ -4,16 +4,16 @@ python:python gpu_list:0|0,1 use_gpu:null|null --precision:null ---num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|whole_train_whole_infer=10 +--num_epochs:lite_train_lite_infer=3|lite_train_whole_infer=3|whole_train_whole_infer=20 --save_dir:adaptive --train_batch_size:lite_train_lite_infer=4|lite_train_whole_infer=4|whole_train_whole_infer=4 --model_path:null +--config:lite_train_lite_infer=./test_tipc/configs/seg/unet/unet_rsseg.yaml|lite_train_whole_infer=./test_tipc/configs/seg/unet/unet_rsseg.yaml|whole_train_whole_infer=./test_tipc/configs/seg/unet/unet_rsseg.yaml train_model_name:best_model -train_infer_file_list:./test_tipc/data/rsseg/:./test_tipc/data/rsseg/val.txt null:null ## trainer:norm -norm_train:test_tipc/run_task.py train seg --config ./test_tipc/configs/seg/unet/unet.yaml +norm_train:test_tipc/run_task.py train seg 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:unet diff --git a/test_tipc/configs/seg/unet/unet.yaml b/test_tipc/configs/seg/unet/unet.yaml deleted file mode 100644 index 045347c..0000000 --- a/test_tipc/configs/seg/unet/unet.yaml +++ /dev/null @@ -1,11 +0,0 @@ -# Basic configurations of UNet - -_base_: ../_base_/rsseg.yaml - -save_dir: ./test_tipc/output/seg/unet/ - -model: !Node - type: UNet - args: - in_channels: 10 - num_classes: 5 diff --git a/test_tipc/configs/seg/unet/unet_rsseg.yaml b/test_tipc/configs/seg/unet/unet_rsseg.yaml new file mode 100644 index 0000000..18211b5 --- /dev/null +++ b/test_tipc/configs/seg/unet/unet_rsseg.yaml @@ -0,0 +1,11 @@ +# Configurations of UNet with RSSeg dataset + +_base_: ../_base_/rsseg.yaml + +save_dir: ./test_tipc/output/seg/unet/ + +model: !Node + type: UNet + args: + in_channels: 10 + num_classes: 5 \ No newline at end of file diff --git a/test_tipc/docs/test_train_inference_python.md b/test_tipc/docs/test_train_inference_python.md index 5100f81..72a321b 100644 --- a/test_tipc/docs/test_train_inference_python.md +++ b/test_tipc/docs/test_train_inference_python.md @@ -6,22 +6,62 @@ Linux GPU/CPU 基础训练推理测试的主程序为`test_train_inference_pytho - 训练相关: -| 任务类别 | 模型名称 | 单机单卡 | 单机多卡 | -| :----: | :----: | :----: | :----: | -| 变化检测 | BIT | 正常训练 | 正常训练 | -| 场景分类 | HRNet | 正常训练 | 正常训练 | -| 目标检测 | PP-YOLO | 正常训练 | 正常训练 | -| 图像分割 | UNet | 正常训练 | 正常训练 | +| 任务类别 | 模型名称 | 单机单卡 | 单机多卡 | 参考预测精度 | +| :----: | :----: | :----: | :----: | :----: | +| 变化检测 | BIT | 正常训练 | 正常训练 | IoU=71.02% | +| 变化检测 | CDNet | 正常训练 | 正常训练 | IoU=56.02% | +| 变化检测 | ChangeFormer | 正常训练 | 正常训练 | IoU=61.65% | +| 变化检测 | DSAMNet | 正常训练 | 正常训练 | IoU=69.76% | +| 变化检测 | DSIFN | 正常训练 | 正常训练 | IoU=72.88% | +| 变化检测 | SNUNet | 正常训练 | 正常训练 | IoU=68.46% | +| 变化检测 | STANet | 正常训练 | 正常训练 | IoU=65.11% | +| 变化检测 | FC-EF | 正常训练 | 正常训练 | IoU=64.22% | +| 变化检测 | FC-Siam-conc | 正常训练 | 正常训练 | IoU=65.79% | +| 变化检测 | FC-Siam-diff | 正常训练 | 正常训练 | IoU=61.23% | +| 变化检测 | FCCDN | 正常训练 | 正常训练 | IoU=24.42% | +| 场景分类 | HRNet | 正常训练 | 正常训练 | Acc(top1)=99.37% | +| 场景分类 | MobileNetV3 | 正常训练 | 正常训练 | Acc(top1)=99.58% | +| 场景分类 | ResNet50-vd | 正常训练 | 正常训练 | Acc(top1)=99.26% | +| 图像复原 | DRN | 正常训练 | 正常训练 | PSNR=24.23 | +| 图像复原 | ESRGAN | 正常训练 | 正常训练 | PSNR=21.30 | +| 图像复原 | LESRCNN | 正常训练 | 正常训练 | PSNR=23.18 | +| 目标检测 | Faster R-CNN | 正常训练 | 正常训练 | mAP=46.99% | +| 目标检测 | PP-YOLO | 正常训练 | 正常训练 | mAP=56.02% | +| 目标检测 | PP-YOLO Tiny | 正常训练 | 正常训练 | mAP=44.27% | +| 目标检测 | PP-YOLOv2 | 正常训练 | 正常训练 | mAP=59.37% | +| 目标检测 | YOLOv3 | 正常训练 | 正常训练 | mAP=47.33% | +| 图像分割 | DeepLab V3+ | 正常训练 | 正常训练 | mIoU=56.05% | +| 图像分割 | UNet | 正常训练 | 正常训练 | mIoU=55.50% | + +*注:参考预测精度为whole_train_whole_infer模式下单卡训练汇报的精度数据。* - 推理相关: | 任务类别 | 模型名称 | device_CPU | device_GPU | batchsize | | :----: | :----: | :----: | :----: | :----: | -| 变化检测 | BIT | 支持 | 支持 | 1 | -| 场景分类 | HRNet | 支持 | 支持 | 1 | -| 目标检测 | YOLO | 支持 | 支持 | 1 | -| 图像分割 | UNet | 支持 | 支持 | 1 | - +| 变化检测 | BIT | 支持 | 支持 | 1 | +| 变化检测 | CDNet | 支持 | 支持 | 1 | +| 变化检测 | ChangeFormer | 支持 | 支持 | 1 | +| 变化检测 | DSAMNet | 支持 | 支持 | 1 | +| 变化检测 | DSIFN | 支持 | 支持 | 1 | +| 变化检测 | SNUNet | 支持 | 支持 | 1 | +| 变化检测 | STANet | 支持 | 支持 | 1 | +| 变化检测 | FC-EF | 支持 | 支持 | 1 | +| 变化检测 | FC-Siam-conc | 支持 | 支持 | 1 | +| 变化检测 | FC-Siam-diff | 支持 | 支持 | 1 | +| 场景分类 | HRNet | 支持 | 支持 | 1 | +| 场景分类 | MobileNetV3 | 支持 | 支持 | 1 | +| 场景分类 | ResNet50-vd | 支持 | 支持 | 1 | +| 图像复原 | DRN | 支持 | 支持 | 1 | +| 图像复原 | ESRGAN | 支持 | 支持 | 1 | +| 图像复原 | LESRCNN | 支持 | 支持 | 1 | +| 目标检测 | Faster R-CNN | 支持 | 支持 | 1 | +| 目标检测 | PP-YOLO | 支持 | 支持 | 1 | +| 目标检测 | PP-YOLO Tiny | 支持 | 支持 | 1 | +| 目标检测 | PP-YOLOv2 | 支持 | 支持 | 1 | +| 目标检测 | YOLOv3 | 支持 | 支持 | 1 | +| 图像分割 | DeepLab V3+ | 支持 | 支持 | 1 | +| 图像分割 | UNet | 支持 | 支持 | 1 | ## 2 测试流程 @@ -67,7 +107,7 @@ bash ./test_tipc/test_train_inference_python.sh test_tipc/configs/clas/hrnet/tra 运行相应指令后,在`test_tipc/output`目录中会自动保存运行日志。如lite_train_lite_infer模式下,该目录中可能存在以下文件: ``` -test_tipc/output/[task name]/[model name]/ +test_tipc/output/{task name}/{model name}/ |- results_python.log # 存储指令执行状态的日志 |- norm_gpus_0_autocast_null/ # GPU 0号卡上的训练日志和模型保存目录 ...... diff --git a/test_tipc/infer.py b/test_tipc/infer.py index 3672940..28a717f 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): @@ -101,7 +103,7 @@ class TIPCPredictor(object): logging.warning( "Semantic segmentation models do not support TensorRT acceleration, " "TensorRT is forcibly disabled.") - elif 'RCNN' in self._model.__class__.__name__: + elif self._model.model_type == 'detector' and 'RCNN' in self._model.__class__.__name__: logging.warning( "RCNN models do not support TensorRT acceleration, " "TensorRT is forcibly disabled.") @@ -123,7 +125,7 @@ class TIPCPredictor(object): ) else: try: - # Cache 10 different shapes for mkldnn to avoid memory leak + # Cache 10 different shapes for mkldnn to avoid memory leak. config.set_mkldnn_cache_capacity(10) config.enable_mkldnn() config.set_cpu_math_library_num_threads(mkl_thread_num) @@ -158,13 +160,23 @@ class TIPCPredictor(object): 'image2': preprocessed_samples[1], 'ori_shape': preprocessed_samples[2] } + elif self._model.model_type == 'restorer': + preprocessed_samples = { + 'image': preprocessed_samples[0], + 'tar_shape': preprocessed_samples[1] + } else: logging.error( "Invalid model type {}".format(self._model.model_type), exit=True) return preprocessed_samples - def postprocess(self, net_outputs, topk=1, ori_shape=None, transforms=None): + def postprocess(self, + net_outputs, + topk=1, + ori_shape=None, + tar_shape=None, + transforms=None): if self._model.model_type == 'classifier': true_topk = min(self._model.num_classes, topk) if self._model.postprocess is None: @@ -196,6 +208,12 @@ class TIPCPredictor(object): for k, v in zip(['bbox', 'bbox_num', 'mask'], net_outputs) } preds = self._model.postprocess(net_outputs) + elif self._model.model_type == 'restorer': + res_maps = self._model.postprocess( + net_outputs[0], + batch_tar_shape=tar_shape, + transforms=transforms.transforms) + preds = [{'res_map': res_map} for res_map in res_maps] else: logging.error( "Invalid model type {}.".format(self._model.model_type), @@ -232,6 +250,7 @@ class TIPCPredictor(object): net_outputs, topk, ori_shape=preprocessed_input.get('ori_shape', None), + tar_shape=preprocessed_input.get('tar_shape', None), transforms=transforms) if self.benchmark and time_it: @@ -285,7 +304,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 +320,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 +335,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..0198213 100644 --- a/test_tipc/prepare.sh +++ b/test_tipc/prepare.sh @@ -35,6 +35,8 @@ if [[ ${MODE} == 'lite_train_lite_infer' \ download_and_unzip_dataset "${DATA_DIR}" ucmerced https://paddlers.bj.bcebos.com/datasets/ucmerced.zip elif [[ ${task_name} == 'det' ]]; then download_and_unzip_dataset "${DATA_DIR}" sarship https://paddlers.bj.bcebos.com/datasets/sarship.zip + elif [[ ${task_name} == 'res' ]]; then + download_and_unzip_dataset "${DATA_DIR}" rssr https://paddlers.bj.bcebos.com/datasets/rssr_mini.zip elif [[ ${task_name} == 'seg' ]]; then download_and_unzip_dataset "${DATA_DIR}" rsseg https://paddlers.bj.bcebos.com/datasets/rsseg_mini.zip fi @@ -42,12 +44,26 @@ if [[ ${MODE} == 'lite_train_lite_infer' \ elif [[ ${MODE} == 'whole_train_whole_infer' ]]; then if [[ ${task_name} == 'cd' ]]; then + rm -rf "${DATA_DIR}/levircd" download_and_unzip_dataset "${DATA_DIR}" raw_levircd https://paddlers.bj.bcebos.com/datasets/raw/LEVIR-CD.zip \ && python tools/prepare_dataset/prepare_levircd.py \ --in_dataset_dir "${DATA_DIR}/raw_levircd" \ --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 + elif [[ ${task_name} == 'det' ]]; then + rm -rf "${DATA_DIR}/rsod" + download_and_unzip_dataset "${DATA_DIR}" raw_rsod https://paddlers.bj.bcebos.com/datasets/raw/RSOD.zip + python tools/prepare_dataset/prepare_rsod.py \ + --in_dataset_dir "${DATA_DIR}/raw_rsod" \ + --out_dataset_dir "${DATA_DIR}/rsod" \ + --seed 114514 + elif [[ ${task_name} == 'res' ]]; then + download_and_unzip_dataset "${DATA_DIR}" rssr https://paddlers.bj.bcebos.com/datasets/rssr.zip + elif [[ ${task_name} == 'seg' ]]; then + download_and_unzip_dataset "${DATA_DIR}" rsseg https://paddlers.bj.bcebos.com/datasets/rsseg.zip fi fi diff --git a/tests/run_examples.sh b/tests/run_examples.sh deleted file mode 100644 index f1f641a..0000000 --- a/tests/run_examples.sh +++ /dev/null @@ -1 +0,0 @@ -#!/usr/bin/env bash diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 236f055..94253e5 100644 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -15,6 +15,3 @@ done # Test tutorials bash run_tutorials.sh - -# Test examples -bash run_examples.sh diff --git a/tools/prepare_dataset/common.py b/tools/prepare_dataset/common.py index 1eb1b37..09eec87 100644 --- a/tools/prepare_dataset/common.py +++ b/tools/prepare_dataset/common.py @@ -1,4 +1,6 @@ import argparse +import random +import copy import os import os.path as osp from glob import glob @@ -198,6 +200,20 @@ def create_file_list(file_list, path_tuples, sep=' '): f.write(line + '\n') +def create_label_list(label_list, labels): + """ + Create label list. + + Args: + label_list (str): Path of label list to create. + labels (list[str]|tuple[str]]): Label names. + """ + + with open(label_list, 'w') as f: + for label in labels: + f.write(label + '\n') + + def link_dataset(src, dst): """ Make a symbolic link to a dataset. @@ -211,5 +227,57 @@ def link_dataset(src, dst): raise ValueError(f"{dst} exists and is not a directory.") elif not osp.exists(dst): os.makedirs(dst) + src = osp.realpath(src) name = osp.basename(osp.normpath(src)) os.symlink(src, osp.join(dst, name), target_is_directory=True) + + +def random_split(samples, + ratios=(0.7, 0.2, 0.1), + inplace=True, + drop_remainder=False): + """ + Randomly split the dataset into two or three subsets. + + Args: + samples (list): All samples of the dataset. + ratios (tuple[float], optional): If the length of `ratios` is 2, + the two elements indicate the ratios of samples used for training + and evaluation. If the length of `ratios` is 3, the three elements + indicate the ratios of samples used for training, validation, and + testing. Defaults to (0.7, 0.2, 0.1). + inplace (bool, optional): Whether to shuffle `samples` in place. + Defaults to True. + drop_remainder (bool, optional): Whether to discard the remaining samples. + If False, the remaining samples will be included in the last subset. + For example, if `ratios` is (0.7, 0.1) and `drop_remainder` is False, + the two subsets after splitting will contain 70% and 30% of the samples, + respectively. Defaults to False. + """ + + if not inplace: + samples = copy.deepcopy(samples) + + if len(samples) == 0: + raise ValueError("There are no samples!") + + if len(ratios) not in (2, 3): + raise ValueError("`len(ratios)` must be 2 or 3!") + + random.shuffle(samples) + + n_samples = len(samples) + acc_r = 0 + st_idx, ed_idx = 0, 0 + splits = [] + for r in ratios: + acc_r += r + ed_idx = round(acc_r * n_samples) + splits.append(samples[st_idx:ed_idx]) + st_idx = ed_idx + + if ed_idx < len(ratios) and not drop_remainder: + # Append remainder to the last split + splits[-1].append(splits[ed_idx:]) + + return splits \ No newline at end of file diff --git a/tools/prepare_dataset/prepare_rsod.py b/tools/prepare_dataset/prepare_rsod.py new file mode 100644 index 0000000..d9cd5ee --- /dev/null +++ b/tools/prepare_dataset/prepare_rsod.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python + +import random +import os.path as osp +from functools import reduce, partial + +from common import (get_default_parser, get_path_tuples, create_file_list, + link_dataset, random_split, create_label_list) + +CLASSES = ('aircraft', 'oiltank', 'overpass', 'playground') +SUBSETS = ('train', 'val', 'test') +SUBDIRS = ('JPEGImages', osp.sep.join(['Annotation', 'xml'])) +FILE_LIST_PATTERN = "{subset}.txt" +LABEL_LIST_NAME = "labels.txt" +URL = "" + +if __name__ == '__main__': + parser = get_default_parser() + parser.add_argument('--seed', type=int, default=None, help="Random seed.") + parser.add_argument( + '--ratios', + type=float, + nargs='+', + default=(0.7, 0.2, 0.1), + help="Ratios of each subset (train/val or train/val/test).") + args = parser.parse_args() + + if args.seed is not None: + random.seed(args.seed) + + if len(args.ratios) not in (2, 3): + raise ValueError("Wrong number of ratios!") + + out_dir = osp.join(args.out_dataset_dir, + osp.basename(osp.normpath(args.in_dataset_dir))) + + link_dataset(args.in_dataset_dir, args.out_dataset_dir) + + splits_list = [] + for cls in CLASSES: + path_tuples = get_path_tuples( + *(osp.join(out_dir, cls, subdir) for subdir in SUBDIRS), + data_dir=args.out_dataset_dir) + splits = random_split(path_tuples, ratios=args.ratios) + splits_list.append(splits) + splits = map(partial(reduce, list.__add__), zip(*splits_list)) + + for subset, split in zip(SUBSETS, splits): + file_list = osp.join( + args.out_dataset_dir, FILE_LIST_PATTERN.format(subset=subset)) + create_file_list(file_list, split) + print(f"Write file list to {file_list}.") + + label_list = osp.join(args.out_dataset_dir, LABEL_LIST_NAME) + create_label_list(label_list, CLASSES) + print(f"Write label list to {label_list}.") diff --git a/tutorials/train/README.md b/tutorials/train/README.md index 09d67cd..44e93a3 100644 --- a/tutorials/train/README.md +++ b/tutorials/train/README.md @@ -12,6 +12,7 @@ |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/fccdn.py | 变化检测 | FCCDN | |change_detection/snunet.py | 变化检测 | SNUNet | |change_detection/stanet.py | 变化检测 | STANet | |classification/hrnet.py | 场景分类 | HRNet | @@ -22,7 +23,7 @@ |image_restoration/lesrcnn.py | 图像复原 | LESRCNN | |object_detection/faster_rcnn.py | 目标检测 | Faster R-CNN | |object_detection/ppyolo.py | 目标检测 | PP-YOLO | -|object_detection/ppyolotiny.py | 目标检测 | PP-YOLO Tiny | +|object_detection/ppyolo_tiny.py | 目标检测 | PP-YOLO Tiny | |object_detection/ppyolov2.py | 目标检测 | PP-YOLOv2 | |object_detection/yolov3.py | 目标检测 | YOLOv3 | |semantic_segmentation/deeplabv3p.py | 图像分割 | DeepLab V3+ | diff --git a/tutorials/train/change_detection/bit.py b/tutorials/train/change_detection/bit.py index 83c96ce..10410f6 100644 --- a/tutorials/train/change_detection/bit.py +++ b/tutorials/train/change_detection/bit.py @@ -78,7 +78,7 @@ model = pdrs.tasks.cd.BIT() # 执行模型训练 model.train( - num_epochs=5, + num_epochs=10, train_dataset=train_dataset, train_batch_size=4, eval_dataset=eval_dataset, diff --git a/tutorials/train/change_detection/cdnet.py b/tutorials/train/change_detection/cdnet.py index 2aa2ad6..ca53f94 100644 --- a/tutorials/train/change_detection/cdnet.py +++ b/tutorials/train/change_detection/cdnet.py @@ -78,7 +78,7 @@ model = pdrs.tasks.cd.CDNet() # 执行模型训练 model.train( - num_epochs=5, + num_epochs=10, train_dataset=train_dataset, train_batch_size=4, eval_dataset=eval_dataset, diff --git a/tutorials/train/change_detection/changeformer.py b/tutorials/train/change_detection/changeformer.py index 58606c1..7d4c3cc 100644 --- a/tutorials/train/change_detection/changeformer.py +++ b/tutorials/train/change_detection/changeformer.py @@ -78,7 +78,7 @@ model = pdrs.tasks.cd.ChangeFormer() # 执行模型训练 model.train( - num_epochs=5, + num_epochs=10, train_dataset=train_dataset, train_batch_size=4, eval_dataset=eval_dataset, diff --git a/tutorials/train/change_detection/dsamnet.py b/tutorials/train/change_detection/dsamnet.py index 2a0d3ae..5d75af4 100644 --- a/tutorials/train/change_detection/dsamnet.py +++ b/tutorials/train/change_detection/dsamnet.py @@ -78,7 +78,7 @@ model = pdrs.tasks.cd.DSAMNet() # 执行模型训练 model.train( - num_epochs=5, + num_epochs=10, train_dataset=train_dataset, train_batch_size=4, eval_dataset=eval_dataset, diff --git a/tutorials/train/change_detection/dsifn.py b/tutorials/train/change_detection/dsifn.py index 6a2ed19..8186ba5 100644 --- a/tutorials/train/change_detection/dsifn.py +++ b/tutorials/train/change_detection/dsifn.py @@ -78,7 +78,7 @@ model = pdrs.tasks.cd.DSIFN() # 执行模型训练 model.train( - num_epochs=5, + num_epochs=10, train_dataset=train_dataset, train_batch_size=4, eval_dataset=eval_dataset, diff --git a/tutorials/train/change_detection/fc_ef.py b/tutorials/train/change_detection/fc_ef.py index 4324564..1a2f6ae 100644 --- a/tutorials/train/change_detection/fc_ef.py +++ b/tutorials/train/change_detection/fc_ef.py @@ -78,7 +78,7 @@ model = pdrs.tasks.cd.FCEarlyFusion() # 执行模型训练 model.train( - num_epochs=5, + num_epochs=10, train_dataset=train_dataset, train_batch_size=4, eval_dataset=eval_dataset, diff --git a/tutorials/train/change_detection/fc_siam_conc.py b/tutorials/train/change_detection/fc_siam_conc.py index d63f5dc..19c4912 100644 --- a/tutorials/train/change_detection/fc_siam_conc.py +++ b/tutorials/train/change_detection/fc_siam_conc.py @@ -78,7 +78,7 @@ model = pdrs.tasks.cd.FCSiamConc() # 执行模型训练 model.train( - num_epochs=5, + num_epochs=10, train_dataset=train_dataset, train_batch_size=4, eval_dataset=eval_dataset, diff --git a/tutorials/train/change_detection/fc_siam_diff.py b/tutorials/train/change_detection/fc_siam_diff.py index 55f8681..c289d8d 100644 --- a/tutorials/train/change_detection/fc_siam_diff.py +++ b/tutorials/train/change_detection/fc_siam_diff.py @@ -78,7 +78,7 @@ model = pdrs.tasks.cd.FCSiamDiff() # 执行模型训练 model.train( - num_epochs=5, + num_epochs=10, train_dataset=train_dataset, train_batch_size=4, eval_dataset=eval_dataset, diff --git a/tutorials/train/change_detection/snunet.py b/tutorials/train/change_detection/snunet.py index a4b6d65..37ef1a6 100644 --- a/tutorials/train/change_detection/snunet.py +++ b/tutorials/train/change_detection/snunet.py @@ -78,7 +78,7 @@ model = pdrs.tasks.cd.SNUNet() # 执行模型训练 model.train( - num_epochs=5, + num_epochs=10, train_dataset=train_dataset, train_batch_size=4, eval_dataset=eval_dataset, diff --git a/tutorials/train/change_detection/stanet.py b/tutorials/train/change_detection/stanet.py index 4fe9799..9659c5b 100644 --- a/tutorials/train/change_detection/stanet.py +++ b/tutorials/train/change_detection/stanet.py @@ -78,7 +78,7 @@ model = pdrs.tasks.cd.STANet() # 执行模型训练 model.train( - num_epochs=5, + num_epochs=10, train_dataset=train_dataset, train_batch_size=4, eval_dataset=eval_dataset, diff --git a/tutorials/train/object_detection/ppyolotiny.py b/tutorials/train/object_detection/ppyolo_tiny.py similarity index 100% rename from tutorials/train/object_detection/ppyolotiny.py rename to tutorials/train/object_detection/ppyolo_tiny.py