├── aiearth └── deeplearning │ ├── __init__.py │ ├── cloud │ ├── __init__.py │ ├── datasets │ │ └── __init__.py │ └── model.py │ ├── utils │ ├── __init__.py │ ├── pytorch2onnx │ │ └── __init__.py │ ├── flock.py │ └── colormap.py │ ├── model_zoo │ └── __init__.py │ ├── models │ ├── __init__.py │ ├── target_extraction │ │ ├── hooks │ │ │ └── __init__.py │ │ ├── __init__.py │ │ ├── losses │ │ │ └── __init__.py │ │ ├── segmentors │ │ │ └── __init__.py │ │ └── utils │ │ │ └── __init__.py │ ├── polybuilding │ │ ├── utils │ │ │ └── __init__.py │ │ ├── detectors │ │ │ └── __init__.py │ │ ├── dense_heads │ │ │ └── __init__.py │ │ └── __init__.py │ ├── changedet │ │ ├── losses │ │ │ └── __init__.py │ │ ├── decode_heads │ │ │ └── __init__.py │ │ ├── backbones │ │ │ ├── __init__.py │ │ │ └── efficientnet_pytorch │ │ │ │ └── __init__.py │ │ ├── __init__.py │ │ ├── necks │ │ │ └── __init__.py │ │ └── segmentors │ │ │ └── __init__.py │ └── landcover │ │ ├── losses │ │ ├── __init__.py │ │ └── semi.py │ │ ├── algorithms │ │ └── __init__.py │ │ ├── segmentors │ │ └── __init__.py │ │ ├── __init__.py │ │ ├── architectures │ │ ├── __init__.py │ │ ├── mmseg.py │ │ └── base.py │ │ └── builder.py │ ├── datasets │ ├── common │ │ └── __init__.py │ ├── mmseg │ │ ├── changedet │ │ │ ├── __init__.py │ │ │ └── pipelines │ │ │ │ ├── __init__.py │ │ │ │ └── test_time_aug.py │ │ ├── landcover │ │ │ ├── pipelines │ │ │ │ └── __init__.py │ │ │ └── __init__.py │ │ ├── target_extraction │ │ │ ├── __init__.py │ │ │ └── pipelines │ │ │ │ └── __init__.py │ │ └── __init__.py │ ├── mmdet │ │ ├── __init__.py │ │ └── polybuilding │ │ │ ├── __init__.py │ │ │ └── pipelines │ │ │ └── __init__.py │ ├── multispcetral │ │ └── __init__.py │ └── __init__.py │ ├── job │ ├── __init__.py │ └── train_job.py │ ├── trainer │ ├── exception.py │ ├── multispectral │ │ ├── __init__.py │ │ ├── train.sh │ │ ├── scripts │ │ │ ├── train_script_vit.py │ │ │ └── train_script_swin.py │ │ └── configs │ │ │ ├── r50.yaml │ │ │ ├── r50_0.1_linear.yaml │ │ │ ├── r50_1.0_finetune.yaml │ │ │ ├── vit_small_0.1_linear.yaml │ │ │ ├── vit_small_1.0_finetune.yaml │ │ │ ├── swin_tiny_0.1_linear.yaml │ │ │ └── swin_tiny_1.0_finetune.yaml │ ├── __init__.py │ ├── mmdet │ │ ├── __init__.py │ │ ├── configs │ │ │ ├── PolyBuilding │ │ │ │ ├── architecture.png │ │ │ │ └── README.md │ │ │ └── _base_ │ │ │ │ ├── default_runtime.py │ │ │ │ └── datasets │ │ │ │ └── aicrowd.py │ │ ├── vars.py │ │ └── mmdet_utils.py │ ├── utils.py │ ├── mmseg │ │ ├── __init__.py │ │ ├── vars.py │ │ ├── configs │ │ │ ├── _base_ │ │ │ │ ├── default_runtime.py │ │ │ │ ├── schedules │ │ │ │ │ ├── schedule_320k.py │ │ │ │ │ ├── schedule_20k.py │ │ │ │ │ ├── schedule_40k.py │ │ │ │ │ ├── schedule_80k.py │ │ │ │ │ └── schedule_160k.py │ │ │ │ └── models │ │ │ │ │ ├── lraspp_m-v3-d8.py │ │ │ │ │ ├── dpt_vit-b16.py │ │ │ │ │ ├── erfnet_fcn.py │ │ │ │ │ ├── segformer_mit-b0.py │ │ │ │ │ ├── fpn_r50.py │ │ │ │ │ ├── cgnet.py │ │ │ │ │ ├── segmenter_vit-b16_mask.py │ │ │ │ │ ├── ccnet_r50-d8.py │ │ │ │ │ ├── danet_r50-d8.py │ │ │ │ │ ├── pspnet_r50-d8.py │ │ │ │ │ ├── deeplabv3_r50-d8.py │ │ │ │ │ ├── fcn_r50-d8.py │ │ │ │ │ ├── isanet_r50-d8.py │ │ │ │ │ ├── upernet_r50.py │ │ │ │ │ ├── apcnet_r50-d8.py │ │ │ │ │ ├── dmnet_r50-d8.py │ │ │ │ │ ├── dnl_r50-d8.py │ │ │ │ │ ├── nonlocal_r50-d8.py │ │ │ │ │ ├── gcnet_r50-d8.py │ │ │ │ │ ├── emanet_r50-d8.py │ │ │ │ │ ├── ann_r50-d8.py │ │ │ │ │ ├── deeplabv3plus_r50-d8.py │ │ │ │ │ ├── fpn_poolformer_s12.py │ │ │ │ │ ├── ocrnet_r50-d8.py │ │ │ │ │ ├── psanet_r50-d8.py │ │ │ │ │ ├── twins_pcpvt-s_fpn.py │ │ │ │ │ ├── encnet_r50-d8.py │ │ │ │ │ ├── upernet_mae.py │ │ │ │ │ ├── upernet_beit.py │ │ │ │ │ ├── pspnet_unet_s5-d16.py │ │ │ │ │ ├── upernet_convnext.py │ │ │ │ │ ├── deeplabv3_unet_s5-d16.py │ │ │ │ │ ├── fcn_unet_s5-d16.py │ │ │ │ │ ├── fastfcn_r50-d32_jpu_psp.py │ │ │ │ │ ├── upernet_swin.py │ │ │ │ │ ├── fcn_hr18.py │ │ │ │ │ ├── twins_pcpvt-s_upernet.py │ │ │ │ │ ├── pointrend_r50.py │ │ │ │ │ ├── upernet_vit-b16_ln_mln.py │ │ │ │ │ └── fast_scnn.py │ │ │ ├── LandCover │ │ │ │ ├── fcn_hr18_1024x1024_16k_landcover_semi.py │ │ │ │ ├── fcn_hr18_1024x1024_16k_landcover.py │ │ │ │ ├── fcn_hr48_1024x1024_16k_landcover.py │ │ │ │ └── README.md │ │ │ ├── BuildingChange │ │ │ │ └── README.md │ │ │ ├── TargetExtraction │ │ │ │ └── README.md │ │ │ └── ChangeDet │ │ │ │ └── README.md │ │ ├── target_extraction_trainer.py │ │ ├── changedet_trainer.py │ │ └── mmseg_utils.py │ └── trainer.py │ └── sampler │ └── __init__.py ├── MANIFEST.in ├── benchmark └── loveda │ ├── run.sh │ ├── config │ ├── fcn_hr18_512x512_80k_loveda.py │ ├── fcn_hr18.py │ └── loveda.py │ └── loveda.py ├── sample └── changedet_with_custom_dataset │ ├── datasets │ ├── images1 │ │ ├── 239494.jpg │ │ ├── 239495.jpg │ │ ├── 239496.jpg │ │ ├── 239497.jpg │ │ ├── 239498.jpg │ │ ├── 239499.jpg │ │ ├── 239500.jpg │ │ ├── 239501.jpg │ │ ├── 239502.jpg │ │ ├── 239503.jpg │ │ ├── 239504.jpg │ │ ├── 239505.jpg │ │ ├── 239506.jpg │ │ ├── 239507.jpg │ │ ├── 239508.jpg │ │ ├── 239509.jpg │ │ ├── 239510.jpg │ │ ├── 239511.jpg │ │ ├── 239512.jpg │ │ ├── 239513.jpg │ │ ├── 239514.jpg │ │ ├── 239515.jpg │ │ ├── 239516.jpg │ │ ├── 239517.jpg │ │ ├── 239518.jpg │ │ ├── 239519.jpg │ │ ├── 239520.jpg │ │ ├── 239521.jpg │ │ ├── 239522.jpg │ │ ├── 239523.jpg │ │ ├── 239524.jpg │ │ ├── 239525.jpg │ │ ├── 239526.jpg │ │ ├── 239527.jpg │ │ ├── 239528.jpg │ │ ├── 239529.jpg │ │ ├── 239530.jpg │ │ ├── 239531.jpg │ │ ├── 239532.jpg │ │ ├── 239533.jpg │ │ ├── 239534.jpg │ │ ├── 239535.jpg │ │ ├── 239536.jpg │ │ ├── 239537.jpg │ │ ├── 239538.jpg │ │ ├── 239539.jpg │ │ ├── 239540.jpg │ │ ├── 239541.jpg │ │ ├── 239542.jpg │ │ ├── 239543.jpg │ │ ├── 239544.jpg │ │ ├── 239545.jpg │ │ ├── 239546.jpg │ │ ├── 239547.jpg │ │ ├── 239548.jpg │ │ ├── 239549.jpg │ │ ├── 239550.jpg │ │ ├── 239551.jpg │ │ ├── 239552.jpg │ │ ├── 239553.jpg │ │ ├── 239554.jpg │ │ ├── 239555.jpg │ │ ├── 239556.jpg │ │ ├── 239557.jpg │ │ ├── 239558.jpg │ │ ├── 239559.jpg │ │ ├── 239560.jpg │ │ ├── 239561.jpg │ │ ├── 239562.jpg │ │ ├── 239563.jpg │ │ ├── 239564.jpg │ │ ├── 239565.jpg │ │ ├── 239566.jpg │ │ ├── 239567.jpg │ │ ├── 239568.jpg │ │ ├── 239569.jpg │ │ ├── 239570.jpg │ │ ├── 239571.jpg │ │ ├── 239572.jpg │ │ └── 239573.jpg │ ├── images2 │ │ ├── 239494.jpg │ │ ├── 239495.jpg │ │ ├── 239496.jpg │ │ ├── 239497.jpg │ │ ├── 239498.jpg │ │ ├── 239499.jpg │ │ ├── 239500.jpg │ │ ├── 239501.jpg │ │ ├── 239502.jpg │ │ ├── 239503.jpg │ │ ├── 239504.jpg │ │ ├── 239505.jpg │ │ ├── 239506.jpg │ │ ├── 239507.jpg │ │ ├── 239508.jpg │ │ ├── 239509.jpg │ │ ├── 239510.jpg │ │ ├── 239511.jpg │ │ ├── 239512.jpg │ │ ├── 239513.jpg │ │ ├── 239514.jpg │ │ ├── 239515.jpg │ │ ├── 239516.jpg │ │ ├── 239517.jpg │ │ ├── 239518.jpg │ │ ├── 239519.jpg │ │ ├── 239520.jpg │ │ ├── 239521.jpg │ │ ├── 239522.jpg │ │ ├── 239523.jpg │ │ ├── 239524.jpg │ │ ├── 239525.jpg │ │ ├── 239526.jpg │ │ ├── 239527.jpg │ │ ├── 239528.jpg │ │ ├── 239529.jpg │ │ ├── 239530.jpg │ │ ├── 239531.jpg │ │ ├── 239532.jpg │ │ ├── 239533.jpg │ │ ├── 239534.jpg │ │ ├── 239535.jpg │ │ ├── 239536.jpg │ │ ├── 239537.jpg │ │ ├── 239538.jpg │ │ ├── 239539.jpg │ │ ├── 239540.jpg │ │ ├── 239541.jpg │ │ ├── 239542.jpg │ │ ├── 239543.jpg │ │ ├── 239544.jpg │ │ ├── 239545.jpg │ │ ├── 239546.jpg │ │ ├── 239547.jpg │ │ ├── 239548.jpg │ │ ├── 239549.jpg │ │ ├── 239550.jpg │ │ ├── 239551.jpg │ │ ├── 239552.jpg │ │ ├── 239553.jpg │ │ ├── 239554.jpg │ │ ├── 239555.jpg │ │ ├── 239556.jpg │ │ ├── 239557.jpg │ │ ├── 239558.jpg │ │ ├── 239559.jpg │ │ ├── 239560.jpg │ │ ├── 239561.jpg │ │ ├── 239562.jpg │ │ ├── 239563.jpg │ │ ├── 239564.jpg │ │ ├── 239565.jpg │ │ ├── 239566.jpg │ │ ├── 239567.jpg │ │ ├── 239568.jpg │ │ ├── 239569.jpg │ │ ├── 239570.jpg │ │ ├── 239571.jpg │ │ ├── 239572.jpg │ │ └── 239573.jpg │ └── annotations │ │ ├── 239494.png │ │ ├── 239495.png │ │ ├── 239496.png │ │ ├── 239497.png │ │ ├── 239498.png │ │ ├── 239499.png │ │ ├── 239500.png │ │ ├── 239501.png │ │ ├── 239502.png │ │ ├── 239503.png │ │ ├── 239504.png │ │ ├── 239505.png │ │ ├── 239506.png │ │ ├── 239507.png │ │ ├── 239508.png │ │ ├── 239509.png │ │ ├── 239510.png │ │ ├── 239511.png │ │ ├── 239512.png │ │ ├── 239513.png │ │ ├── 239514.png │ │ ├── 239515.png │ │ ├── 239516.png │ │ ├── 239517.png │ │ ├── 239518.png │ │ ├── 239519.png │ │ ├── 239520.png │ │ ├── 239521.png │ │ ├── 239522.png │ │ ├── 239523.png │ │ ├── 239524.png │ │ ├── 239525.png │ │ ├── 239526.png │ │ ├── 239527.png │ │ ├── 239528.png │ │ ├── 239529.png │ │ ├── 239530.png │ │ ├── 239531.png │ │ ├── 239532.png │ │ ├── 239533.png │ │ ├── 239534.png │ │ ├── 239535.png │ │ ├── 239536.png │ │ ├── 239537.png │ │ ├── 239538.png │ │ ├── 239539.png │ │ ├── 239540.png │ │ ├── 239541.png │ │ ├── 239542.png │ │ ├── 239543.png │ │ ├── 239544.png │ │ ├── 239545.png │ │ ├── 239546.png │ │ ├── 239547.png │ │ ├── 239548.png │ │ ├── 239549.png │ │ ├── 239550.png │ │ ├── 239551.png │ │ ├── 239552.png │ │ ├── 239553.png │ │ ├── 239554.png │ │ ├── 239555.png │ │ ├── 239556.png │ │ ├── 239557.png │ │ ├── 239558.png │ │ ├── 239559.png │ │ ├── 239560.png │ │ ├── 239561.png │ │ ├── 239562.png │ │ ├── 239563.png │ │ ├── 239564.png │ │ ├── 239565.png │ │ ├── 239566.png │ │ ├── 239567.png │ │ ├── 239568.png │ │ ├── 239569.png │ │ ├── 239570.png │ │ ├── 239571.png │ │ ├── 239572.png │ │ └── 239573.png │ └── sample_changedet_with_custom_dataset.py ├── release.md ├── requirements.txt ├── scripts └── build_pkg.sh └── docs ├── model └── custom_model.md ├── train └── pretrained_model.md └── dataset └── cloud.md /aiearth/deeplearning/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /aiearth/deeplearning/cloud/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /aiearth/deeplearning/utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /aiearth/deeplearning/model_zoo/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/common/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include deeplearning *.py 2 | -------------------------------------------------------------------------------- /aiearth/deeplearning/utils/pytorch2onnx/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /aiearth/deeplearning/job/__init__.py: -------------------------------------------------------------------------------- 1 | from .train_job import TrainJob -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/exception.py: -------------------------------------------------------------------------------- 1 | class TrainerException(Exception): 2 | pass -------------------------------------------------------------------------------- /benchmark/loveda/run.sh: -------------------------------------------------------------------------------- 1 | python -m torch.distributed.launch --nproc_per_node=8 loveda.py 2 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/multispectral/__init__.py: -------------------------------------------------------------------------------- 1 | from .multispectral_cls_trainer import MSClsTrainer 2 | -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/mmseg/changedet/__init__.py: -------------------------------------------------------------------------------- 1 | from .changedet import * 2 | from .pipelines import * 3 | -------------------------------------------------------------------------------- /benchmark/loveda/config/fcn_hr18_512x512_80k_loveda.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | './fcn_hr18.py', 3 | './loveda.py', 4 | ] 5 | -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/mmdet/__init__.py: -------------------------------------------------------------------------------- 1 | from .polybuilding import AICrowdDataset 2 | 3 | __all__ = ["AICrowdDataset"] 4 | -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/mmseg/landcover/pipelines/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- conding: utf-8 -*- 2 | from .semi_transforms import * 3 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/target_extraction/hooks/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- conding: utf-8 -*- 2 | from .SemiIterBasedRunner import * 3 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/polybuilding/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from .plot_utils import save_poly_viz 2 | 3 | __all__ = ['save_poly_viz'] 4 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/__init__.py: -------------------------------------------------------------------------------- 1 | import mmcv 2 | 3 | logger = mmcv.utils.get_logger("mmcv") 4 | logger.setLevel("WARNING") 5 | -------------------------------------------------------------------------------- /aiearth/deeplearning/sampler/__init__.py: -------------------------------------------------------------------------------- 1 | from .sampler import SequentialNonGeoDatasetSampler 2 | from .sampler import RandomNonGeoDatasetSampler -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/mmseg/target_extraction/__init__.py: -------------------------------------------------------------------------------- 1 | from .remote_sensing import * 2 | from .pipelines.custom_transforms import * 3 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/polybuilding/detectors/__init__.py: -------------------------------------------------------------------------------- 1 | from .deformable_poly import DeformablePoly 2 | 3 | __all__ = ['DeformablePoly'] 4 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmdet/__init__.py: -------------------------------------------------------------------------------- 1 | from .polybuilding_trainer import PolyBuildingTrainer 2 | 3 | __all__ = ["PolyBuildingTrainer"] 4 | -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/mmseg/landcover/__init__.py: -------------------------------------------------------------------------------- 1 | from .landcover import LandcoverLoader 2 | from .semi import * 3 | from .pipelines import * 4 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/polybuilding/dense_heads/__init__.py: -------------------------------------------------------------------------------- 1 | from .deformable_poly_head import DeformablePolyHead 2 | 3 | __all__ = ['DeformablePolyHead'] 4 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/changedet/losses/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- conding: utf-8 -*- 2 | from .dice_bce_loss import DiceBceLoss 3 | from .dice_ce_loss import DiceCeLoss 4 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/multispectral/train.sh: -------------------------------------------------------------------------------- 1 | CUDA_VISIBLE_DEVICES=0,1,2,3 python -m torch.distributed.launch --nproc_per_node 4 --master_port 12301 scripts/train_script_swin.py -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/multispcetral/__init__.py: -------------------------------------------------------------------------------- 1 | from .bigearthnet_dataset_seco import Bigearthnet 2 | from .bigearthnet_dataset_seco_lmdb_s2_uint8 import LMDBDataset, random_subset 3 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/changedet/decode_heads/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- conding: utf-8 -*- 2 | from .changedet_head import ChangeDetHead 3 | from .buildingchange_head import BuildingChangeHead 4 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/landcover/losses/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | # -*- conding: utf-8 -*- 3 | from .semi import * 4 | from .exp_semi3 import * 5 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/target_extraction/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- conding: utf-8 -*- 2 | from .segmentors import * 3 | from .losses import * 4 | from .hooks import * 5 | from .utils import * 6 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/target_extraction/losses/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- conding: utf-8 -*- 2 | from .custom_losses import * 3 | from .point_cross_entropy_loss import PointCrossEntropyLoss 4 | -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239494.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239494.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239495.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239495.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239496.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239496.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239497.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239497.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239498.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239498.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239499.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239499.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239500.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239500.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239501.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239501.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239502.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239502.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239503.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239503.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239504.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239504.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239505.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239505.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239506.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239506.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239507.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239507.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239508.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239508.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239509.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239509.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239510.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239510.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239511.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239511.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239512.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239512.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239513.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239513.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239514.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239514.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239515.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239515.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239516.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239516.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239517.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239517.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239518.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239518.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239519.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239519.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239520.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239520.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239521.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239521.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239522.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239522.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239523.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239523.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239524.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239524.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239525.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239525.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239526.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239526.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239527.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239527.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239528.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239528.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239529.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239529.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239530.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239530.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239531.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239531.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239532.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239532.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239533.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239533.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239534.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239534.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239535.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239535.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239536.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239536.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239537.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239537.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239538.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239538.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239539.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239539.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239540.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239540.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239541.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239541.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239542.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239542.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239543.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239543.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239544.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239544.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239545.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239545.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239546.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239546.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239547.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239547.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239548.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239548.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239549.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239549.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239550.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239550.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239551.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239551.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239552.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239552.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239553.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239553.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239554.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239554.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239555.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239555.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239556.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239556.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239557.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239557.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239558.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239558.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239559.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239559.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239560.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239560.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239561.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239561.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239562.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239562.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239563.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239563.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239564.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239564.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239565.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239565.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239566.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239566.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239567.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239567.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239568.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239568.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239569.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239569.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239570.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239570.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239571.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239571.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239572.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239572.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images1/239573.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images1/239573.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239494.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239494.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239495.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239495.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239496.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239496.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239497.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239497.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239498.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239498.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239499.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239499.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239500.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239500.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239501.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239501.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239502.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239502.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239503.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239503.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239504.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239504.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239505.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239505.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239506.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239506.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239507.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239507.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239508.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239508.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239509.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239509.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239510.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239510.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239511.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239511.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239512.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239512.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239513.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239513.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239514.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239514.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239515.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239515.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239516.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239516.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239517.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239517.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239518.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239518.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239519.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239519.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239520.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239520.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239521.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239521.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239522.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239522.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239523.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239523.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239524.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239524.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239525.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239525.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239526.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239526.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239527.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239527.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239528.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239528.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239529.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239529.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239530.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239530.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239531.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239531.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239532.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239532.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239533.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239533.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239534.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239534.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239535.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239535.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239536.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239536.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239537.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239537.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239538.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239538.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239539.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239539.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239540.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239540.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239541.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239541.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239542.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239542.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239543.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239543.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239544.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239544.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239545.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239545.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239546.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239546.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239547.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239547.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239548.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239548.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239549.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239549.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239550.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239550.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239551.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239551.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239552.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239552.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239553.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239553.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239554.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239554.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239555.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239555.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239556.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239556.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239557.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239557.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239558.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239558.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239559.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239559.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239560.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239560.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239561.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239561.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239562.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239562.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239563.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239563.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239564.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239564.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239565.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239565.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239566.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239566.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239567.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239567.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239568.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239568.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239569.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239569.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239570.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239570.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239571.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239571.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239572.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239572.jpg -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/images2/239573.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/images2/239573.jpg -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/mmdet/polybuilding/__init__.py: -------------------------------------------------------------------------------- 1 | from .aicrowd import AICrowdDataset 2 | from .pipelines.loading import LoadBuildingAnnotations 3 | 4 | __all__ = ['AICrowdDataset'] 5 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/landcover/algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | # -*- conding: utf-8 -*- 3 | from .semi_cps import * 4 | from .exp_cps2 import * 5 | -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239494.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239494.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239495.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239495.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239496.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239496.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239497.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239497.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239498.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239498.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239499.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239499.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239500.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239501.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239501.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239502.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239502.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239503.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239503.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239504.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239504.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239505.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239505.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239506.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239506.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239507.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239507.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239508.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239508.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239509.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239509.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239510.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239510.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239511.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239511.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239512.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239513.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239513.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239514.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239514.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239515.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239515.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239516.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239516.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239517.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239517.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239518.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239518.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239519.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239519.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239520.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239520.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239521.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239521.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239522.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239522.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239523.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239523.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239524.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239524.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239525.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239525.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239526.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239526.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239527.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239527.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239528.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239528.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239529.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239529.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239530.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239530.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239531.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239531.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239532.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239532.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239533.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239533.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239534.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239534.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239535.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239535.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239536.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239536.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239537.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239537.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239538.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239538.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239539.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239539.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239540.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239540.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239541.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239541.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239542.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239542.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239543.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239543.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239544.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239544.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239545.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239545.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239546.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239546.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239547.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239547.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239548.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239548.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239549.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239549.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239550.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239550.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239551.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239551.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239552.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239552.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239553.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239553.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239554.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239554.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239555.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239555.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239556.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239556.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239557.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239557.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239558.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239558.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239559.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239559.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239560.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239560.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239561.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239561.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239562.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239562.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239563.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239563.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239564.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239564.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239565.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239565.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239566.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239566.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239567.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239567.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239568.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239568.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239569.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239569.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239570.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239570.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239571.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239571.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239572.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239572.png -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/datasets/annotations/239573.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/sample/changedet_with_custom_dataset/datasets/annotations/239573.png -------------------------------------------------------------------------------- /aiearth/deeplearning/models/landcover/segmentors/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- conding: utf-8 -*- 2 | from .encoder_decoder_landcover import EncoderDecoderLandcover 3 | 4 | __all__ = ["EncoderDecoderLandcover"] 5 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/target_extraction/segmentors/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- conding: utf-8 -*- 2 | from .encoder_decoder_binary import EncoderDecoderBinary 3 | 4 | __all__ = ["EncoderDecoderBinary"] 5 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/target_extraction/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- conding: utf-8 -*- 2 | from .custom_layers import DSBatchNorm, SyncDSBatchNorm 3 | 4 | __all__ = ["SyncDSBatchNorm", "DSBatchNorm"] 5 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmdet/configs/PolyBuilding/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aiearth-damo/deeplearning/HEAD/aiearth/deeplearning/trainer/mmdet/configs/PolyBuilding/architecture.png -------------------------------------------------------------------------------- /aiearth/deeplearning/models/polybuilding/__init__.py: -------------------------------------------------------------------------------- 1 | from .dense_heads import * # noqa: F401,F403 2 | from .detectors import DeformablePoly # noqa: F401,F403 3 | 4 | # __all__ = [ 5 | # "DETECTORS", 6 | # ] 7 | -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/mmdet/polybuilding/pipelines/__init__.py: -------------------------------------------------------------------------------- 1 | from .loading import LoadBuildingAnnotations 2 | from .structures import PolygonMasks 3 | 4 | __all__ = ['LoadBuildingAnnotations', 'PolygonMasks'] 5 | -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/mmseg/changedet/pipelines/__init__.py: -------------------------------------------------------------------------------- 1 | from .double_img_formating import * 2 | from .double_img_loading import * 3 | from .double_img_transforms import * 4 | from .test_time_aug import * 5 | -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/mmseg/target_extraction/pipelines/__init__.py: -------------------------------------------------------------------------------- 1 | from .custom_transforms import * 2 | from .test_time_aug import * 3 | from .randaug import Rand_Augment 4 | from .autoaugment import ImageNetPolicy -------------------------------------------------------------------------------- /aiearth/deeplearning/models/landcover/__init__.py: -------------------------------------------------------------------------------- 1 | from .builder import * 2 | from .algorithms import * 3 | from .architectures import * 4 | from .losses import * 5 | from .segmentors import * 6 | # from .utils import * 7 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/landcover/architectures/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | # -*- conding: utf-8 -*- 3 | from .mmseg import MMSegArchitecture 4 | 5 | __all__ = ["MMSegArchitecture"] 6 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/changedet/backbones/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- conding: utf-8 -*- 2 | from .efficient import EfficientNet 3 | from .changesehrnet import ChangeSEHRNet 4 | from .changeseresnet import ChangeSEResNet 5 | from .seresnet import SEResNet 6 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/multispectral/scripts/train_script_vit.py: -------------------------------------------------------------------------------- 1 | from aiearth.deeplearning.trainer.multispectral import MSClsTrainer 2 | trainer=MSClsTrainer(work_dir="./work_dirs", config_name="swin_tiny_0.1_linear.yaml") 3 | print(trainer.cfg) 4 | trainer.train(validate=True) -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/multispectral/scripts/train_script_swin.py: -------------------------------------------------------------------------------- 1 | from aiearth.deeplearning.trainer.multispectral import MSClsTrainer 2 | trainer=MSClsTrainer(work_dir="./work_dirs", config_name="swin_tiny_0.1_linear.yaml") 3 | print(trainer.cfg) 4 | trainer.train(validate=True) -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/utils.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | import torch 4 | 5 | 6 | def fix_random_seeds(seed=42): 7 | """ 8 | Fix random seeds. 9 | """ 10 | torch.manual_seed(seed) 11 | torch.cuda.manual_seed_all(seed) 12 | np.random.seed(seed) 13 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/__init__.py: -------------------------------------------------------------------------------- 1 | from .changedet_trainer import ChangeDetTrainer 2 | from .landcover_trainer import LandcoverTrainer 3 | from .target_extraction_trainer import TargetExtractionTrainer 4 | 5 | __all__ = ["ChangeDetTrainer", "LandcoverTrainer", "TargetExtractionTrainer"] 6 | -------------------------------------------------------------------------------- /release.md: -------------------------------------------------------------------------------- 1 | ## aiearth-deeplearning-0.0.2 2 | * 仓库重命名为`deeplearning`,相关方法使用改为`from aiearth.deeplearning.xx import xx`。 3 | * 添加云平台24中数据集作为内置的支持项。 4 | * 增加4种预训练模型,可用于自定义微调。 5 | 6 | ## aiearth-deeplearning-0.0.3 7 | * 移除mmseg库的相关源代码,改为pip依赖,减轻SDK,重构相关代码。 8 | * 新增mmdet等依赖,加入建筑物矢量提取(检测类任务)PolyBuilding、多光谱预训练模型(分类任务)等面向遥感的多种任务类型。 9 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/changedet/backbones/efficientnet_pytorch/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- conding: utf-8 -*- 2 | __version__ = "0.7.1" 3 | from .model import EfficientNet, VALID_MODELS 4 | from .utils import ( 5 | GlobalParams, 6 | BlockArgs, 7 | BlockDecoder, 8 | efficientnet, 9 | get_model_params, 10 | ) 11 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmdet/vars.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | 4 | CONFIG_BASE_DIR = os.path.join(os.path.dirname(__file__), "configs") 5 | RUNTIME_CONFIG_PATH = os.path.join(CONFIG_BASE_DIR, "_base_", "default_runtime.py") 6 | 7 | DEFAULT_CFG = { 8 | "seed": 0, 9 | "gpu_ids": range(1), 10 | "device": "cuda", 11 | } 12 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/changedet/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | from mmcv.utils import Config 3 | from .decode_heads import ChangeDetHead 4 | from .segmentors import ChangedetEncoderDecoder, ChangedetSymmetryEncoderDecoder 5 | from .backbones import EfficientNet 6 | from .necks import ChangeDetCat, ChangeDetCatBifpn 7 | from .losses import DiceBceLoss 8 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/changedet/necks/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- conding: utf-8 -*- 2 | from .changedet_neck import ( 3 | ChangeDetCat, 4 | ChangeDetCatBatch, 5 | ChangeDetCatBifpn, 6 | ChangeSE, 7 | ChangeDetSubtract, 8 | ChangeDetSubAddCat, 9 | ChangeDetCatBifpnShift, 10 | ChangeDetSubBifpn, 11 | ChangeDetCatBifpnShiftNoWarp, 12 | ) 13 | -------------------------------------------------------------------------------- /benchmark/loveda/loveda.py: -------------------------------------------------------------------------------- 1 | from aiearth.deeplearning.trainer.mmseg import LandcoverTrainer 2 | 3 | 4 | if __name__ == '__main__': 5 | work_dir = "./work_dirs" 6 | 7 | # model 8 | trainer = LandcoverTrainer(work_dir=work_dir) 9 | trainer.set_base_cfg_from_file("config/fcn_hr18_512x512_80k_loveda.py") 10 | 11 | trainer.train(validate=True) 12 | 13 | -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/mmseg/__init__.py: -------------------------------------------------------------------------------- 1 | from .changedet import ChangeDetDataset 2 | from .target_extraction import RemoteSensingBinary 3 | from .landcover import LandcoverLoader, SemiDataset, SemiLargeScaleDataset 4 | 5 | __all__ = [ 6 | "ChangeDetDataset", 7 | "RemoteSensingBinary", 8 | "LandcoverLoader", 9 | "SemiDataset", 10 | "SemiLargeScaleDataset", 11 | ] 12 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/vars.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | 4 | CONFIG_BASE_DIR = os.path.join(os.path.dirname(__file__), "configs") 5 | RUNTIME_CONFIG_PATH = os.path.join(CONFIG_BASE_DIR, "_base_", "default_runtime.py") 6 | SCHEDULE_CONFIG_PATH = os.path.join(CONFIG_BASE_DIR, "_base_", "schedules", "schedule_20k.py") 7 | 8 | DEFAULT_CFG = { 9 | "seed" : 0, 10 | "gpu_ids" : range(1), 11 | "device" : "cuda", 12 | } -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | aie-sdk 2 | albumentations 3 | imgaug 4 | mmsegmentation==0.29.1 5 | mmdet==2.28.2 6 | numpy<=1.23.0 7 | onnx 8 | onnxruntime 9 | onnxsim 10 | opencv-python 11 | opencv-python-headless 12 | openmim 13 | prettytable 14 | pycocotools 15 | pytest 16 | rasterio 17 | scikit-image 18 | tensorboard 19 | torch < 2.0.0 20 | torchvision 21 | tqdm 22 | opencv-torchvision-transforms-yuzhiyang 23 | lmdb 24 | easydict 25 | descartes 26 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/default_runtime.py: -------------------------------------------------------------------------------- 1 | # yapf:disable 2 | log_config = dict( 3 | interval=50, 4 | hooks=[ 5 | dict(type="TextLoggerHook", by_epoch=False), 6 | dict(type="TensorboardLoggerHook"), 7 | ], 8 | ) 9 | # yapf:enable 10 | dist_params = dict(backend="nccl") 11 | log_level = "INFO" 12 | load_from = None 13 | resume_from = None 14 | workflow = [("train", 1)] 15 | cudnn_benchmark = True 16 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/landcover/architectures/mmseg.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | # -*- conding: utf-8 -*- 3 | from ..builder import ARCHITECTURES 4 | from .base import BaseArchitecture 5 | 6 | 7 | @ARCHITECTURES.register_module() 8 | class MMSegArchitecture(BaseArchitecture): 9 | """Architecture based on MMSeg.""" 10 | 11 | def __init__(self, **kwargs): 12 | super(MMSegArchitecture, self).__init__(**kwargs) 13 | -------------------------------------------------------------------------------- /aiearth/deeplearning/cloud/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | from .aie_dataset import AIEDataSet 2 | from .aie_dataset import LandcoverDataset 3 | from .aie_dataset import BinaryChangeDetDataset 4 | from .aie_dataset import TargetExtractionDataset 5 | from .public_dataset_meta import PublicDatasetMeta 6 | 7 | __all__ = [ 8 | "AIEDataSet", 9 | "LandcoverDataset", 10 | "BinaryChangeDetDataset", 11 | "TargetExtractionDataset", 12 | "PublicDatasetMeta", 13 | ] 14 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/schedules/schedule_320k.py: -------------------------------------------------------------------------------- 1 | # optimizer 2 | optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) 3 | optimizer_config = dict() 4 | # learning policy 5 | lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) 6 | # runtime settings 7 | runner = dict(type='IterBasedRunner', max_iters=320000) 8 | checkpoint_config = dict(by_epoch=False, interval=32000) 9 | evaluation = dict(interval=32000, metric='mIoU') 10 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/schedules/schedule_20k.py: -------------------------------------------------------------------------------- 1 | # optimizer 2 | optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) 3 | optimizer_config = dict() 4 | # learning policy 5 | lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) 6 | # runtime settings 7 | runner = dict(type='IterBasedRunner', max_iters=20000) 8 | checkpoint_config = dict(by_epoch=False, interval=2000) 9 | evaluation = dict(interval=2000, metric='mIoU', pre_eval=True) 10 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/schedules/schedule_40k.py: -------------------------------------------------------------------------------- 1 | # optimizer 2 | optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) 3 | optimizer_config = dict() 4 | # learning policy 5 | lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) 6 | # runtime settings 7 | runner = dict(type='IterBasedRunner', max_iters=40000) 8 | checkpoint_config = dict(by_epoch=False, interval=4000) 9 | evaluation = dict(interval=4000, metric='mIoU', pre_eval=True) 10 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/schedules/schedule_80k.py: -------------------------------------------------------------------------------- 1 | # optimizer 2 | optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) 3 | optimizer_config = dict() 4 | # learning policy 5 | lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) 6 | # runtime settings 7 | runner = dict(type='IterBasedRunner', max_iters=80000) 8 | checkpoint_config = dict(by_epoch=False, interval=8000) 9 | evaluation = dict(interval=8000, metric='mIoU', pre_eval=True) 10 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/schedules/schedule_160k.py: -------------------------------------------------------------------------------- 1 | # optimizer 2 | optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005) 3 | optimizer_config = dict() 4 | # learning policy 5 | lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) 6 | # runtime settings 7 | runner = dict(type='IterBasedRunner', max_iters=160000) 8 | checkpoint_config = dict(by_epoch=False, interval=16000) 9 | evaluation = dict(interval=16000, metric='mIoU', pre_eval=True) 10 | -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/__init__.py: -------------------------------------------------------------------------------- 1 | from .datasets import NonGeoCustomDataset 2 | from .datasets import Dataset 3 | from .datasets import ChangeDetNonGeoCustomDataset 4 | from .datasets import LandcoverNonGeoCustomDataset 5 | from .datasets import TargetExtractionNonGeoCustomDataset 6 | 7 | from .mmseg import ( 8 | ChangeDetDataset, 9 | RemoteSensingBinary, 10 | LandcoverLoader, 11 | SemiDataset, 12 | SemiLargeScaleDataset, 13 | ) 14 | from .mmdet import AICrowdDataset 15 | from .multispcetral import Bigearthnet, LMDBDataset, random_subset 16 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/LandCover/fcn_hr18_1024x1024_16k_landcover_semi.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | "../_base_/models/fcn_hr18.py", 3 | "../_base_/default_runtime.py", 4 | "../_base_/schedules/schedule_160k.py", 5 | "./mkd_semi_sup.py", 6 | ] 7 | model = dict(type="EncoderDecoderLandcover", decode_head=dict(num_classes=11)) 8 | runner = dict(type="IterBasedRunner", max_iters=22500) 9 | checkpoint_config = dict(by_epoch=False, interval=7500) 10 | evaluation = dict(interval=2250, metric="mIoU") 11 | optimizer_config = dict(type="Fp16OptimizerHook", loss_scale=512.0) 12 | fp16 = dict() 13 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/LandCover/fcn_hr18_1024x1024_16k_landcover.py: -------------------------------------------------------------------------------- 1 | _base_ = [ 2 | "../_base_/models/fcn_hr18.py", 3 | "../_base_/datasets/landcover.py", 4 | "../_base_/default_runtime.py", 5 | "../_base_/schedules/schedule_160k.py", 6 | ] 7 | model = dict(type="EncoderDecoderLandcover", decode_head=dict(num_classes=11)) 8 | runner = dict(type="IterBasedRunner", max_iters=22500) 9 | checkpoint_config = dict(by_epoch=False, interval=7500) 10 | evaluation = dict(interval=2250, metric="mIoU") 11 | optimizer_config = dict(type="Fp16OptimizerHook", loss_scale=512.0) 12 | fp16 = dict() 13 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/changedet/segmentors/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- conding: utf-8 -*- 2 | from .change_encoder_decoder import ChangeEncoderDecoder 3 | from .change_detector import ChangedetEncoderDecoder 4 | from .change_symmetry_detector import ChangedetSymmetryEncoderDecoder 5 | from .change_detector_shift import ChangedetEncoderDecoderShift 6 | from .cascade_change_detector import CascadeChangeDetector 7 | 8 | # from .change_detector_edge import ChangedetEdgeEncoderDecoder 9 | # from .change_detector_develop import ChangedetEncoderDecoderDevelop 10 | # from .change_detector_multi_class import MulticlassChangedetEncoderDecoder 11 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/trainer.py: -------------------------------------------------------------------------------- 1 | from abc import ABC, abstractmethod 2 | from aiearth.deeplearning.cloud.model import AIEModel 3 | 4 | 5 | class Trainer(ABC): 6 | @abstractmethod 7 | def train(self, validate): 8 | pass 9 | 10 | @abstractmethod 11 | def test(self): 12 | pass 13 | 14 | @abstractmethod 15 | def export_onnx(self, shape): 16 | pass 17 | 18 | @abstractmethod 19 | def to_cloud_model(self, onnx_shape) -> AIEModel: 20 | pass 21 | 22 | @abstractmethod 23 | def set_classes(self, classes_list): 24 | pass 25 | 26 | def semi(self): 27 | pass 28 | -------------------------------------------------------------------------------- /scripts/build_pkg.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | # set -x 3 | 4 | workdir=$(dirname $0)/../ 5 | 6 | cd $workdir 7 | version=$(grep '^VERSION' setup.py |awk -F "\"|'" '{print $(NF-1)}') 8 | short_commit_id=$(git rev-parse --short HEAD) 9 | commit_comment=$(git log -1 --pretty=%B) 10 | echo $commit_comment $short_commit_id 11 | 12 | sleep 1 13 | 14 | [ -d dist ] || mkdir dist 15 | tar zcf dist/aiearth-deeplearning-$version.tar.gz --exclude=aiearth/deeplearning/model_zoo/pretrained setup.py aiearth requirements.txt MANIFEST.in 16 | (cd dist && ln -sf aiearth-deeplearning-$version.tar.gz aiearth-deeplearning.tar.gz ) 17 | echo "package finished: dist/aiearth-deeplearning-$version.tar.gz" 18 | -------------------------------------------------------------------------------- /aiearth/deeplearning/cloud/model.py: -------------------------------------------------------------------------------- 1 | import abc 2 | 3 | 4 | class AIEModel: 5 | @abc.abstractmethod 6 | def get_model_type(self): 7 | pass 8 | 9 | @abc.abstractmethod 10 | def get_meam(self): 11 | pass 12 | 13 | @abc.abstractmethod 14 | def get_std(self): 15 | pass 16 | 17 | @abc.abstractmethod 18 | def get_classes(self): 19 | pass 20 | 21 | @abc.abstractmethod 22 | def get_model_name(self): 23 | pass 24 | 25 | @abc.abstractmethod 26 | def is_fp16(self): 27 | pass 28 | 29 | @abc.abstractmethod 30 | def get_onnx_shape(self): 31 | pass 32 | 33 | 34 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmdet/configs/_base_/default_runtime.py: -------------------------------------------------------------------------------- 1 | checkpoint_config = dict(interval=1) 2 | # yapf:disable 3 | log_config = dict( 4 | interval=1000, 5 | hooks=[ 6 | dict(type='TextLoggerHook'), 7 | # dict(type='TensorboardLoggerHook') 8 | ]) 9 | # yapf:enable 10 | custom_hooks = [dict(type='NumClassCheckHook')] 11 | 12 | dist_params = dict(backend='nccl') 13 | log_level = 'INFO' 14 | load_from = None 15 | resume_from = None 16 | workflow = [('train', 1)] 17 | 18 | # disable opencv multithreading to avoid system being overloaded 19 | opencv_num_threads = 0 20 | # set multi-process start method as `fork` to speed up the training 21 | mp_start_method = 'fork' 22 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/BuildingChange/README.md: -------------------------------------------------------------------------------- 1 | # 建筑物变化检测 2 | 3 | ## 任务描述 4 | 5 | 建筑物变化检测是一个遥感图像常见的任务,接收同源双图输入,给出图像中的变化区域,同时得到建筑物变化的类型,如新增建筑、建筑拆除、建筑改建等。 6 | 7 | ## 配置文件介绍及用法 8 | 9 | [配置文件](hrnet_w18_base_150k_new512_cosine_lr_batch_48_builingchange.py)可以用于从头训练一个建筑物变化检测模型。我们已经提供了一个训练好的默认模型:`aie://BuildingChange/buildingchange_hrnet_w18_base_150k_new512_cosine_lr_batch_48_builingchange.pth`。配置默认有三种变化类型,分别为新增建筑、建筑拆除、建筑改建。 10 | 如果你有更进一步的需求,比如继续在你自己的数据集上进行模型微调,可以把我们提供的模型配置到load_from参数;如果你想新增类目,可以把我们的模型加载为预训练模型(model.pretrained),并修改配置文件中的`num_classes`设置所需要的变化类别数量。需要注意的是,`无变化`需要占用一个输出类别。 11 | ```python 12 | model = dict( 13 | decode_head=dict( 14 | num_classes=4 15 | ) 16 | ) 17 | ``` 18 | -------------------------------------------------------------------------------- /docs/model/custom_model.md: -------------------------------------------------------------------------------- 1 | # 定制化算法开发 2 | 3 | 根据任务类型选择不同的训练引擎(train.engine)。我们会在SDK中集成了多种广受社区使用的框架比如MMSegmentation, MMDetection, Detectron2等。如果你有相关框架的开发经验,即可快速开始进行你的模型定制。 4 | 5 | 下面我们以分割类任务使用MMSeg为例,注册一个用户自定义模型: 6 | 7 | ```Python 8 | # use custom model 9 | from aiearth.deeplearning.models.changedet import ChangedetEncoderDecoder 10 | from aiearth.deeplearning.engine.mmseg.models.builder import SEGMENTORS 11 | 12 | @SEGMENTORS.register_module 13 | class MyChangedetEncoder(ChangedetEncoderDecoder): 14 | pass 15 | 16 | trainer.cfg.model.type = "MyChangedetEncoder" 17 | ``` 18 | 19 | 更多类型定制可以参考相关引擎的文档: 20 | [MMSeg](https://github.com/open-mmlab/mmsegmentation/blob/master/docs/zh_cn/tutorials/customize_models.md) 21 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/TargetExtraction/README.md: -------------------------------------------------------------------------------- 1 | # 地物识别 2 | 3 | ## 任务描述 4 | 用于水体提取,大棚提取等任务 5 | 6 | ## 配置文件介绍 7 | 我们提供了一整套模型配置和默认参数,能够有效训练出性能优秀的模型。 8 | 9 | ### 配置1 10 | [fcn_hr18_1024x1024_40k4_bceious1w1.0](fcn_hr18_1024x1024_40k4_bceious1w1.0.py) 11 | 使用该配置,可以训练出一个sota的hrnet18模型。我们已经提供的sota水体提取模型:`aie://TargetExtraction/water_fcn_hr18_1024x1024_40k4_bceious1w1.0_semi0108_it1_0108_it2_0103_iter_20000.pth`,就是基于该配置和相关数据训练而成。或者如果你有自己的需要,可以参考此配置文件完成一次从头训练。 12 | 13 | ### 配置2 14 | [fcn_hr18_1024x1024_40k4_bceious1w1.0_semi0108](fcn_hr18_1024x1024_40k4_bceious1w1.0_semi0108.py): 15 | 使用该配置可以引入额外的无标签数据对模型进行半监督训练,提升模型的表现能力。 16 | 使用方法:使用[配置1](fcn_hr18_1024x1024_40k4_bceious1w1.0.py)得到一个sota表现的模型以后,通过[推理](/quickstart.ipynb#Test)功能对数据打伪标签,然后使用该配置完成半监督训练。 17 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/LandCover/fcn_hr48_1024x1024_16k_landcover.py: -------------------------------------------------------------------------------- 1 | _base_ = "./fcn_hr18_1024x1024_16k_landcover.py" 2 | runner = dict(type="IterBasedRunner", max_iters=90000) 3 | checkpoint_config = dict(by_epoch=False, interval=30000) 4 | evaluation = dict(interval=5000, metric="mIoU") 5 | data = dict(samples_per_gpu=2, workers_per_gpu=2) 6 | model = dict( 7 | pretrained="open-mmlab://msra/hrnetv2_w48", 8 | backbone=dict( 9 | extra=dict( 10 | stage2=dict(num_channels=(48, 96)), 11 | stage3=dict(num_channels=(48, 96, 192)), 12 | stage4=dict(num_channels=(48, 96, 192, 384)), 13 | ) 14 | ), 15 | decode_head=dict( 16 | in_channels=[48, 96, 192, 384], channels=sum([48, 96, 192, 384]), num_classes=11 17 | ), 18 | ) 19 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/lraspp_m-v3-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', eps=0.001, requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | backbone=dict( 6 | type='MobileNetV3', 7 | arch='large', 8 | out_indices=(1, 3, 16), 9 | norm_cfg=norm_cfg), 10 | decode_head=dict( 11 | type='LRASPPHead', 12 | in_channels=(16, 24, 960), 13 | in_index=(0, 1, 2), 14 | channels=128, 15 | input_transform='multiple_select', 16 | dropout_ratio=0.1, 17 | num_classes=19, 18 | norm_cfg=norm_cfg, 19 | act_cfg=dict(type='ReLU'), 20 | align_corners=False, 21 | loss_decode=dict( 22 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 23 | # model training and testing settings 24 | train_cfg=dict(), 25 | test_cfg=dict(mode='whole')) 26 | -------------------------------------------------------------------------------- /aiearth/deeplearning/utils/flock.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import fcntl 4 | import time 5 | 6 | 7 | class Flock: 8 | def __init__(self, file_path): 9 | self.file_path = file_path 10 | self.fd = open(self.file_path, "w") 11 | 12 | def __del__(self): 13 | self.fd.close() 14 | 15 | def lock(self, no_blocking=False): 16 | if no_blocking: 17 | flag = fcntl.LOCK_EX | fcntl.LOCK_NB 18 | else: 19 | flag = fcntl.LOCK_EX 20 | fcntl.flock(self.fd, flag) 21 | 22 | def un_lock(self): 23 | fcntl.flock(self.fd, fcntl.LOCK_UN) 24 | 25 | 26 | 27 | 28 | 29 | if __name__ == "__main__": 30 | from multiprocessing import Process 31 | def worker(): 32 | f_path = "test.lock" 33 | flock = Flock(f_path) 34 | flock.lock() 35 | time.sleep(10) 36 | print("hahahah") 37 | flock.un_lock() 38 | Process(target=worker).start() 39 | Process(target=worker).start() -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/multispectral/configs/r50.yaml: -------------------------------------------------------------------------------- 1 | # env setting, default to single gpu training 2 | dist_url: "env://" 3 | world_size: -1 4 | rank: 0 5 | is_slurm_job: null 6 | distributed: null 7 | 8 | # # env setting, default to single gpu training 9 | # dist_url: 'tcp://localhost:10003' 10 | # world_size: -1 11 | # rank: 0 12 | # is_slurm_job: null 13 | # distributed: True 14 | 15 | # MISC 16 | data_dir: "" 17 | lmdb_dir: "/home/qianwen.qian/old_a100_pai/yuer.qian/data/Bigearthnet/uint8_lbdm" 18 | checkpoints_dir: "/home/qianwen.qian/mnt_pai/yuer.qian/model_zoo/clsssifiation/BE_rn50_50" 19 | resume: "" 20 | save_path: "" 21 | pretrained: "/home/qianwen.qian/mnt_pai/yuer.qian/pretrain_model/resnet/B13_rn50_moco_0099_ckpt.pth" 22 | print_freq: 10 23 | save_frep: 100 24 | lmdb: true 25 | batch_size: 256 26 | 27 | # training setting 28 | bands: all # choices=["all", "RGB"] 29 | train_frac: 0.1 30 | backbone: resnet50 31 | batchsize: 256 32 | epochs: 100 33 | num_workers: 8 34 | # lr: 0.05 35 | lr: 8.0 36 | schedule: 37 | - 60 38 | - 80 39 | cos: False 40 | seed: 24 41 | normalize: false 42 | linear: true 43 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/multispectral/configs/r50_0.1_linear.yaml: -------------------------------------------------------------------------------- 1 | # env setting, default to single gpu training 2 | dist_url: "env://" 3 | world_size: -1 4 | rank: 0 5 | is_slurm_job: null 6 | distributed: null 7 | 8 | # # env setting, default to single gpu training 9 | # dist_url: 'tcp://localhost:10003' 10 | # world_size: -1 11 | # rank: 0 12 | # is_slurm_job: null 13 | # distributed: True 14 | 15 | # MISC 16 | data_dir: "" 17 | lmdb_dir: "/home/qianwen.qian/old_a100_pai/yuer.qian/data/Bigearthnet/uint8_lbdm" 18 | checkpoints_dir: "/home/qianwen.qian/mnt_pai/yuer.qian/model_zoo/clsssifiation/BE_rn50_50" 19 | resume: "" 20 | save_path: "" 21 | pretrained: "/home/qianwen.qian/mnt_pai/yuer.qian/pretrain_model/resnet/B13_rn50_moco_0099_ckpt.pth" 22 | print_freq: 10 23 | save_frep: 100 24 | lmdb: true 25 | batch_size: 256 26 | 27 | # training setting 28 | bands: all # choices=["all", "RGB"] 29 | train_frac: 0.1 30 | backbone: resnet50 31 | batchsize: 256 32 | epochs: 100 33 | num_workers: 8 34 | # lr: 0.05 35 | lr: 8.0 36 | schedule: 37 | - 60 38 | - 80 39 | cos: False 40 | seed: 24 41 | normalize: false 42 | linear: true 43 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/multispectral/configs/r50_1.0_finetune.yaml: -------------------------------------------------------------------------------- 1 | # env setting, default to single gpu training 2 | dist_url: "env://" 3 | world_size: -1 4 | rank: 0 5 | is_slurm_job: null 6 | distributed: null 7 | 8 | # # env setting, default to single gpu training 9 | # dist_url: 'tcp://localhost:10003' 10 | # world_size: -1 11 | # rank: 0 12 | # is_slurm_job: null 13 | # distributed: True 14 | 15 | # MISC 16 | data_dir: "" 17 | lmdb_dir: "/home/qianwen.qian/old_a100_pai/yuer.qian/data/Bigearthnet/uint8_lbdm" 18 | checkpoints_dir: "/home/qianwen.qian/mnt_pai/yuer.qian/model_zoo/clsssifiation/BE_rn50_100_fintune" 19 | resume: "" 20 | save_path: "" 21 | pretrained: "/home/qianwen.qian/mnt_pai/yuer.qian/pretrain_model/resnet/B13_rn50_moco_0099_ckpt.pth" 22 | print_freq: 10 23 | save_frep: 100 24 | lmdb: true 25 | batch_size: 64 26 | 27 | # training setting 28 | bands: all # choices=["all", "RGB"] 29 | train_frac: 1.0 30 | backbone: resnet50 31 | batchsize: 256 32 | epochs: 100 33 | num_workers: 8 34 | lr: 0.05 35 | # lr: 8.0 36 | schedule: 37 | - 60 38 | - 80 39 | cos: False 40 | seed: 24 41 | normalize: false 42 | linear: False 43 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/dpt_vit-b16.py: -------------------------------------------------------------------------------- 1 | norm_cfg = dict(type='SyncBN', requires_grad=True) 2 | model = dict( 3 | type='EncoderDecoder', 4 | pretrained='pretrain/vit-b16_p16_224-80ecf9dd.pth', # noqa 5 | backbone=dict( 6 | type='VisionTransformer', 7 | img_size=224, 8 | embed_dims=768, 9 | num_layers=12, 10 | num_heads=12, 11 | out_indices=(2, 5, 8, 11), 12 | final_norm=False, 13 | with_cls_token=True, 14 | output_cls_token=True), 15 | decode_head=dict( 16 | type='DPTHead', 17 | in_channels=(768, 768, 768, 768), 18 | channels=256, 19 | embed_dims=768, 20 | post_process_channels=[96, 192, 384, 768], 21 | num_classes=150, 22 | readout_type='project', 23 | input_transform='multiple_select', 24 | in_index=(0, 1, 2, 3), 25 | norm_cfg=norm_cfg, 26 | loss_decode=dict( 27 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 28 | auxiliary_head=None, 29 | # model training and testing settings 30 | train_cfg=dict(), 31 | test_cfg=dict(mode='whole')) # yapf: disable 32 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/erfnet_fcn.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained=None, 6 | backbone=dict( 7 | type='ERFNet', 8 | in_channels=3, 9 | enc_downsample_channels=(16, 64, 128), 10 | enc_stage_non_bottlenecks=(5, 8), 11 | enc_non_bottleneck_dilations=(2, 4, 8, 16), 12 | enc_non_bottleneck_channels=(64, 128), 13 | dec_upsample_channels=(64, 16), 14 | dec_stages_non_bottleneck=(2, 2), 15 | dec_non_bottleneck_channels=(64, 16), 16 | dropout_ratio=0.1, 17 | init_cfg=None), 18 | decode_head=dict( 19 | type='FCNHead', 20 | in_channels=16, 21 | channels=128, 22 | num_convs=1, 23 | concat_input=False, 24 | dropout_ratio=0.1, 25 | num_classes=19, 26 | norm_cfg=norm_cfg, 27 | align_corners=False, 28 | loss_decode=dict( 29 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 30 | # model training and testing settings 31 | train_cfg=dict(), 32 | test_cfg=dict(mode='whole')) 33 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/segformer_mit-b0.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained=None, 6 | backbone=dict( 7 | type='MixVisionTransformer', 8 | in_channels=3, 9 | embed_dims=32, 10 | num_stages=4, 11 | num_layers=[2, 2, 2, 2], 12 | num_heads=[1, 2, 5, 8], 13 | patch_sizes=[7, 3, 3, 3], 14 | sr_ratios=[8, 4, 2, 1], 15 | out_indices=(0, 1, 2, 3), 16 | mlp_ratio=4, 17 | qkv_bias=True, 18 | drop_rate=0.0, 19 | attn_drop_rate=0.0, 20 | drop_path_rate=0.1), 21 | decode_head=dict( 22 | type='SegformerHead', 23 | in_channels=[32, 64, 160, 256], 24 | in_index=[0, 1, 2, 3], 25 | channels=256, 26 | dropout_ratio=0.1, 27 | num_classes=19, 28 | norm_cfg=norm_cfg, 29 | align_corners=False, 30 | loss_decode=dict( 31 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 32 | # model training and testing settings 33 | train_cfg=dict(), 34 | test_cfg=dict(mode='whole')) 35 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/multispectral/configs/vit_small_0.1_linear.yaml: -------------------------------------------------------------------------------- 1 | # env setting, default to single gpu training 2 | dist_url: "env://" 3 | world_size: -1 4 | rank: 0 5 | is_slurm_job: null 6 | distributed: null 7 | 8 | # # env setting, default to single gpu training 9 | # dist_url: 'tcp://localhost:10003' 10 | # world_size: -1 11 | # rank: 0 12 | # is_slurm_job: null 13 | # distributed: True 14 | 15 | # MISC 16 | data_dir: "" 17 | lmdb_dir: "/home/qianwen.qian/old_a100_pai/yuer.qian/data/Bigearthnet/uint8_lbdm" 18 | checkpoints_dir: "/home/qianwen.qian/mnt_pai/yuer.qian/model_zoo/clsssifiation/BE_vit_small_10_linear_fintune" 19 | resume: "" 20 | save_path: "" 21 | pretrained: "/home/qianwen.qian/mnt_pai/yuer.qian/model_zoo/resnet_remote/EX_vit_s12_B13_mp_a100_001/checkpoint_0099.pth.tar" 22 | print_freq: 10 23 | save_frep: 100 24 | lmdb: true 25 | batch_size: 64 26 | 27 | # training setting 28 | bands: all # choices=["all", "RGB"] 29 | train_frac: 0.1 30 | backbone: vit_small 31 | batchsize: 256 32 | epochs: 100 33 | num_workers: 8 34 | lr: 0.01 35 | momentum: 0.9 36 | weight_decay: 0 37 | # lr: 8.0 38 | schedule: 39 | - 60 40 | - 80 41 | cos: True 42 | seed: 24 43 | normalize: false 44 | linear: True -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/multispectral/configs/vit_small_1.0_finetune.yaml: -------------------------------------------------------------------------------- 1 | # env setting, default to single gpu training 2 | dist_url: "env://" 3 | world_size: -1 4 | rank: 0 5 | is_slurm_job: null 6 | distributed: null 7 | 8 | # # env setting, default to single gpu training 9 | # dist_url: 'tcp://localhost:10003' 10 | # world_size: -1 11 | # rank: 0 12 | # is_slurm_job: null 13 | # distributed: True 14 | 15 | # MISC 16 | data_dir: "" 17 | lmdb_dir: "/home/qianwen.qian/old_a100_pai/yuer.qian/data/Bigearthnet/uint8_lbdm" 18 | checkpoints_dir: "/home/qianwen.qian/mnt_pai/yuer.qian/model_zoo/clsssifiation/BE_vit_small_10_linear_fintune" 19 | resume: "" 20 | save_path: "" 21 | pretrained: "/home/qianwen.qian/mnt_pai/yuer.qian/model_zoo/resnet_remote/EX_vit_s12_B13_mp_a100_001/checkpoint_0099.pth.tar" 22 | print_freq: 10 23 | save_frep: 100 24 | lmdb: true 25 | batch_size: 64 26 | 27 | # training setting 28 | bands: all # choices=["all", "RGB"] 29 | train_frac: 0.1 30 | backbone: vit_small 31 | batchsize: 256 32 | epochs: 100 33 | num_workers: 8 34 | lr: 0.01 35 | momentum: 0.9 36 | weight_decay: 0 37 | # lr: 8.0 38 | schedule: 39 | - 60 40 | - 80 41 | cos: True 42 | seed: 24 43 | normalize: false 44 | linear: True -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/fpn_r50.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 1, 1), 12 | strides=(1, 2, 2, 2), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | neck=dict( 18 | type='FPN', 19 | in_channels=[256, 512, 1024, 2048], 20 | out_channels=256, 21 | num_outs=4), 22 | decode_head=dict( 23 | type='FPNHead', 24 | in_channels=[256, 256, 256, 256], 25 | in_index=[0, 1, 2, 3], 26 | feature_strides=[4, 8, 16, 32], 27 | channels=128, 28 | dropout_ratio=0.1, 29 | num_classes=19, 30 | norm_cfg=norm_cfg, 31 | align_corners=False, 32 | loss_decode=dict( 33 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 34 | # model training and testing settings 35 | train_cfg=dict(), 36 | test_cfg=dict(mode='whole')) 37 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/multispectral/configs/swin_tiny_0.1_linear.yaml: -------------------------------------------------------------------------------- 1 | # env setting, default to single gpu training 2 | dist_url: "env://" 3 | world_size: -1 4 | rank: 0 5 | is_slurm_job: null 6 | distributed: null 7 | 8 | # # env setting, default to single gpu training 9 | # dist_url: 'tcp://localhost:10003' 10 | # world_size: -1 11 | # rank: 0 12 | # is_slurm_job: null 13 | # distributed: True 14 | 15 | # MISC 16 | data_dir: "" 17 | lmdb_dir: "/home/qianwen.qian/old_a100_pai/yuer.qian/data/Bigearthnet/uint8_lbdm" 18 | checkpoints_dir: "/home/qianwen.qian/mnt_pai/yuer.qian/model_zoo/clsssifiation/BE_swin_tiny_10_linear_fintune" 19 | resume: "" 20 | save_path: "" 21 | pretrained: "/home/qianwen.qian/mnt_pai/yuer.qian/code/SSL4EO-S12/src/benchmark/pretrain_ssl/output/simmim_pretrain/simmim_pretrain_swin_tiny_img224_window7_100ep_b256_ms/ckpt_epoch_99.pth" 22 | print_freq: 10 23 | save_frep: 100 24 | lmdb: true 25 | batch_size: 64 26 | 27 | # training setting 28 | bands: all # choices=["all", "RGB"] 29 | train_frac: 0.1 30 | backbone: swin_tiny 31 | batchsize: 256 32 | epochs: 100 33 | num_workers: 8 34 | lr: 0.01 35 | momentum: 0.9 36 | weight_decay: 0 37 | # lr: 8.0 38 | schedule: 39 | - 60 40 | - 80 41 | cos: True 42 | seed: 24 43 | normalize: false 44 | linear: True -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/multispectral/configs/swin_tiny_1.0_finetune.yaml: -------------------------------------------------------------------------------- 1 | # env setting, default to single gpu training 2 | dist_url: "env://" 3 | world_size: -1 4 | rank: 0 5 | is_slurm_job: null 6 | distributed: null 7 | 8 | # # env setting, default to single gpu training 9 | # dist_url: 'tcp://localhost:10003' 10 | # world_size: -1 11 | # rank: 0 12 | # is_slurm_job: null 13 | # distributed: True 14 | 15 | # MISC 16 | data_dir: "" 17 | lmdb_dir: "/home/qianwen.qian/old_a100_pai/yuer.qian/data/Bigearthnet/uint8_lbdm" 18 | checkpoints_dir: "/home/qianwen.qian/mnt_pai/yuer.qian/model_zoo/clsssifiation/BE_swin_tiny_10_linear_fintune" 19 | resume: "" 20 | save_path: "" 21 | pretrained: "/home/qianwen.qian/mnt_pai/yuer.qian/code/SSL4EO-S12/src/benchmark/pretrain_ssl/output/simmim_pretrain/simmim_pretrain_swin_tiny_img224_window7_100ep_b256_ms/ckpt_epoch_99.pth" 22 | print_freq: 10 23 | save_frep: 100 24 | lmdb: true 25 | batch_size: 64 26 | 27 | # training setting 28 | bands: all # choices=["all", "RGB"] 29 | train_frac: 1.0 30 | backbone: swin_tiny 31 | batchsize: 256 32 | epochs: 100 33 | num_workers: 8 34 | lr: 0.01 35 | momentum: 0.9 36 | weight_decay: 0 37 | # lr: 8.0 38 | schedule: 39 | - 60 40 | - 80 41 | cos: True 42 | seed: 24 43 | normalize: false 44 | linear: False -------------------------------------------------------------------------------- /aiearth/deeplearning/models/landcover/losses/semi.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | # -*- conding: utf-8 -*- 3 | import torch 4 | import torch.nn as nn 5 | 6 | from ..builder import DISTILLERSLOSSES 7 | from mmseg.models.losses.cross_entropy_loss import ( 8 | CrossEntropyLoss, 9 | ) 10 | 11 | 12 | @DISTILLERSLOSSES.register_module() 13 | class SemiLossCPS(nn.Module): 14 | def __init__(self, loss_weight=1.0, avg_non_ignore=True, ignore_index=255): 15 | super(SemiLossCPS, self).__init__() 16 | self.loss_weight = loss_weight 17 | self.ignore_index = ignore_index 18 | self.criterion = CrossEntropyLoss( 19 | loss_weight=loss_weight, avg_non_ignore=avg_non_ignore 20 | ) 21 | 22 | def forward(self, strong_logits, weak_logits): 23 | max_probs, targets_u = torch.max(weak_logits, dim=1) 24 | loss1 = self.criterion( 25 | strong_logits.float(), targets_u.long(), ignore_index=self.ignore_index 26 | ) 27 | 28 | max_probs2, targets_u2 = torch.max(strong_logits, dim=1) 29 | loss2 = self.criterion( 30 | weak_logits.float(), targets_u2.long(), ignore_index=self.ignore_index 31 | ) 32 | 33 | loss = loss1 + loss2 34 | return loss 35 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/cgnet.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', eps=1e-03, requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | backbone=dict( 6 | type='CGNet', 7 | norm_cfg=norm_cfg, 8 | in_channels=3, 9 | num_channels=(32, 64, 128), 10 | num_blocks=(3, 21), 11 | dilations=(2, 4), 12 | reductions=(8, 16)), 13 | decode_head=dict( 14 | type='FCNHead', 15 | in_channels=256, 16 | in_index=2, 17 | channels=256, 18 | num_convs=0, 19 | concat_input=False, 20 | dropout_ratio=0, 21 | num_classes=19, 22 | norm_cfg=norm_cfg, 23 | loss_decode=dict( 24 | type='CrossEntropyLoss', 25 | use_sigmoid=False, 26 | loss_weight=1.0, 27 | class_weight=[ 28 | 2.5959933, 6.7415504, 3.5354059, 9.8663225, 9.690899, 9.369352, 29 | 10.289121, 9.953208, 4.3097677, 9.490387, 7.674431, 9.396905, 30 | 10.347791, 6.3927646, 10.226669, 10.241062, 10.280587, 31 | 10.396974, 10.055647 32 | ])), 33 | # model training and testing settings 34 | train_cfg=dict(sampler=None), 35 | test_cfg=dict(mode='whole')) 36 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/ChangeDet/README.md: -------------------------------------------------------------------------------- 1 | # 变化检测 2 | 3 | ## 任务描述 4 | 5 | 变化检测是一个遥感图像常见的任务,需要同源双图输入,给出图像中的内容变化,例如通用变化检测、建筑物变化检测、水体变化检测、耕地变化检测等。 6 | 7 | ## 配置文件介绍及用法 8 | 9 | 我们提供了一整套模型配置和默认参数,能够有效训练出性能优秀的模型。你可以利用自建的变化检测数据集,在该框架下训练所需的变化检测任务模型。 10 | ### 配置1 11 | [effi-b0_base_50k_new256_cosine_lr_batch_128_adamw](effi-b0_base_50k_new256_cosine_lr_batch_128_adamw.py): 12 | 使用该配置,可以训练出一个backbone为efficient-b0的轻量变化检测模型,该模型兼顾性能和效果。如果你有自己的需要,可以参考此配置文件完成一次从头训练。 13 | 14 | ### 配置2 15 | [hrnet_w18_base_150k_new512_cosine_lr_batch_48_v25](hrnet_w18_base_150k_new512_cosine_lr_batch_48_v25.py): 16 | 使用该配置,可以训练出一个sota的hrnet18模型。我们已经提供的sota[模型](xxx.pth)就是基于该配置和相关数据训练而成。或者如果你有自己的需要,可以参考此配置文件完成一次从头训练。 17 | 18 | ### 配置3 19 | [hrnet_w18_base_150k_new512_cosine_lr_batch_48_v25_finetune](hrnet_w18_base_150k_new512_cosine_lr_batch_48_v25_finetune.py): 20 | 我们也提供了一套用于微调的配置。使用该配置,配合前序模型,你可以用在自己的数据上进行模型微调,以取得在你的数据上更具表现力的效果。 21 | 22 | ### 配置4 23 | [hrnet_w18_base_150k_new512_cosine_lr_batch_48_v25_semi](hrnet_w18_base_150k_new512_cosine_lr_batch_48_v25_semi.py): 24 | 使用该配置可以引入额外的无标签数据对模型进行半监督训练,提升模型的表现能力。 25 | 使用方法: 26 | #### 步骤 1 27 | 使用[配置2](hrnet_w18_base_150k_new512_cosine_lr_batch_48_v25.py)或者[配置3](hrnet_w18_base_150k_new512_cosine_lr_batch_48_v25_finetune.py)得到一个sota表现的模型以后,通过[推理](/quickstart.ipynb#Test)功能保存无标签数据的伪标签。 28 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/segmenter_vit-b16_mask.py: -------------------------------------------------------------------------------- 1 | checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/segmenter/vit_base_p16_384_20220308-96dfe169.pth' # noqa 2 | # model settings 3 | backbone_norm_cfg = dict(type='LN', eps=1e-6, requires_grad=True) 4 | model = dict( 5 | type='EncoderDecoder', 6 | pretrained=checkpoint, 7 | backbone=dict( 8 | type='VisionTransformer', 9 | img_size=(512, 512), 10 | patch_size=16, 11 | in_channels=3, 12 | embed_dims=768, 13 | num_layers=12, 14 | num_heads=12, 15 | drop_path_rate=0.1, 16 | attn_drop_rate=0.0, 17 | drop_rate=0.0, 18 | final_norm=True, 19 | norm_cfg=backbone_norm_cfg, 20 | with_cls_token=True, 21 | interpolate_mode='bicubic', 22 | ), 23 | decode_head=dict( 24 | type='SegmenterMaskTransformerHead', 25 | in_channels=768, 26 | channels=768, 27 | num_classes=150, 28 | num_layers=2, 29 | num_heads=12, 30 | embed_dims=768, 31 | dropout_ratio=0.0, 32 | loss_decode=dict( 33 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), 34 | ), 35 | test_cfg=dict(mode='slide', crop_size=(512, 512), stride=(480, 480)), 36 | ) 37 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/landcover/builder.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | # -*- conding: utf-8 -*- 3 | from mmcv.cnn import MODELS as MMCV_MODELS 4 | from mmcv.utils import Registry 5 | 6 | MODELS = Registry("models") 7 | 8 | # from mmseg.models.builder import MODELS 9 | 10 | ALGORITHMS = MODELS 11 | MUTABLES = MODELS 12 | DISTILLERS = MODELS 13 | DISTILLERSLOSSES = MODELS 14 | OPS = MODELS 15 | PRUNERS = MODELS 16 | QUANTIZERS = MODELS 17 | ARCHITECTURES = MODELS 18 | MUTATORS = MODELS 19 | 20 | 21 | def build_algorithm(cfg): 22 | """Build compressor.""" 23 | return ALGORITHMS.build(cfg) 24 | 25 | 26 | def build_architecture(cfg): 27 | """Build architecture.""" 28 | return ARCHITECTURES.build(cfg) 29 | 30 | 31 | def build_mutator(cfg): 32 | """Build mutator.""" 33 | return MUTATORS.build(cfg) 34 | 35 | 36 | def build_distiller(cfg): 37 | """Build distiller.""" 38 | return DISTILLERS.build(cfg) 39 | 40 | 41 | def build_pruner(cfg): 42 | """Build pruner.""" 43 | return PRUNERS.build(cfg) 44 | 45 | 46 | def build_mutable(cfg): 47 | """Build mutable.""" 48 | return MUTABLES.build(cfg) 49 | 50 | 51 | def build_op(cfg): 52 | """Build op.""" 53 | return OPS.build(cfg) 54 | 55 | 56 | def build_loss(cfg): 57 | """Build loss.""" 58 | return DISTILLERSLOSSES.build(cfg) 59 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/ccnet_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='CCHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=512, 22 | recurrence=2, 23 | dropout_ratio=0.1, 24 | num_classes=19, 25 | norm_cfg=norm_cfg, 26 | align_corners=False, 27 | loss_decode=dict( 28 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 29 | auxiliary_head=dict( 30 | type='FCNHead', 31 | in_channels=1024, 32 | in_index=2, 33 | channels=256, 34 | num_convs=1, 35 | concat_input=False, 36 | dropout_ratio=0.1, 37 | num_classes=19, 38 | norm_cfg=norm_cfg, 39 | align_corners=False, 40 | loss_decode=dict( 41 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 42 | # model training and testing settings 43 | train_cfg=dict(), 44 | test_cfg=dict(mode='whole')) 45 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/danet_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='DAHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=512, 22 | pam_channels=64, 23 | dropout_ratio=0.1, 24 | num_classes=19, 25 | norm_cfg=norm_cfg, 26 | align_corners=False, 27 | loss_decode=dict( 28 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 29 | auxiliary_head=dict( 30 | type='FCNHead', 31 | in_channels=1024, 32 | in_index=2, 33 | channels=256, 34 | num_convs=1, 35 | concat_input=False, 36 | dropout_ratio=0.1, 37 | num_classes=19, 38 | norm_cfg=norm_cfg, 39 | align_corners=False, 40 | loss_decode=dict( 41 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 42 | # model training and testing settings 43 | train_cfg=dict(), 44 | test_cfg=dict(mode='whole')) 45 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/pspnet_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='PSPHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=512, 22 | pool_scales=(1, 2, 3, 6), 23 | dropout_ratio=0.1, 24 | num_classes=19, 25 | norm_cfg=norm_cfg, 26 | align_corners=False, 27 | loss_decode=dict( 28 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 29 | auxiliary_head=dict( 30 | type='FCNHead', 31 | in_channels=1024, 32 | in_index=2, 33 | channels=256, 34 | num_convs=1, 35 | concat_input=False, 36 | dropout_ratio=0.1, 37 | num_classes=19, 38 | norm_cfg=norm_cfg, 39 | align_corners=False, 40 | loss_decode=dict( 41 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 42 | # model training and testing settings 43 | train_cfg=dict(), 44 | test_cfg=dict(mode='whole')) 45 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/deeplabv3_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='ASPPHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=512, 22 | dilations=(1, 12, 24, 36), 23 | dropout_ratio=0.1, 24 | num_classes=19, 25 | norm_cfg=norm_cfg, 26 | align_corners=False, 27 | loss_decode=dict( 28 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 29 | auxiliary_head=dict( 30 | type='FCNHead', 31 | in_channels=1024, 32 | in_index=2, 33 | channels=256, 34 | num_convs=1, 35 | concat_input=False, 36 | dropout_ratio=0.1, 37 | num_classes=19, 38 | norm_cfg=norm_cfg, 39 | align_corners=False, 40 | loss_decode=dict( 41 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 42 | # model training and testing settings 43 | train_cfg=dict(), 44 | test_cfg=dict(mode='whole')) 45 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/fcn_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='FCNHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=512, 22 | num_convs=2, 23 | concat_input=True, 24 | dropout_ratio=0.1, 25 | num_classes=19, 26 | norm_cfg=norm_cfg, 27 | align_corners=False, 28 | loss_decode=dict( 29 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 30 | auxiliary_head=dict( 31 | type='FCNHead', 32 | in_channels=1024, 33 | in_index=2, 34 | channels=256, 35 | num_convs=1, 36 | concat_input=False, 37 | dropout_ratio=0.1, 38 | num_classes=19, 39 | norm_cfg=norm_cfg, 40 | align_corners=False, 41 | loss_decode=dict( 42 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 43 | # model training and testing settings 44 | train_cfg=dict(), 45 | test_cfg=dict(mode='whole')) 46 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/isanet_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='ISAHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=512, 22 | isa_channels=256, 23 | down_factor=(8, 8), 24 | dropout_ratio=0.1, 25 | num_classes=19, 26 | norm_cfg=norm_cfg, 27 | align_corners=False, 28 | loss_decode=dict( 29 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 30 | auxiliary_head=dict( 31 | type='FCNHead', 32 | in_channels=1024, 33 | in_index=2, 34 | channels=256, 35 | num_convs=1, 36 | concat_input=False, 37 | dropout_ratio=0.1, 38 | num_classes=19, 39 | norm_cfg=norm_cfg, 40 | align_corners=False, 41 | loss_decode=dict( 42 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 43 | # model training and testing settings 44 | train_cfg=dict(), 45 | test_cfg=dict(mode='whole')) 46 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/upernet_r50.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 1, 1), 12 | strides=(1, 2, 2, 2), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='UPerHead', 19 | in_channels=[256, 512, 1024, 2048], 20 | in_index=[0, 1, 2, 3], 21 | pool_scales=(1, 2, 3, 6), 22 | channels=512, 23 | dropout_ratio=0.1, 24 | num_classes=19, 25 | norm_cfg=norm_cfg, 26 | align_corners=False, 27 | loss_decode=dict( 28 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 29 | auxiliary_head=dict( 30 | type='FCNHead', 31 | in_channels=1024, 32 | in_index=2, 33 | channels=256, 34 | num_convs=1, 35 | concat_input=False, 36 | dropout_ratio=0.1, 37 | num_classes=19, 38 | norm_cfg=norm_cfg, 39 | align_corners=False, 40 | loss_decode=dict( 41 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 42 | # model training and testing settings 43 | train_cfg=dict(), 44 | test_cfg=dict(mode='whole')) 45 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/apcnet_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='APCHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=512, 22 | pool_scales=(1, 2, 3, 6), 23 | dropout_ratio=0.1, 24 | num_classes=19, 25 | norm_cfg=dict(type='SyncBN', requires_grad=True), 26 | align_corners=False, 27 | loss_decode=dict( 28 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 29 | auxiliary_head=dict( 30 | type='FCNHead', 31 | in_channels=1024, 32 | in_index=2, 33 | channels=256, 34 | num_convs=1, 35 | concat_input=False, 36 | dropout_ratio=0.1, 37 | num_classes=19, 38 | norm_cfg=norm_cfg, 39 | align_corners=False, 40 | loss_decode=dict( 41 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 42 | # model training and testing settings 43 | train_cfg=dict(), 44 | test_cfg=dict(mode='whole')) 45 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/dmnet_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='DMHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=512, 22 | filter_sizes=(1, 3, 5, 7), 23 | dropout_ratio=0.1, 24 | num_classes=19, 25 | norm_cfg=dict(type='SyncBN', requires_grad=True), 26 | align_corners=False, 27 | loss_decode=dict( 28 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 29 | auxiliary_head=dict( 30 | type='FCNHead', 31 | in_channels=1024, 32 | in_index=2, 33 | channels=256, 34 | num_convs=1, 35 | concat_input=False, 36 | dropout_ratio=0.1, 37 | num_classes=19, 38 | norm_cfg=norm_cfg, 39 | align_corners=False, 40 | loss_decode=dict( 41 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 42 | # model training and testing settings 43 | train_cfg=dict(), 44 | test_cfg=dict(mode='whole')) 45 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/dnl_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='DNLHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=512, 22 | dropout_ratio=0.1, 23 | reduction=2, 24 | use_scale=True, 25 | mode='embedded_gaussian', 26 | num_classes=19, 27 | norm_cfg=norm_cfg, 28 | align_corners=False, 29 | loss_decode=dict( 30 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 31 | auxiliary_head=dict( 32 | type='FCNHead', 33 | in_channels=1024, 34 | in_index=2, 35 | channels=256, 36 | num_convs=1, 37 | concat_input=False, 38 | dropout_ratio=0.1, 39 | num_classes=19, 40 | norm_cfg=norm_cfg, 41 | align_corners=False, 42 | loss_decode=dict( 43 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 44 | # model training and testing settings 45 | train_cfg=dict(), 46 | test_cfg=dict(mode='whole')) 47 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/nonlocal_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='NLHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=512, 22 | dropout_ratio=0.1, 23 | reduction=2, 24 | use_scale=True, 25 | mode='embedded_gaussian', 26 | num_classes=19, 27 | norm_cfg=norm_cfg, 28 | align_corners=False, 29 | loss_decode=dict( 30 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 31 | auxiliary_head=dict( 32 | type='FCNHead', 33 | in_channels=1024, 34 | in_index=2, 35 | channels=256, 36 | num_convs=1, 37 | concat_input=False, 38 | dropout_ratio=0.1, 39 | num_classes=19, 40 | norm_cfg=norm_cfg, 41 | align_corners=False, 42 | loss_decode=dict( 43 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 44 | # model training and testing settings 45 | train_cfg=dict(), 46 | test_cfg=dict(mode='whole')) 47 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/gcnet_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='GCHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=512, 22 | ratio=1 / 4., 23 | pooling_type='att', 24 | fusion_types=('channel_add', ), 25 | dropout_ratio=0.1, 26 | num_classes=19, 27 | norm_cfg=norm_cfg, 28 | align_corners=False, 29 | loss_decode=dict( 30 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 31 | auxiliary_head=dict( 32 | type='FCNHead', 33 | in_channels=1024, 34 | in_index=2, 35 | channels=256, 36 | num_convs=1, 37 | concat_input=False, 38 | dropout_ratio=0.1, 39 | num_classes=19, 40 | norm_cfg=norm_cfg, 41 | align_corners=False, 42 | loss_decode=dict( 43 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 44 | # model training and testing settings 45 | train_cfg=dict(), 46 | test_cfg=dict(mode='whole')) 47 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/emanet_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='EMAHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=256, 22 | ema_channels=512, 23 | num_bases=64, 24 | num_stages=3, 25 | momentum=0.1, 26 | dropout_ratio=0.1, 27 | num_classes=19, 28 | norm_cfg=norm_cfg, 29 | align_corners=False, 30 | loss_decode=dict( 31 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 32 | auxiliary_head=dict( 33 | type='FCNHead', 34 | in_channels=1024, 35 | in_index=2, 36 | channels=256, 37 | num_convs=1, 38 | concat_input=False, 39 | dropout_ratio=0.1, 40 | num_classes=19, 41 | norm_cfg=norm_cfg, 42 | align_corners=False, 43 | loss_decode=dict( 44 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 45 | # model training and testing settings 46 | train_cfg=dict(), 47 | test_cfg=dict(mode='whole')) 48 | -------------------------------------------------------------------------------- /sample/changedet_with_custom_dataset/sample_changedet_with_custom_dataset.py: -------------------------------------------------------------------------------- 1 | import os 2 | import aie 3 | 4 | from aiearth.deeplearning.trainer.mmseg.changedet_trainer import ChangeDetTrainer 5 | from aiearth.deeplearning.sampler import RandomNonGeoDatasetSampler 6 | from aiearth.deeplearning.job.train_job import TrainJob 7 | from aiearth.deeplearning.datasets import ChangeDetNonGeoCustomDataset 8 | 9 | class Job(TrainJob): 10 | work_dir = "./work_dir" 11 | classes = ['background', 'change'] 12 | 13 | def set_trainer(self): 14 | trainer = ChangeDetTrainer(work_dir=self.work_dir) 15 | trainer.cfg.runner["max_iters"] = 200 #dict(type='IterBasedRunner', max_iters=20000) 16 | trainer.cfg.checkpoint_config["interval"]=50 17 | trainer.cfg.data.samples_per_gpu = 1 18 | return trainer 19 | 20 | def set_datasets(self): 21 | myDataSet = ChangeDetNonGeoCustomDataset( 22 | self.classes, 23 | (512, 512, 3), 24 | (512, 512, 1), 25 | img_dir="datasets/images1", 26 | img2_dir="datasets/images2", 27 | img_suffix=".jpg", 28 | ann_dir="datasets/annotations", 29 | ann_suffix=".png", 30 | ) 31 | # 随机按照80%, 20%进行切分成两个新样本集 32 | train_dataset, val_dataset = RandomNonGeoDatasetSampler.split_by_percent(myDataSet, 0.8) 33 | self.datasets["train"].append(train_dataset) 34 | self.datasets["val"].append(val_dataset) 35 | 36 | 37 | 38 | if __name__ == '__main__': 39 | job = Job() 40 | job.train() 41 | 42 | 43 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/ann_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='ANNHead', 19 | in_channels=[1024, 2048], 20 | in_index=[2, 3], 21 | channels=512, 22 | project_channels=256, 23 | query_scales=(1, ), 24 | key_pool_scales=(1, 3, 6, 8), 25 | dropout_ratio=0.1, 26 | num_classes=19, 27 | norm_cfg=norm_cfg, 28 | align_corners=False, 29 | loss_decode=dict( 30 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 31 | auxiliary_head=dict( 32 | type='FCNHead', 33 | in_channels=1024, 34 | in_index=2, 35 | channels=256, 36 | num_convs=1, 37 | concat_input=False, 38 | dropout_ratio=0.1, 39 | num_classes=19, 40 | norm_cfg=norm_cfg, 41 | align_corners=False, 42 | loss_decode=dict( 43 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 44 | # model training and testing settings 45 | train_cfg=dict(), 46 | test_cfg=dict(mode='whole')) 47 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/deeplabv3plus_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='DepthwiseSeparableASPPHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=512, 22 | dilations=(1, 12, 24, 36), 23 | c1_in_channels=256, 24 | c1_channels=48, 25 | dropout_ratio=0.1, 26 | num_classes=19, 27 | norm_cfg=norm_cfg, 28 | align_corners=False, 29 | loss_decode=dict( 30 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 31 | auxiliary_head=dict( 32 | type='FCNHead', 33 | in_channels=1024, 34 | in_index=2, 35 | channels=256, 36 | num_convs=1, 37 | concat_input=False, 38 | dropout_ratio=0.1, 39 | num_classes=19, 40 | norm_cfg=norm_cfg, 41 | align_corners=False, 42 | loss_decode=dict( 43 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 44 | # model training and testing settings 45 | train_cfg=dict(), 46 | test_cfg=dict(mode='whole')) 47 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/fpn_poolformer_s12.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | checkpoint_file = 'https://download.openmmlab.com/mmclassification/v0/poolformer/poolformer-s12_3rdparty_32xb128_in1k_20220414-f8d83051.pth' # noqa 4 | custom_imports = dict(imports='mmcls.models', allow_failed_imports=False) 5 | model = dict( 6 | type='EncoderDecoder', 7 | backbone=dict( 8 | type='mmcls.PoolFormer', 9 | arch='s12', 10 | init_cfg=dict( 11 | type='Pretrained', checkpoint=checkpoint_file, prefix='backbone.'), 12 | in_patch_size=7, 13 | in_stride=4, 14 | in_pad=2, 15 | down_patch_size=3, 16 | down_stride=2, 17 | down_pad=1, 18 | drop_rate=0., 19 | drop_path_rate=0., 20 | out_indices=(0, 2, 4, 6), 21 | frozen_stages=0, 22 | ), 23 | neck=dict( 24 | type='FPN', 25 | in_channels=[256, 512, 1024, 2048], 26 | out_channels=256, 27 | num_outs=4), 28 | decode_head=dict( 29 | type='FPNHead', 30 | in_channels=[256, 256, 256, 256], 31 | in_index=[0, 1, 2, 3], 32 | feature_strides=[4, 8, 16, 32], 33 | channels=128, 34 | dropout_ratio=0.1, 35 | num_classes=19, 36 | norm_cfg=norm_cfg, 37 | align_corners=False, 38 | loss_decode=dict( 39 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 40 | # model training and testing settings 41 | train_cfg=dict(), 42 | test_cfg=dict(mode='whole')) 43 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/LandCover/README.md: -------------------------------------------------------------------------------- 1 | # 地物分类 2 | 3 | ## 任务描述 4 | 用于多目标分割任务,例如土地使用分析,建筑物水体绿地等多目标分割等。 5 | 6 | ## 配置文件介绍 7 | 我们提供了一整套模型配置和默认参数,能够有效训练出性能优秀的模型。 8 | 9 | ### 配置1 10 | [fcn_hr18_1024x1024_16k_landcover](fcn_hr18_1024x1024_16k_landcover.py): 11 | 使用该配置,可以训练出一个效果很好的hrnet18模型。如果你有自己的需要,可以参考此配置文件完成一次从头训练。 12 | 13 | ### 配置2 14 | [fcn_hr48_1024x1024_16k_landcover](fcn_hr48_1024x1024_16k_landcover.py): 15 | Backbone为hrnet48的模型。使用该配置,可以训练出一个效果很好的hrnet48模型。如果你有自己的需要,可以参考此配置文件完成一次从头训练。 16 | 另外,我们提供了基于该配置训练出来的的sota模型:`aie://LandCover/landcover_v1.6.pth`。用户可以通过该模型出发,完成在自己数据上的微调。 17 | 18 | ### 配置3与配置4 19 | [fcn_hr18_1024x1024_16k_landcover_semi](fcn_hr18_1024x1024_16k_landcover_semi.py) 20 | 使用该配置可以引入额外的无标签数据对模型进行半监督训练,提升模型的表现能力。 21 | 22 | [MKD](mkd_semi_sup.py) 23 | 24 | 近期半监督语义分割方法中一直在广泛研究一致性正则化。受益于图像、特征和网络扰动,取得了显著的性能。为了充分利用这些扰动,本文提出了一种新的一致性正则化框架,称为互相知识蒸馏(MKD)。我们创新地引入了基于一致性正则化方法的两个辅助均值教师模型。更具体地说,我们使用一位均值老师生成的伪标签来监督另一个学生网络,以实现两个分支之间的互相知识蒸馏。除了使用图像级强度和弱度增强之外,我们还考虑隐式语义分布采用特征增强来为学生添加更多扰动。所提出的框架显着增加了训练样本的多样性。在公共基准测试中的大量实验表明,我们的框架在不同的半监督设置下优于以前的最新技术(SOTA)方法。用于使用更多的无标签数据提升地物分类的性能。 25 | 26 | #### 使用方法: 27 | 准备好有标签数据和无标签数据,直接使用[配置3](fcn_hr18_1024x1024_16k_landcover_semi.py)进行训练,即可使用我们提出的MKD方法。 28 | 29 | #### 参见[MKD Offical Github](https://github.com/jianlong-yuan/semi-mmseg) 30 | 31 | #### Citation 32 | 33 | ```bibtext 34 | @article{yuan2022semi, 35 | title={Semi-supervised Semantic Segmentation with Mutual Knowledge Distillation}, 36 | author={Yuan, Jianlong and Ge, Jinchao and Wang, Zhibin and Shen,Chunhua and Liu, Yifan}, 37 | journal={arXiv preprint arXiv:2208.11499}, 38 | year={2022} 39 | } 40 | ``` 41 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/ocrnet_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='CascadeEncoderDecoder', 5 | num_stages=2, 6 | pretrained='open-mmlab://resnet50_v1c', 7 | backbone=dict( 8 | type='ResNetV1c', 9 | depth=50, 10 | num_stages=4, 11 | out_indices=(0, 1, 2, 3), 12 | dilations=(1, 1, 2, 4), 13 | strides=(1, 2, 1, 1), 14 | norm_cfg=norm_cfg, 15 | norm_eval=False, 16 | style='pytorch', 17 | contract_dilation=True), 18 | decode_head=[ 19 | dict( 20 | type='FCNHead', 21 | in_channels=1024, 22 | in_index=2, 23 | channels=256, 24 | num_convs=1, 25 | concat_input=False, 26 | dropout_ratio=0.1, 27 | num_classes=19, 28 | norm_cfg=norm_cfg, 29 | align_corners=False, 30 | loss_decode=dict( 31 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 32 | dict( 33 | type='OCRHead', 34 | in_channels=2048, 35 | in_index=3, 36 | channels=512, 37 | ocr_channels=256, 38 | dropout_ratio=0.1, 39 | num_classes=19, 40 | norm_cfg=norm_cfg, 41 | align_corners=False, 42 | loss_decode=dict( 43 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)) 44 | ], 45 | # model training and testing settings 46 | train_cfg=dict(), 47 | test_cfg=dict(mode='whole')) 48 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/psanet_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='PSAHead', 19 | in_channels=2048, 20 | in_index=3, 21 | channels=512, 22 | mask_size=(97, 97), 23 | psa_type='bi-direction', 24 | compact=False, 25 | shrink_factor=2, 26 | normalization_factor=1.0, 27 | psa_softmax=True, 28 | dropout_ratio=0.1, 29 | num_classes=19, 30 | norm_cfg=norm_cfg, 31 | align_corners=False, 32 | loss_decode=dict( 33 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 34 | auxiliary_head=dict( 35 | type='FCNHead', 36 | in_channels=1024, 37 | in_index=2, 38 | channels=256, 39 | num_convs=1, 40 | concat_input=False, 41 | dropout_ratio=0.1, 42 | num_classes=19, 43 | norm_cfg=norm_cfg, 44 | align_corners=False, 45 | loss_decode=dict( 46 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 47 | # model training and testing settings 48 | train_cfg=dict(), 49 | test_cfg=dict(mode='whole')) 50 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/twins_pcpvt-s_fpn.py: -------------------------------------------------------------------------------- 1 | checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/twins/pcpvt_small_20220308-e638c41c.pth' # noqa 2 | 3 | # model settings 4 | backbone_norm_cfg = dict(type='LN') 5 | norm_cfg = dict(type='SyncBN', requires_grad=True) 6 | model = dict( 7 | type='EncoderDecoder', 8 | backbone=dict( 9 | type='PCPVT', 10 | init_cfg=dict(type='Pretrained', checkpoint=checkpoint), 11 | in_channels=3, 12 | embed_dims=[64, 128, 320, 512], 13 | num_heads=[1, 2, 5, 8], 14 | patch_sizes=[4, 2, 2, 2], 15 | strides=[4, 2, 2, 2], 16 | mlp_ratios=[8, 8, 4, 4], 17 | out_indices=(0, 1, 2, 3), 18 | qkv_bias=True, 19 | norm_cfg=backbone_norm_cfg, 20 | depths=[3, 4, 6, 3], 21 | sr_ratios=[8, 4, 2, 1], 22 | norm_after_stage=False, 23 | drop_rate=0.0, 24 | attn_drop_rate=0., 25 | drop_path_rate=0.2), 26 | neck=dict( 27 | type='FPN', 28 | in_channels=[64, 128, 320, 512], 29 | out_channels=256, 30 | num_outs=4), 31 | decode_head=dict( 32 | type='FPNHead', 33 | in_channels=[256, 256, 256, 256], 34 | in_index=[0, 1, 2, 3], 35 | feature_strides=[4, 8, 16, 32], 36 | channels=128, 37 | dropout_ratio=0.1, 38 | num_classes=150, 39 | norm_cfg=norm_cfg, 40 | align_corners=False, 41 | loss_decode=dict( 42 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 43 | # model training and testing settings 44 | train_cfg=dict(), 45 | test_cfg=dict(mode='whole')) 46 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/encnet_r50-d8.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | out_indices=(0, 1, 2, 3), 11 | dilations=(1, 1, 2, 4), 12 | strides=(1, 2, 1, 1), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | decode_head=dict( 18 | type='EncHead', 19 | in_channels=[512, 1024, 2048], 20 | in_index=(1, 2, 3), 21 | channels=512, 22 | num_codes=32, 23 | use_se_loss=True, 24 | add_lateral=False, 25 | dropout_ratio=0.1, 26 | num_classes=19, 27 | norm_cfg=norm_cfg, 28 | align_corners=False, 29 | loss_decode=dict( 30 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0), 31 | loss_se_decode=dict( 32 | type='CrossEntropyLoss', use_sigmoid=True, loss_weight=0.2)), 33 | auxiliary_head=dict( 34 | type='FCNHead', 35 | in_channels=1024, 36 | in_index=2, 37 | channels=256, 38 | num_convs=1, 39 | concat_input=False, 40 | dropout_ratio=0.1, 41 | num_classes=19, 42 | norm_cfg=norm_cfg, 43 | align_corners=False, 44 | loss_decode=dict( 45 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 46 | # model training and testing settings 47 | train_cfg=dict(), 48 | test_cfg=dict(mode='whole')) 49 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/upernet_mae.py: -------------------------------------------------------------------------------- 1 | norm_cfg = dict(type='SyncBN', requires_grad=True) 2 | model = dict( 3 | type='EncoderDecoder', 4 | pretrained=None, 5 | backbone=dict( 6 | type='MAE', 7 | img_size=(640, 640), 8 | patch_size=16, 9 | in_channels=3, 10 | embed_dims=768, 11 | num_layers=12, 12 | num_heads=12, 13 | mlp_ratio=4, 14 | out_indices=(3, 5, 7, 11), 15 | attn_drop_rate=0.0, 16 | drop_path_rate=0.1, 17 | norm_cfg=dict(type='LN', eps=1e-6), 18 | act_cfg=dict(type='GELU'), 19 | norm_eval=False, 20 | init_values=0.1), 21 | neck=dict(type='Feature2Pyramid', embed_dim=768, rescales=[4, 2, 1, 0.5]), 22 | decode_head=dict( 23 | type='UPerHead', 24 | in_channels=[384, 384, 384, 384], 25 | in_index=[0, 1, 2, 3], 26 | pool_scales=(1, 2, 3, 6), 27 | channels=512, 28 | dropout_ratio=0.1, 29 | num_classes=19, 30 | norm_cfg=norm_cfg, 31 | align_corners=False, 32 | loss_decode=dict( 33 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 34 | auxiliary_head=dict( 35 | type='FCNHead', 36 | in_channels=384, 37 | in_index=2, 38 | channels=256, 39 | num_convs=1, 40 | concat_input=False, 41 | dropout_ratio=0.1, 42 | num_classes=19, 43 | norm_cfg=norm_cfg, 44 | align_corners=False, 45 | loss_decode=dict( 46 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 47 | # model training and testing settings 48 | train_cfg=dict(), 49 | test_cfg=dict(mode='whole')) 50 | -------------------------------------------------------------------------------- /aiearth/deeplearning/models/landcover/architectures/base.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) OpenMMLab. All rights reserved. 2 | # -*- conding: utf-8 -*- 3 | from mmseg.models.builder import MODELS 4 | from mmcv.runner import BaseModule 5 | 6 | 7 | class BaseArchitecture(BaseModule): 8 | """Base class for architecture. 9 | 10 | Args: 11 | model (:obj:`torch.nn.Module`): Model to be slimmed, such as 12 | ``DETECTOR`` in MMDetection. 13 | """ 14 | 15 | def __init__(self, model, **kwargs): 16 | super(BaseArchitecture, self).__init__(**kwargs) 17 | self.model = MODELS.build(model) 18 | 19 | def forward_dummy(self, img): 20 | """Used for calculating network flops.""" 21 | assert hasattr(self.model, "forward_dummy") 22 | return self.model.forward_dummy(img) 23 | 24 | def forward(self, img, return_loss=True, **kwargs): 25 | """Calls either forward_train or forward_test depending on whether 26 | return_loss=True. 27 | 28 | Note this setting will change the expected inputs. When 29 | ``return_loss=True``, img and img_meta are single-nested (i.e. Tensor 30 | and List[dict]), and when ``resturn_loss=False``, img and img_meta 31 | should be double nested (i.e. List[Tensor], List[List[dict]]), with 32 | the outer list indicating test time augmentations. 33 | """ 34 | return self.model(img, return_loss=return_loss, **kwargs) 35 | 36 | def simple_test(self, img, img_metas): 37 | """Test without augmentation.""" 38 | return self.model.simple_test(img, img_metas) 39 | 40 | def show_result(self, img, result, **kwargs): 41 | """Draw `result` over `img`""" 42 | return self.model.show_result(img, result, **kwargs) 43 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/upernet_beit.py: -------------------------------------------------------------------------------- 1 | norm_cfg = dict(type='SyncBN', requires_grad=True) 2 | model = dict( 3 | type='EncoderDecoder', 4 | pretrained=None, 5 | backbone=dict( 6 | type='BEiT', 7 | img_size=(640, 640), 8 | patch_size=16, 9 | in_channels=3, 10 | embed_dims=768, 11 | num_layers=12, 12 | num_heads=12, 13 | mlp_ratio=4, 14 | out_indices=(3, 5, 7, 11), 15 | qv_bias=True, 16 | attn_drop_rate=0.0, 17 | drop_path_rate=0.1, 18 | norm_cfg=dict(type='LN', eps=1e-6), 19 | act_cfg=dict(type='GELU'), 20 | norm_eval=False, 21 | init_values=0.1), 22 | neck=dict(type='Feature2Pyramid', embed_dim=768, rescales=[4, 2, 1, 0.5]), 23 | decode_head=dict( 24 | type='UPerHead', 25 | in_channels=[768, 768, 768, 768], 26 | in_index=[0, 1, 2, 3], 27 | pool_scales=(1, 2, 3, 6), 28 | channels=768, 29 | dropout_ratio=0.1, 30 | num_classes=150, 31 | norm_cfg=norm_cfg, 32 | align_corners=False, 33 | loss_decode=dict( 34 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 35 | auxiliary_head=dict( 36 | type='FCNHead', 37 | in_channels=768, 38 | in_index=2, 39 | channels=256, 40 | num_convs=1, 41 | concat_input=False, 42 | dropout_ratio=0.1, 43 | num_classes=150, 44 | norm_cfg=norm_cfg, 45 | align_corners=False, 46 | loss_decode=dict( 47 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 48 | # model training and testing settings 49 | train_cfg=dict(), 50 | test_cfg=dict(mode='whole')) 51 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/pspnet_unet_s5-d16.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained=None, 6 | backbone=dict( 7 | type='UNet', 8 | in_channels=3, 9 | base_channels=64, 10 | num_stages=5, 11 | strides=(1, 1, 1, 1, 1), 12 | enc_num_convs=(2, 2, 2, 2, 2), 13 | dec_num_convs=(2, 2, 2, 2), 14 | downsamples=(True, True, True, True), 15 | enc_dilations=(1, 1, 1, 1, 1), 16 | dec_dilations=(1, 1, 1, 1), 17 | with_cp=False, 18 | conv_cfg=None, 19 | norm_cfg=norm_cfg, 20 | act_cfg=dict(type='ReLU'), 21 | upsample_cfg=dict(type='InterpConv'), 22 | norm_eval=False), 23 | decode_head=dict( 24 | type='PSPHead', 25 | in_channels=64, 26 | in_index=4, 27 | channels=16, 28 | pool_scales=(1, 2, 3, 6), 29 | dropout_ratio=0.1, 30 | num_classes=2, 31 | norm_cfg=norm_cfg, 32 | align_corners=False, 33 | loss_decode=dict( 34 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 35 | auxiliary_head=dict( 36 | type='FCNHead', 37 | in_channels=128, 38 | in_index=3, 39 | channels=64, 40 | num_convs=1, 41 | concat_input=False, 42 | dropout_ratio=0.1, 43 | num_classes=2, 44 | norm_cfg=norm_cfg, 45 | align_corners=False, 46 | loss_decode=dict( 47 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 48 | # model training and testing settings 49 | train_cfg=dict(), 50 | test_cfg=dict(mode='slide', crop_size=256, stride=170)) 51 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/upernet_convnext.py: -------------------------------------------------------------------------------- 1 | norm_cfg = dict(type='SyncBN', requires_grad=True) 2 | custom_imports = dict(imports='mmcls.models', allow_failed_imports=False) 3 | checkpoint_file = 'https://download.openmmlab.com/mmclassification/v0/convnext/downstream/convnext-base_3rdparty_32xb128-noema_in1k_20220301-2a0ee547.pth' # noqa 4 | model = dict( 5 | type='EncoderDecoder', 6 | pretrained=None, 7 | backbone=dict( 8 | type='mmcls.ConvNeXt', 9 | arch='base', 10 | out_indices=[0, 1, 2, 3], 11 | drop_path_rate=0.4, 12 | layer_scale_init_value=1.0, 13 | gap_before_final_norm=False, 14 | init_cfg=dict( 15 | type='Pretrained', checkpoint=checkpoint_file, 16 | prefix='backbone.')), 17 | decode_head=dict( 18 | type='UPerHead', 19 | in_channels=[128, 256, 512, 1024], 20 | in_index=[0, 1, 2, 3], 21 | pool_scales=(1, 2, 3, 6), 22 | channels=512, 23 | dropout_ratio=0.1, 24 | num_classes=19, 25 | norm_cfg=norm_cfg, 26 | align_corners=False, 27 | loss_decode=dict( 28 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 29 | auxiliary_head=dict( 30 | type='FCNHead', 31 | in_channels=384, 32 | in_index=2, 33 | channels=256, 34 | num_convs=1, 35 | concat_input=False, 36 | dropout_ratio=0.1, 37 | num_classes=19, 38 | norm_cfg=norm_cfg, 39 | align_corners=False, 40 | loss_decode=dict( 41 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 42 | # model training and testing settings 43 | train_cfg=dict(), 44 | test_cfg=dict(mode='whole')) 45 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/deeplabv3_unet_s5-d16.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained=None, 6 | backbone=dict( 7 | type='UNet', 8 | in_channels=3, 9 | base_channels=64, 10 | num_stages=5, 11 | strides=(1, 1, 1, 1, 1), 12 | enc_num_convs=(2, 2, 2, 2, 2), 13 | dec_num_convs=(2, 2, 2, 2), 14 | downsamples=(True, True, True, True), 15 | enc_dilations=(1, 1, 1, 1, 1), 16 | dec_dilations=(1, 1, 1, 1), 17 | with_cp=False, 18 | conv_cfg=None, 19 | norm_cfg=norm_cfg, 20 | act_cfg=dict(type='ReLU'), 21 | upsample_cfg=dict(type='InterpConv'), 22 | norm_eval=False), 23 | decode_head=dict( 24 | type='ASPPHead', 25 | in_channels=64, 26 | in_index=4, 27 | channels=16, 28 | dilations=(1, 12, 24, 36), 29 | dropout_ratio=0.1, 30 | num_classes=2, 31 | norm_cfg=norm_cfg, 32 | align_corners=False, 33 | loss_decode=dict( 34 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 35 | auxiliary_head=dict( 36 | type='FCNHead', 37 | in_channels=128, 38 | in_index=3, 39 | channels=64, 40 | num_convs=1, 41 | concat_input=False, 42 | dropout_ratio=0.1, 43 | num_classes=2, 44 | norm_cfg=norm_cfg, 45 | align_corners=False, 46 | loss_decode=dict( 47 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 48 | # model training and testing settings 49 | train_cfg=dict(), 50 | test_cfg=dict(mode='slide', crop_size=256, stride=170)) 51 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/fcn_unet_s5-d16.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained=None, 6 | backbone=dict( 7 | type='UNet', 8 | in_channels=3, 9 | base_channels=64, 10 | num_stages=5, 11 | strides=(1, 1, 1, 1, 1), 12 | enc_num_convs=(2, 2, 2, 2, 2), 13 | dec_num_convs=(2, 2, 2, 2), 14 | downsamples=(True, True, True, True), 15 | enc_dilations=(1, 1, 1, 1, 1), 16 | dec_dilations=(1, 1, 1, 1), 17 | with_cp=False, 18 | conv_cfg=None, 19 | norm_cfg=norm_cfg, 20 | act_cfg=dict(type='ReLU'), 21 | upsample_cfg=dict(type='InterpConv'), 22 | norm_eval=False), 23 | decode_head=dict( 24 | type='FCNHead', 25 | in_channels=64, 26 | in_index=4, 27 | channels=64, 28 | num_convs=1, 29 | concat_input=False, 30 | dropout_ratio=0.1, 31 | num_classes=2, 32 | norm_cfg=norm_cfg, 33 | align_corners=False, 34 | loss_decode=dict( 35 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 36 | auxiliary_head=dict( 37 | type='FCNHead', 38 | in_channels=128, 39 | in_index=3, 40 | channels=64, 41 | num_convs=1, 42 | concat_input=False, 43 | dropout_ratio=0.1, 44 | num_classes=2, 45 | norm_cfg=norm_cfg, 46 | align_corners=False, 47 | loss_decode=dict( 48 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 49 | # model training and testing settings 50 | train_cfg=dict(), 51 | test_cfg=dict(mode='slide', crop_size=256, stride=170)) 52 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/fastfcn_r50-d32_jpu_psp.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://resnet50_v1c', 6 | backbone=dict( 7 | type='ResNetV1c', 8 | depth=50, 9 | num_stages=4, 10 | dilations=(1, 1, 2, 4), 11 | strides=(1, 2, 2, 2), 12 | out_indices=(1, 2, 3), 13 | norm_cfg=norm_cfg, 14 | norm_eval=False, 15 | style='pytorch', 16 | contract_dilation=True), 17 | neck=dict( 18 | type='JPU', 19 | in_channels=(512, 1024, 2048), 20 | mid_channels=512, 21 | start_level=0, 22 | end_level=-1, 23 | dilations=(1, 2, 4, 8), 24 | align_corners=False, 25 | norm_cfg=norm_cfg), 26 | decode_head=dict( 27 | type='PSPHead', 28 | in_channels=2048, 29 | in_index=2, 30 | channels=512, 31 | pool_scales=(1, 2, 3, 6), 32 | dropout_ratio=0.1, 33 | num_classes=19, 34 | norm_cfg=norm_cfg, 35 | align_corners=False, 36 | loss_decode=dict( 37 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 38 | auxiliary_head=dict( 39 | type='FCNHead', 40 | in_channels=1024, 41 | in_index=1, 42 | channels=256, 43 | num_convs=1, 44 | concat_input=False, 45 | dropout_ratio=0.1, 46 | num_classes=19, 47 | norm_cfg=norm_cfg, 48 | align_corners=False, 49 | loss_decode=dict( 50 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 51 | # model training and testing settings 52 | train_cfg=dict(), 53 | test_cfg=dict(mode='whole')) 54 | -------------------------------------------------------------------------------- /docs/train/pretrained_model.md: -------------------------------------------------------------------------------- 1 | # 预训练模型 2 | 3 | 4 | | 任务类型 | 说明 | 模型 | Crop Size | Uri | config | 5 | | --- | --- | --- | --- | --- | --- | 6 | | 变化检测/ChangeDet | 通用二分类变化 | hrnet_w18 | 896x896 | aie://ChangeDet/changedet_hrnet_w18_base_150k_new512_cosine_lr_batch_48_v25_finetune.pth | [config](../../aiearth/deeplearning/trainer/mmseg/configs/ChangeDet/hrnet_w18_base_150k_new512_cosine_lr_batch_48_v25.py) | 7 | | 变化检测/BuildingChange | 建筑物变化 | hrnet_w18 | 896x896 | aie://BuildingChange/buildingchange_hrnet_w18_base_150k_new512_cosine_lr_batch_48_builingchange.pth | [config](../../aiearth/deeplearning/trainer/mmseg/configs/BuildingChange/hrnet_w18_base_150k_new512_cosine_lr_batch_48_builingchange.py) | 8 | | 地物分类/LandCover | 通用地物分类(11类) | hrnet_w48 | | aie://LandCover/landcover_v1.6.pth | [config](../../aiearth/deeplearning/trainer/mmseg/configs/LandCover/fcn_hr48_1024x1024_16k_landcover.py) | 9 | | 地物分类/LandCover | 半监督 | hrnet_w48 | | N/A | [config](../../aiearth/deeplearning/trainer/mmseg/configs/LandCover/semi.py) | 10 | | 目标提取/TargetExtraction | 水体提取 | hrnet_w18 | | aie://TargetExtraction/water_fcn_hr18_1024x1024_40k4_bceious1w1.0_semi0108_it1_0108_it2_0103_iter_20000.pth | [config](../../aiearth/deeplearning/trainer/mmseg/configs/TargetExtraction/fcn_hr18_1024x1024_40k4_bceious1w1.0.py) | 11 | 12 | 13 | ## 使用方式 14 | 15 | 16 | ```python 17 | import aie 18 | aie.Authenticate() 19 | aie.Initialize() 20 | 21 | # changeDet pretrained model 22 | from aiearth.deeplearning.model_zoo.model import PretrainedModel 23 | model = PretrainedModel("aie://ChangeDet/changedet_hrnet_w18_base_150k_new512_cosine_lr_batch_48_v25_finetune.pth") 24 | 25 | # 下载到本地的路径 26 | print(model.local_path) 27 | 28 | # 用于pretrained 29 | trainer.cfg.model.pretrained = model.local_path 30 | 31 | # 用于finetune 32 | trainer.load_from(model) 33 | ``` 34 | 35 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/upernet_swin.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | backbone_norm_cfg = dict(type='LN', requires_grad=True) 4 | model = dict( 5 | type='EncoderDecoder', 6 | pretrained=None, 7 | backbone=dict( 8 | type='SwinTransformer', 9 | pretrain_img_size=224, 10 | embed_dims=96, 11 | patch_size=4, 12 | window_size=7, 13 | mlp_ratio=4, 14 | depths=[2, 2, 6, 2], 15 | num_heads=[3, 6, 12, 24], 16 | strides=(4, 2, 2, 2), 17 | out_indices=(0, 1, 2, 3), 18 | qkv_bias=True, 19 | qk_scale=None, 20 | patch_norm=True, 21 | drop_rate=0., 22 | attn_drop_rate=0., 23 | drop_path_rate=0.3, 24 | use_abs_pos_embed=False, 25 | act_cfg=dict(type='GELU'), 26 | norm_cfg=backbone_norm_cfg), 27 | decode_head=dict( 28 | type='UPerHead', 29 | in_channels=[96, 192, 384, 768], 30 | in_index=[0, 1, 2, 3], 31 | pool_scales=(1, 2, 3, 6), 32 | channels=512, 33 | dropout_ratio=0.1, 34 | num_classes=19, 35 | norm_cfg=norm_cfg, 36 | align_corners=False, 37 | loss_decode=dict( 38 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 39 | auxiliary_head=dict( 40 | type='FCNHead', 41 | in_channels=384, 42 | in_index=2, 43 | channels=256, 44 | num_convs=1, 45 | concat_input=False, 46 | dropout_ratio=0.1, 47 | num_classes=19, 48 | norm_cfg=norm_cfg, 49 | align_corners=False, 50 | loss_decode=dict( 51 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 52 | # model training and testing settings 53 | train_cfg=dict(), 54 | test_cfg=dict(mode='whole')) 55 | -------------------------------------------------------------------------------- /benchmark/loveda/config/fcn_hr18.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://msra/hrnetv2_w18', 6 | backbone=dict( 7 | type='HRNet', 8 | norm_cfg=norm_cfg, 9 | norm_eval=False, 10 | extra=dict( 11 | stage1=dict( 12 | num_modules=1, 13 | num_branches=1, 14 | block='BOTTLENECK', 15 | num_blocks=(4, ), 16 | num_channels=(64, )), 17 | stage2=dict( 18 | num_modules=1, 19 | num_branches=2, 20 | block='BASIC', 21 | num_blocks=(4, 4), 22 | num_channels=(18, 36)), 23 | stage3=dict( 24 | num_modules=4, 25 | num_branches=3, 26 | block='BASIC', 27 | num_blocks=(4, 4, 4), 28 | num_channels=(18, 36, 72)), 29 | stage4=dict( 30 | num_modules=3, 31 | num_branches=4, 32 | block='BASIC', 33 | num_blocks=(4, 4, 4, 4), 34 | num_channels=(18, 36, 72, 144)))), 35 | decode_head=dict( 36 | type='FCNHead', 37 | in_channels=[18, 36, 72, 144], 38 | in_index=(0, 1, 2, 3), 39 | channels=sum([18, 36, 72, 144]), 40 | input_transform='resize_concat', 41 | kernel_size=1, 42 | num_convs=1, 43 | concat_input=False, 44 | dropout_ratio=-1, 45 | num_classes=19, 46 | norm_cfg=norm_cfg, 47 | align_corners=False, 48 | loss_decode=dict( 49 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 50 | # model training and testing settings 51 | train_cfg=dict(), 52 | test_cfg=dict(mode='whole')) 53 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/target_extraction_trainer.py: -------------------------------------------------------------------------------- 1 | from copy import copy 2 | import os 3 | 4 | from aiearth.deeplearning.datasets.datasets import DatasetType 5 | from .mmseg_trainer import MMSegTrainer, AIEMMsegCloudModel 6 | from .mmseg_utils import to_mmseg_config 7 | from aiearth.deeplearning.utils.pytorch2onnx.common import to_onnx 8 | 9 | class AIETargetExtractionCloudModel(AIEMMsegCloudModel): 10 | CLOUD_MODEL_TYPE = "TARGET_EXTRACTION" 11 | 12 | def get_classes(self): 13 | # remove backgroup class 14 | classes = copy(super().get_classes()) 15 | classes = list(classes) 16 | classes.pop(0) 17 | return classes 18 | 19 | 20 | class TargetExtractionTrainer(MMSegTrainer): 21 | def __init__(self, work_dir="./workspace", config_name="fcn_hr18_1024x1024_40k4_bceious1w1.0") -> None: 22 | super(TargetExtractionTrainer, self).__init__(work_dir=work_dir) 23 | self.base_cfg = to_mmseg_config("TargetExtraction/" + config_name) 24 | from aiearth.deeplearning.models.target_extraction.segmentors import EncoderDecoderBinary 25 | 26 | def setup_dataset(self, dataset, data_type="train"): 27 | assert dataset.dataset_type == DatasetType.single_img 28 | super().setup_datasets(dataset, data_type=data_type) 29 | 30 | def to_cloud_model(self, onnx_shape=None) -> AIETargetExtractionCloudModel: 31 | return AIETargetExtractionCloudModel(self.cfg, onnx_shape=onnx_shape) 32 | 33 | def export_onnx(self, output_file=None, checkpoint_path=None, shape=(1024, 1024)): 34 | if not checkpoint_path: 35 | checkpoint_path = os.path.join(self.work_dir, "latest.pth") 36 | if not output_file: 37 | output_file = checkpoint_path.replace(".pth", ".onnx") 38 | to_onnx(self.cfg, output_file, checkpoint_path, shape) 39 | return output_file 40 | 41 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/fcn_hr18.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='open-mmlab://msra/hrnetv2_w18', 6 | backbone=dict( 7 | type='HRNet', 8 | norm_cfg=norm_cfg, 9 | norm_eval=False, 10 | extra=dict( 11 | stage1=dict( 12 | num_modules=1, 13 | num_branches=1, 14 | block='BOTTLENECK', 15 | num_blocks=(4, ), 16 | num_channels=(64, )), 17 | stage2=dict( 18 | num_modules=1, 19 | num_branches=2, 20 | block='BASIC', 21 | num_blocks=(4, 4), 22 | num_channels=(18, 36)), 23 | stage3=dict( 24 | num_modules=4, 25 | num_branches=3, 26 | block='BASIC', 27 | num_blocks=(4, 4, 4), 28 | num_channels=(18, 36, 72)), 29 | stage4=dict( 30 | num_modules=3, 31 | num_branches=4, 32 | block='BASIC', 33 | num_blocks=(4, 4, 4, 4), 34 | num_channels=(18, 36, 72, 144)))), 35 | decode_head=dict( 36 | type='FCNHead', 37 | in_channels=[18, 36, 72, 144], 38 | in_index=(0, 1, 2, 3), 39 | channels=sum([18, 36, 72, 144]), 40 | input_transform='resize_concat', 41 | kernel_size=1, 42 | num_convs=1, 43 | concat_input=False, 44 | dropout_ratio=-1, 45 | num_classes=19, 46 | norm_cfg=norm_cfg, 47 | align_corners=False, 48 | loss_decode=dict( 49 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 50 | # model training and testing settings 51 | train_cfg=dict(), 52 | test_cfg=dict(mode='whole')) 53 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/changedet_trainer.py: -------------------------------------------------------------------------------- 1 | import os 2 | from copy import copy 3 | from .mmseg_trainer import MMSegTrainer,AIEMMsegCloudModel 4 | from .mmseg_utils import to_mmseg_config 5 | from .vars import CONFIG_BASE_DIR 6 | 7 | import aiearth.deeplearning.models.changedet as ChangedetModel 8 | from aiearth.deeplearning.datasets.datasets import DatasetType 9 | from aiearth.deeplearning.utils.pytorch2onnx.changedet import to_onnx 10 | 11 | 12 | class AIEChangeDetCloudModel(AIEMMsegCloudModel): 13 | CLOUD_MODEL_TYPE = "CHANGE_DETECTION_BIN" 14 | 15 | def get_classes(self): 16 | # remove backgroup class 17 | classes = copy(super().get_classes()) 18 | classes = list(classes) 19 | classes.pop(0) 20 | return classes 21 | 22 | class ChangeDetTrainer(MMSegTrainer): 23 | config_base_dir = os.path.join(CONFIG_BASE_DIR, "ChangeDet") 24 | 25 | def __init__(self, config_name="effi-b0_base_50k_new256_cosine_lr_batch_128_adamw" ,work_dir="./workspace") -> None: 26 | super(ChangeDetTrainer, self).__init__(work_dir=work_dir) 27 | self.base_cfg = to_mmseg_config("ChangeDet/" + config_name) 28 | 29 | def setup_datasets(self, dataset, data_type="train"): 30 | assert dataset.dataset_type.value == DatasetType.double_img.value 31 | super().setup_datasets(dataset, data_type=data_type) 32 | 33 | def export_onnx(self, output_file=None, checkpoint_path=None, shape=(1024, 1024)): 34 | if not checkpoint_path: 35 | checkpoint_path = os.path.join(self.work_dir, "latest.pth") 36 | if not output_file: 37 | output_file = checkpoint_path.replace(".pth", ".onnx") 38 | to_onnx(self.cfg, output_file, checkpoint_path, shape) 39 | return output_file 40 | 41 | def to_cloud_model(self, onnx_shape=None) -> AIEChangeDetCloudModel: 42 | return AIEChangeDetCloudModel(self.cfg, onnx_shape) 43 | 44 | 45 | -------------------------------------------------------------------------------- /aiearth/deeplearning/utils/colormap.py: -------------------------------------------------------------------------------- 1 | import random 2 | import numpy as np 3 | 4 | def create_pascal_label_colormap(): 5 | colormap = np.zeros((256, 3), dtype=int) 6 | ind = np.arange(256, dtype=int) 7 | for shift in reversed(list(range(8))): 8 | for channel in range(3): 9 | colormap[:, channel] |= ((ind >> channel) & 1) << shift 10 | ind >>= 3 11 | return colormap 12 | 13 | 14 | def create_colormap_by_class_color(palette:list): 15 | colormap = np.zeros((256, 3), dtype=np.uint8) 16 | for idx, color in enumerate(palette): 17 | colormap[idx] = color 18 | return colormap 19 | 20 | 21 | def color_to_bgr(color_code): 22 | if color_code[0] != "#": 23 | raise Exception("color code error") 24 | red = int(color_code[1:3], 16) 25 | green = int(color_code[3:5], 16) 26 | blue = int(color_code[5:7], 16) 27 | return blue, green, red 28 | 29 | 30 | def generate_color_code_list(class_num): 31 | color_code_list = [] 32 | colormap = create_pascal_label_colormap() 33 | for i in range(class_num): 34 | bgr_color = tuple(colormap[i+1]) 35 | color_code = bgr2color_code(bgr_color) 36 | color_code_list.append(color_code) 37 | return color_code_list 38 | 39 | 40 | def bgr2color_code(bgr_tuple): 41 | red_code = int_to_color_string(bgr_tuple[2]) 42 | green_code = int_to_color_string(bgr_tuple[1]) 43 | blue_code = int_to_color_string(bgr_tuple[0]) 44 | return "#" + red_code + green_code + blue_code 45 | 46 | 47 | def int_to_color_string(i: int): 48 | assert i < 256 49 | hex_string = hex(i) 50 | ret = hex_string[2:].upper() 51 | if len(ret) == 1: 52 | ret = '0' + ret 53 | return ret 54 | 55 | 56 | if __name__ == '__main__': 57 | classes = ["a", "b", "c"] 58 | color_list = generate_color_code_list(len(classes)) 59 | for cls, color in zip(classes, color_list): 60 | print(cls, color) -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/twins_pcpvt-s_upernet.py: -------------------------------------------------------------------------------- 1 | checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/twins/pcpvt_small_20220308-e638c41c.pth' # noqa 2 | 3 | # model settings 4 | backbone_norm_cfg = dict(type='LN') 5 | norm_cfg = dict(type='SyncBN', requires_grad=True) 6 | model = dict( 7 | type='EncoderDecoder', 8 | backbone=dict( 9 | type='PCPVT', 10 | init_cfg=dict(type='Pretrained', checkpoint=checkpoint), 11 | in_channels=3, 12 | embed_dims=[64, 128, 320, 512], 13 | num_heads=[1, 2, 5, 8], 14 | patch_sizes=[4, 2, 2, 2], 15 | strides=[4, 2, 2, 2], 16 | mlp_ratios=[8, 8, 4, 4], 17 | out_indices=(0, 1, 2, 3), 18 | qkv_bias=True, 19 | norm_cfg=backbone_norm_cfg, 20 | depths=[3, 4, 6, 3], 21 | sr_ratios=[8, 4, 2, 1], 22 | norm_after_stage=False, 23 | drop_rate=0.0, 24 | attn_drop_rate=0., 25 | drop_path_rate=0.2), 26 | decode_head=dict( 27 | type='UPerHead', 28 | in_channels=[64, 128, 320, 512], 29 | in_index=[0, 1, 2, 3], 30 | pool_scales=(1, 2, 3, 6), 31 | channels=512, 32 | dropout_ratio=0.1, 33 | num_classes=150, 34 | norm_cfg=norm_cfg, 35 | align_corners=False, 36 | loss_decode=dict( 37 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 38 | auxiliary_head=dict( 39 | type='FCNHead', 40 | in_channels=320, 41 | in_index=2, 42 | channels=256, 43 | num_convs=1, 44 | concat_input=False, 45 | dropout_ratio=0.1, 46 | num_classes=150, 47 | norm_cfg=norm_cfg, 48 | align_corners=False, 49 | loss_decode=dict( 50 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 51 | # model training and testing settings 52 | train_cfg=dict(), 53 | test_cfg=dict(mode='whole')) 54 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/pointrend_r50.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='CascadeEncoderDecoder', 5 | num_stages=2, 6 | pretrained='open-mmlab://resnet50_v1c', 7 | backbone=dict( 8 | type='ResNetV1c', 9 | depth=50, 10 | num_stages=4, 11 | out_indices=(0, 1, 2, 3), 12 | dilations=(1, 1, 1, 1), 13 | strides=(1, 2, 2, 2), 14 | norm_cfg=norm_cfg, 15 | norm_eval=False, 16 | style='pytorch', 17 | contract_dilation=True), 18 | neck=dict( 19 | type='FPN', 20 | in_channels=[256, 512, 1024, 2048], 21 | out_channels=256, 22 | num_outs=4), 23 | decode_head=[ 24 | dict( 25 | type='FPNHead', 26 | in_channels=[256, 256, 256, 256], 27 | in_index=[0, 1, 2, 3], 28 | feature_strides=[4, 8, 16, 32], 29 | channels=128, 30 | dropout_ratio=-1, 31 | num_classes=19, 32 | norm_cfg=norm_cfg, 33 | align_corners=False, 34 | loss_decode=dict( 35 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 36 | dict( 37 | type='PointHead', 38 | in_channels=[256], 39 | in_index=[0], 40 | channels=256, 41 | num_fcs=3, 42 | coarse_pred_each_layer=True, 43 | dropout_ratio=-1, 44 | num_classes=19, 45 | align_corners=False, 46 | loss_decode=dict( 47 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)) 48 | ], 49 | # model training and testing settings 50 | train_cfg=dict( 51 | num_points=2048, oversample_ratio=3, importance_sample_ratio=0.75), 52 | test_cfg=dict( 53 | mode='whole', 54 | subdivision_steps=2, 55 | subdivision_num_points=8196, 56 | scale_factor=2)) 57 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/upernet_vit-b16_ln_mln.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True) 3 | model = dict( 4 | type='EncoderDecoder', 5 | pretrained='pretrain/jx_vit_base_p16_224-80ecf9dd.pth', 6 | backbone=dict( 7 | type='VisionTransformer', 8 | img_size=(512, 512), 9 | patch_size=16, 10 | in_channels=3, 11 | embed_dims=768, 12 | num_layers=12, 13 | num_heads=12, 14 | mlp_ratio=4, 15 | out_indices=(2, 5, 8, 11), 16 | qkv_bias=True, 17 | drop_rate=0.0, 18 | attn_drop_rate=0.0, 19 | drop_path_rate=0.0, 20 | with_cls_token=True, 21 | norm_cfg=dict(type='LN', eps=1e-6), 22 | act_cfg=dict(type='GELU'), 23 | norm_eval=False, 24 | interpolate_mode='bicubic'), 25 | neck=dict( 26 | type='MultiLevelNeck', 27 | in_channels=[768, 768, 768, 768], 28 | out_channels=768, 29 | scales=[4, 2, 1, 0.5]), 30 | decode_head=dict( 31 | type='UPerHead', 32 | in_channels=[768, 768, 768, 768], 33 | in_index=[0, 1, 2, 3], 34 | pool_scales=(1, 2, 3, 6), 35 | channels=512, 36 | dropout_ratio=0.1, 37 | num_classes=19, 38 | norm_cfg=norm_cfg, 39 | align_corners=False, 40 | loss_decode=dict( 41 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)), 42 | auxiliary_head=dict( 43 | type='FCNHead', 44 | in_channels=768, 45 | in_index=3, 46 | channels=256, 47 | num_convs=1, 48 | concat_input=False, 49 | dropout_ratio=0.1, 50 | num_classes=19, 51 | norm_cfg=norm_cfg, 52 | align_corners=False, 53 | loss_decode=dict( 54 | type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)), 55 | # model training and testing settings 56 | train_cfg=dict(), 57 | test_cfg=dict(mode='whole')) # yapf: disable 58 | -------------------------------------------------------------------------------- /benchmark/loveda/config/loveda.py: -------------------------------------------------------------------------------- 1 | # dataset settings 2 | dataset_type = 'LoveDADataset' 3 | data_root = 'data/loveDA' 4 | img_norm_cfg = dict( 5 | mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) 6 | crop_size = (512, 512) 7 | train_pipeline = [ 8 | dict(type='LoadImageFromFile'), 9 | dict(type='LoadAnnotations', reduce_zero_label=True), 10 | dict(type='Resize', img_scale=(2048, 512), ratio_range=(0.5, 2.0)), 11 | dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75), 12 | dict(type='RandomFlip', prob=0.5), 13 | dict(type='PhotoMetricDistortion'), 14 | dict(type='Normalize', **img_norm_cfg), 15 | dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255), 16 | dict(type='DefaultFormatBundle'), 17 | dict(type='Collect', keys=['img', 'gt_semantic_seg']), 18 | ] 19 | test_pipeline = [ 20 | dict(type='LoadImageFromFile'), 21 | dict( 22 | type='MultiScaleFlipAug', 23 | img_scale=(1024, 1024), 24 | # img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75], 25 | flip=False, 26 | transforms=[ 27 | dict(type='Resize', keep_ratio=True), 28 | dict(type='RandomFlip'), 29 | dict(type='Normalize', **img_norm_cfg), 30 | dict(type='ImageToTensor', keys=['img']), 31 | dict(type='Collect', keys=['img']), 32 | ]) 33 | ] 34 | data = dict( 35 | samples_per_gpu=4, 36 | workers_per_gpu=4, 37 | train=dict( 38 | type=dataset_type, 39 | data_root=data_root, 40 | img_dir='img_dir/train', 41 | ann_dir='ann_dir/train', 42 | pipeline=train_pipeline), 43 | val=dict( 44 | type=dataset_type, 45 | data_root=data_root, 46 | img_dir='img_dir/val', 47 | ann_dir='ann_dir/val', 48 | pipeline=test_pipeline), 49 | test=dict( 50 | type=dataset_type, 51 | data_root=data_root, 52 | img_dir='img_dir/val', 53 | ann_dir='ann_dir/val', 54 | pipeline=test_pipeline)) 55 | -------------------------------------------------------------------------------- /aiearth/deeplearning/job/train_job.py: -------------------------------------------------------------------------------- 1 | import abc 2 | import os 3 | from aiearth.deeplearning.trainer.trainer import Trainer 4 | from aiearth.deeplearning.utils.flock import Flock 5 | 6 | class TrainJob(): 7 | work_dir = "./work_dir" 8 | classes = None #['background', "change"] 9 | trainer = None 10 | datasets = { 11 | 'train': [], 12 | 'val': [], 13 | 'test': [], 14 | } 15 | setup_flag = False 16 | 17 | @abc.abstractmethod 18 | def set_trainer(self) -> Trainer: 19 | pass 20 | 21 | def get_trainer(self): 22 | if self.trainer == None: 23 | self.trainer = self.set_trainer() 24 | self.set_classes() 25 | return self.trainer 26 | 27 | def set_classes(self): 28 | self.trainer.set_classes(self.classes) 29 | 30 | @abc.abstractmethod 31 | def set_datasets(self): 32 | pass 33 | 34 | def setup(self): 35 | if self.setup_flag: 36 | return self.trainer 37 | trainer = self.get_trainer() 38 | self.set_datasets() 39 | for data_type, datasets in self.datasets.items(): 40 | for dataset in datasets: 41 | trainer.setup_datasets(dataset, data_type=data_type) 42 | self.setup_flag = True 43 | self.traine = trainer 44 | return trainer 45 | 46 | def run(self, *args, **kwargs): 47 | return self.train(*args, **kwargs) 48 | 49 | def train(self, *args, **kwargs): 50 | os.makedirs(self.work_dir, exist_ok=True) 51 | lock_file = os.path.join(self.work_dir, "data.lock") 52 | flock = Flock(lock_file) 53 | flock.lock() 54 | trainer = self.setup() 55 | flock.un_lock() 56 | trainer.train(*args, **kwargs) 57 | 58 | def test(self, *args, **kwargs): 59 | trainer = self.setup() 60 | trainer.test(*args, **kwargs) 61 | 62 | def export_onnx(self, *args, **kwargs): 63 | trainer = self.setup() 64 | trainer.export_onnx(*args, **kwargs) 65 | 66 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/configs/_base_/models/fast_scnn.py: -------------------------------------------------------------------------------- 1 | # model settings 2 | norm_cfg = dict(type='SyncBN', requires_grad=True, momentum=0.01) 3 | model = dict( 4 | type='EncoderDecoder', 5 | backbone=dict( 6 | type='FastSCNN', 7 | downsample_dw_channels=(32, 48), 8 | global_in_channels=64, 9 | global_block_channels=(64, 96, 128), 10 | global_block_strides=(2, 2, 1), 11 | global_out_channels=128, 12 | higher_in_channels=64, 13 | lower_in_channels=128, 14 | fusion_out_channels=128, 15 | out_indices=(0, 1, 2), 16 | norm_cfg=norm_cfg, 17 | align_corners=False), 18 | decode_head=dict( 19 | type='DepthwiseSeparableFCNHead', 20 | in_channels=128, 21 | channels=128, 22 | concat_input=False, 23 | num_classes=19, 24 | in_index=-1, 25 | norm_cfg=norm_cfg, 26 | align_corners=False, 27 | loss_decode=dict( 28 | type='CrossEntropyLoss', use_sigmoid=True, loss_weight=1)), 29 | auxiliary_head=[ 30 | dict( 31 | type='FCNHead', 32 | in_channels=128, 33 | channels=32, 34 | num_convs=1, 35 | num_classes=19, 36 | in_index=-2, 37 | norm_cfg=norm_cfg, 38 | concat_input=False, 39 | align_corners=False, 40 | loss_decode=dict( 41 | type='CrossEntropyLoss', use_sigmoid=True, loss_weight=0.4)), 42 | dict( 43 | type='FCNHead', 44 | in_channels=64, 45 | channels=32, 46 | num_convs=1, 47 | num_classes=19, 48 | in_index=-3, 49 | norm_cfg=norm_cfg, 50 | concat_input=False, 51 | align_corners=False, 52 | loss_decode=dict( 53 | type='CrossEntropyLoss', use_sigmoid=True, loss_weight=0.4)), 54 | ], 55 | # model training and testing settings 56 | train_cfg=dict(), 57 | test_cfg=dict(mode='whole')) 58 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmdet/configs/_base_/datasets/aicrowd.py: -------------------------------------------------------------------------------- 1 | # dataset settings 2 | dataset_type = 'AICrowdDataset' 3 | data_root = 'data/AICrowd/' 4 | img_norm_cfg = dict( 5 | mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) 6 | train_pipeline = [ 7 | dict(type='LoadImageFromFile'), 8 | dict(type='LoadAnnotations', with_bbox=True, with_mask=True), 9 | dict(type='Resize', img_scale=(320, 320), keep_ratio=True), 10 | dict(type='RandomFlip', flip_ratio=0.5), 11 | dict(type='Normalize', **img_norm_cfg), 12 | dict(type='Pad', size_divisor=32), 13 | dict(type='DefaultFormatBundle'), 14 | dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']), 15 | ] 16 | test_pipeline = [ 17 | dict(type='LoadImageFromFile'), 18 | dict( 19 | type='MultiScaleFlipAug', 20 | img_scale=(320, 320), 21 | flip=False, 22 | transforms=[ 23 | dict(type='Resize', keep_ratio=True), 24 | dict(type='RandomFlip'), 25 | dict(type='Normalize', **img_norm_cfg), 26 | dict(type='Pad', size_divisor=32), 27 | dict(type='ImageToTensor', keys=['img']), 28 | dict(type='Collect', keys=['img']), 29 | ]) 30 | ] 31 | data = dict( 32 | samples_per_gpu=2, 33 | workers_per_gpu=2, 34 | train=dict( 35 | type=dataset_type, 36 | ann_file=data_root + 'train/annotation-label1.json', 37 | img_prefix=data_root + 'train/images', 38 | # ann_file=data_root + 'val/annotation-small-label1.json', 39 | # img_prefix=data_root + 'val/images', 40 | pipeline=train_pipeline), 41 | val=dict( 42 | type=dataset_type, 43 | ann_file=data_root + 'val/annotation-small-label1.json', 44 | img_prefix=data_root + 'val/images', 45 | pipeline=test_pipeline), 46 | test=dict( 47 | type=dataset_type, 48 | ann_file=data_root + 'val/annotation-small-label1.json', 49 | img_prefix=data_root + 'val/images', 50 | pipeline=test_pipeline)) 51 | evaluation = dict(metric=['bbox', 'segm']) 52 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmdet/configs/PolyBuilding/README.md: -------------------------------------------------------------------------------- 1 | # PolyBuilding 2 | 3 | ## Introduction 4 | 5 | 我们介绍了一种名为PolyBuilding的矢量目标Transformer,用于建筑物提取。PolyBuilding直接从遥感图像中预测建筑物的矢量表示。它基于encoder-decoder Transformer架构,同时预测建筑实例的边界框和多边形。给定一组多边形查询,模型学习它们之间的关系并从图像中编码上下文信息,以预测具有固定顶点数的最终建筑物多边形集。考虑到预测固定数量的顶点会导致顶点冗余和减少多边形的规则性,我们设计了一个角点分类头来区分建筑物的角落。通过利用角点分类分数,设计了一个多边形细化方案,以消除冗余顶点,并产生具有规则轮廓和低复杂度的最终多边形。此外,虽然PolyBuilding模型完全可端到端地训练,我们也提出了一种两阶段训练策略,将坐标回归和角分类分解为两个阶段,以减轻多任务学习的困难。PolyBuilding在像素级覆盖率、实例级检测性能和几何级属性方面实现了新的SOTA水平。 6 | 7 | ### ENG Version 8 | 9 | We present PolyBuilding, a polygon Transformer for building extraction. PolyBuilding direct predicts vector representation of buildings from remote sensing images. It builds upon an encoder-decoder transformer architecture and simultaneously predicts the bounding boxes and polygons for the building instances. Given a set of polygon queries, the model learns the relations among them and encodes context information from the image to predict the final set of building polygons with a fixed vertex number. Considering that predicting a fixed number of vertices would cause vertex redundancy and reduce polygon regularity, we design a corner classification head to distinguish the building corners. By taking advantage of the corner classification scores, a polygon refinement scheme is designed to remove the redundant vertices and produce the final polygons with regular contours and low complexity. In addition, although the PolyBuilding model is fully end-to-end trainable, we propose a two-phase training strategy to decompose the coordinate regression and corner classification into two stages to alleviate the difficulty of multi-task learning. PolyBuilding achieves a new state-of-the-art in terms of pixel-level coverage, instance-level detection performance, and geometry-level properties. Quantitative and qualitative results verify the superiority and effectiveness of our model. 10 | 11 |
12 | 13 |
14 | 15 | ## Usage 16 | 默认配置default.py可以用于从头训练一个矢量建筑物提取的模型。我们已经提供了一个训练好的默认模型(基于AICrowdDataset完成训练):`aie://PolyBuilding/polybuilding.pth`。如果你有更进一步的需求,比如继续在你自己的数据集上进行模型微调,可以把我们提供的模型配置到load_from参数。 17 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmdet/mmdet_utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | from mmcv.utils import Config 3 | from .vars import CONFIG_BASE_DIR, RUNTIME_CONFIG_PATH 4 | 5 | 6 | class AIEToMMdetCoverter(object): 7 | def to_mmdet_dataset_cfg( 8 | self, mmdet_dataset_dict: dict, mmdet_dataset_cfg_template_path: str 9 | ): 10 | """mmdet_dataset_dict:内容如下 11 | dataset: 数据集加载类目名称 12 | img_dir: 影像所在目录 13 | img_suffix: 影像文件路径后缀 14 | ann_dir: 标注所在目录 15 | seg_map_suffix: 标注文件路径后缀 16 | split: 影像与标注文件映射文件路径,内容格式, 17 | 单图: 18 | image_path ann_path 19 | 双图: 20 | image_1_path image_2_path ann_path 21 | classes: 类目列表 22 | """ 23 | datasets = Config.fromfile(mmdet_dataset_cfg_template_path) 24 | # custom_datasets = datasets.__getattribute__('_cfg_dict').to_dict() 25 | tmp_datasets = dict( 26 | data=dict( 27 | train=dict( 28 | data_root=mmdet_dataset_dict["img_dir"], 29 | split=mmdet_dataset_dict["split"], 30 | ), 31 | val=dict( 32 | data_root=mmdet_dataset_dict["img_dir"], 33 | split=mmdet_dataset_dict["split"], 34 | ), 35 | test=dict( 36 | data_root=mmdet_dataset_dict["img_dir"], 37 | split=mmdet_dataset_dict["split"], 38 | ), 39 | ) 40 | ) 41 | datasets.merge_from_dict(tmp_datasets) 42 | return datasets 43 | 44 | 45 | def mmdet_base_config(): 46 | base_config = Config() 47 | runtime_config = Config.fromfile(RUNTIME_CONFIG_PATH) 48 | base_config.merge_from_dict(runtime_config.__getattribute__("_cfg_dict").to_dict()) 49 | return base_config 50 | 51 | 52 | def to_mmdet_config(config_name): 53 | base_config = mmdet_base_config() 54 | model_config_path = os.path.join(CONFIG_BASE_DIR, config_name + ".py") 55 | model_config = Config.fromfile(model_config_path) 56 | model_config.merge_from_dict(base_config.__getattribute__("_cfg_dict").to_dict()) 57 | return model_config 58 | -------------------------------------------------------------------------------- /aiearth/deeplearning/trainer/mmseg/mmseg_utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | from mmcv.utils import Config 3 | from .vars import CONFIG_BASE_DIR, SCHEDULE_CONFIG_PATH, RUNTIME_CONFIG_PATH 4 | 5 | 6 | class AIEToMMsegCoverter(object): 7 | def to_mmseg_dataset_cfg(self, mmseg_dataset_dict:dict, mmseg_dataset_cfg_template_path:str): 8 | ''' mmseg_dataset_dict:内容如下 9 | dataset: 数据集加载类目名称 10 | img_dir: 影像所在目录 11 | img_suffix: 影像文件路径后缀 12 | ann_dir: 标注所在目录 13 | seg_map_suffix: 标注文件路径后缀 14 | split: 影像与标注文件映射文件路径,内容格式, 15 | 单图: 16 | image_path ann_path 17 | 双图: 18 | image_1_path image_2_path ann_path 19 | classes: 类目列表 20 | ''' 21 | datasets = Config.fromfile(mmseg_dataset_cfg_template_path) 22 | #custom_datasets = datasets.__getattribute__('_cfg_dict').to_dict() 23 | tmp_datasets = dict( 24 | data=dict( 25 | train = dict(data_root=mmseg_dataset_dict["img_dir"], split=mmseg_dataset_dict["split"]), 26 | val = dict(data_root=mmseg_dataset_dict["img_dir"], split=mmseg_dataset_dict["split"]), 27 | test = dict(data_root=mmseg_dataset_dict["img_dir"], split=mmseg_dataset_dict["split"]), 28 | ) 29 | ) 30 | datasets.merge_from_dict(tmp_datasets) 31 | return datasets 32 | 33 | 34 | def mmseg_base_config(): 35 | base_config = Config() 36 | runtime_config = Config.fromfile(RUNTIME_CONFIG_PATH) 37 | base_config.merge_from_dict(runtime_config.__getattribute__('_cfg_dict').to_dict()) 38 | schedule_config = Config.fromfile(SCHEDULE_CONFIG_PATH) 39 | base_config.merge_from_dict(schedule_config.__getattribute__('_cfg_dict').to_dict()) 40 | return base_config 41 | 42 | def to_mmseg_config(config_name): 43 | base_config = mmseg_base_config() 44 | model_config_path = os.path.join(CONFIG_BASE_DIR, config_name + ".py") 45 | model_config = Config.fromfile(model_config_path) 46 | model_config.merge_from_dict(base_config.__getattribute__('_cfg_dict').to_dict()) 47 | return model_config 48 | 49 | 50 | -------------------------------------------------------------------------------- /aiearth/deeplearning/datasets/mmseg/changedet/pipelines/test_time_aug.py: -------------------------------------------------------------------------------- 1 | from mmseg.datasets.pipelines.test_time_aug import MultiScaleFlipAug 2 | from mmseg.datasets.builder import PIPELINES 3 | import mmcv, warnings 4 | 5 | 6 | @PIPELINES.register_module() 7 | class MultiScaleFlipAugCD(MultiScaleFlipAug): 8 | """Apply multi-scale and flip augmentations to Change Detection dataset. 9 | 10 | Args: 11 | transforms (list[dict]): Transforms to apply. 12 | img_scale (tuple[int]): Image scales. 13 | img_ratios (tuple[float]): Image aspect ratios. 14 | flip (bool): Whether to flip images. 15 | flip_direction (str): Flip direction. Options are "horizontal" and "vertical". 16 | """ 17 | 18 | def __init__(self, **kwargs): 19 | super(MultiScaleFlipAugCD, self).__init__(**kwargs) 20 | 21 | def __call__(self, results): 22 | """Call function to apply augmentations to results. 23 | 24 | Args: 25 | results (dict): Result dict from loading pipeline. 26 | 27 | Returns: 28 | dict: Augmented results. 29 | """ 30 | aug_data = [] 31 | if self.img_scale is None and mmcv.is_list_of(self.img_ratios, float): 32 | h, w = results.get("img", results["img1"]).shape[:2] 33 | img_scale = [(int(w * ratio), int(h * ratio)) for ratio in self.img_ratios] 34 | else: 35 | img_scale = self.img_scale 36 | flip_aug = [False, True] if self.flip else [False] 37 | for scale in img_scale: 38 | for flip in flip_aug: 39 | for direction in self.flip_direction: 40 | _results = results.copy() 41 | _results["scale"] = scale 42 | _results["flip"] = flip 43 | _results["flip_direction"] = direction 44 | data = self.transforms(_results) 45 | aug_data.append(data) 46 | # list of dict to dict of list 47 | aug_data_dict = {key: [] for key in aug_data[0]} 48 | for data in aug_data: 49 | for key, val in data.items(): 50 | aug_data_dict[key].append(val) 51 | return aug_data_dict 52 | -------------------------------------------------------------------------------- /docs/dataset/cloud.md: -------------------------------------------------------------------------------- 1 | # AIE云上样本集使用 2 | 3 | 4 | ## 前期准备 5 | ### 概念介绍 6 | #### 1)样本集ID 7 | 在AIE云平台模型训练->样本管理系统中,所管理的样本集均有唯一的ID值,可通过ID精确匹配目标样本集。样本集ID可通过页面查看样本集详情时,URL路径的最后一个路径的数字既为样本id 8 | 9 | 10 | ``` 11 | URL: https://engine-aiearth.aliyun.com/#/portal/model/sample/detail/600054?pageNo=1 12 | 13 | 样本集ID: 600054 14 | ``` 15 | 16 | #### 2) 样本集名称 17 | 在AIE云平台模型训练->样本管理系统中,所管理的样本集均有名称,既前端页面样本名称列所展示的字段。该名称可重复,可在SDK中通过名称进行搜索,返回值是一个列表,需要用户自行判断。 18 | 19 | ## quick start 20 | 21 | ### 配置AIE平台Token 22 | 23 | 24 | 以下步骤全局设置一次就可以 25 | 26 | 27 | ``` 28 | import aie 29 | # Authenticate无参数会进入交互式shell输入token 30 | aie.Authenticate() 31 | 32 | 33 | # Authenticate也可以直接配置token 34 | # token = 'xxxxxxxxxxxx' 35 | # aie.Authenticate(token) 36 | ``` 37 | 38 | 39 | ### 地物分类样本集 40 | 41 | ``` 42 | # 地物分类样本集 43 | from aiearth.deeplearning.cloud.datasets import LandcoverDataset, PublicDatasetMeta 44 | 45 | 46 | # 使用dataset id获取云上样本集 47 | dataset = LandcoverDataset(PublicDatasetMeta.GID_15_TRAIN["dataset_id"], data_root="./landcover") 48 | 49 | print(dataset.classes) 50 | # output 51 | # ['背景', 'industrial_land', 'garden_land', 'urban_residential', 'arbor_forest', 'rural_residential', 'shrub_land', 'traffic_land', 'natural_meadow', 'paddy_field', 'artificial_meadow', 'irrigated_land', 'river', 'dry_cropland', 'lake', 'pond'] 52 | 53 | # 提取某些类目,其他类目作为背景 54 | dataset.set_classes_filter(['industrial_land']) 55 | print(dataset.classes) 56 | # output 57 | # ['background', 'industrial_land'] 58 | 59 | # 在样本集初始化时直接提取类目 60 | dataset = LandcoverDataset(PublicDatasetMeta.GID_15_TRAIN["dataset_id"], data_root="./landcover", classes_filter=['industrial_land']) 61 | ``` 62 | 63 | 64 | ### 变化检测样本集(二分类) 65 | 66 | 67 | 68 | ``` 69 | from aiearth.deeplearning.cloud.datasets import BinaryChangeDetDataset, PublicDatasetMeta 70 | 71 | # 使用dataset id获取云上样本集 72 | dataset = BinaryChangeDetDataset(PublicDatasetMeta.SEMANTIC_CHANGE_DETECTION_SECOND["dataset_id"], data_root="./changedet") 73 | ``` 74 | 75 | 76 | 77 | ### 目标提取(地物识别) 78 | 79 | 80 | ``` 81 | from aiearth.deeplearning.cloud.datasets import TargetExtractionDataset, PublicDatasetMeta 82 | 83 | # 使用dataset id获取云上样本集 84 | dataset = TargetExtractionDataset(PublicDatasetMeta.BUILDING_AERIAL_IMAGERY_TRAIN["dataset_id"], data_root="./target_extraction") 85 | ``` 86 | --------------------------------------------------------------------------------