Skip to content

Commit

Permalink
Change segmentation model argument names (#919)
Browse files Browse the repository at this point in the history
* name change semgmentation model

* chmod evaluate.py

* fix variable name evaluate

* encoder -> backbone

* remove backbone_output_stride from confs

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
  • Loading branch information
nilsleh and adamjstewart authored Dec 13, 2022
1 parent f5b6d17 commit d5ff69c
Show file tree
Hide file tree
Showing 28 changed files with 112 additions and 115 deletions.
7 changes: 3 additions & 4 deletions conf/chesapeake_cvpr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ experiment:
name: "chesapeake_cvpr_example"
module:
loss: "ce"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: null
encoder_output_stride: 16
model: "unet"
backbone: "resnet18"
weights: null
learning_rate: 1e-3
learning_rate_schedule_patience: 6
in_channels: 4
Expand Down
6 changes: 3 additions & 3 deletions conf/etci2021.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ experiment:
task: "etci2021"
module:
loss: "ce"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: "imagenet"
model: "unet"
backbone: "resnet18"
weights: "imagenet"
learning_rate: 1e-3
learning_rate_schedule_patience: 6
in_channels: 6
Expand Down
6 changes: 3 additions & 3 deletions conf/inria.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ experiment:
name: "inria_test"
module:
loss: "ce"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: "imagenet"
model: "unet"
backbone: "resnet18"
weights: "imagenet"
learning_rate: 1e-3
learning_rate_schedule_patience: 6
in_channels: 3
Expand Down
6 changes: 3 additions & 3 deletions conf/landcoverai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ experiment:
task: "landcoverai"
module:
loss: "ce"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: "imagenet"
model: "unet"
backbone: "resnet18"
weights: "imagenet"
learning_rate: 1e-3
learning_rate_schedule_patience: 6
in_channels: 3
Expand Down
7 changes: 3 additions & 4 deletions conf/naipchesapeake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ experiment:
task: "naipchesapeake"
module:
loss: "ce"
segmentation_model: "deeplabv3+"
encoder_name: "resnet34"
encoder_weights: "imagenet"
encoder_output_stride: 16
model: "deeplabv3+"
backbone: "resnet34"
weights: "imagenet"
learning_rate: 1e-3
learning_rate_schedule_patience: 2
in_channels: 4
Expand Down
6 changes: 3 additions & 3 deletions conf/oscd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ experiment:
task: "oscd"
module:
loss: "jaccard"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: null
model: "unet"
backbone: "resnet18"
weights: null
learning_rate: 1e-3
learning_rate_schedule_patience: 6
verbose: false
Expand Down
7 changes: 3 additions & 4 deletions conf/sen12ms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ experiment:
task: "sen12ms"
module:
loss: "ce"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: null
encoder_output_stride: 16
model: "unet"
backbone: "resnet18"
weights: null
learning_rate: 1e-3
learning_rate_schedule_patience: 2
in_channels: 15
Expand Down
12 changes: 6 additions & 6 deletions evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,18 +176,18 @@ def main(args: argparse.Namespace) -> None:
elif issubclass(TASK, SemanticSegmentationTask):
val_row = {
"split": "val",
"segmentation_model": hparams["segmentation_model"],
"encoder_name": hparams["encoder_name"],
"encoder_weights": hparams["encoder_weights"],
"model": hparams["model"],
"backbone": hparams["backbone"],
"weights": hparams["weights"],
"learning_rate": hparams["learning_rate"],
"loss": hparams["loss"],
}

test_row = {
"split": "test",
"segmentation_model": hparams["segmentation_model"],
"encoder_name": hparams["encoder_name"],
"encoder_weights": hparams["encoder_weights"],
"model": hparams["model"],
"backbone": hparams["backbone"],
"weights": hparams["weights"],
"learning_rate": hparams["learning_rate"],
"loss": hparams["loss"],
}
Expand Down
14 changes: 7 additions & 7 deletions experiments/run_chesapeake_cvpr_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Hyperparameter options
training_set_options = ["de"]
model_options = ["unet"]
encoder_options = ["resnet18", "resnet50"]
backbone_options = ["resnet18", "resnet50"]
lr_options = [1e-2, 1e-3, 1e-4]
loss_options = ["ce", "jaccard"]
weight_init_options = ["null", "imagenet"]
Expand All @@ -36,16 +36,16 @@ def do_work(work: "Queue[str]", gpu_idx: int) -> bool:
if __name__ == "__main__":
work: "Queue[str]" = Queue()

for (train_state, model, encoder, lr, loss, weight_init) in itertools.product(
for (train_state, model, backbone, lr, loss, weight_init) in itertools.product(
training_set_options,
model_options,
encoder_options,
backbone_options,
lr_options,
loss_options,
weight_init_options,
):

experiment_name = f"{train_state}_{model}_{encoder}_{lr}_{loss}_{weight_init}"
experiment_name = f"{train_state}_{model}_{backbone}_{lr}_{loss}_{weight_init}"

output_dir = os.path.join("output", "chesapeake-cvpr_experiments")
log_dir = os.path.join(output_dir, "logs")
Expand All @@ -57,9 +57,9 @@ def do_work(work: "Queue[str]", gpu_idx: int) -> bool:
"python train.py"
+ f" config_file={config_file}"
+ f" experiment.name={experiment_name}"
+ f" experiment.module.segmentation_model={model}"
+ f" experiment.module.encoder_name={encoder}"
+ f" experiment.module.encoder_weights={weight_init}"
+ f" experiment.module.model={model}"
+ f" experiment.module.backbone={backbone}"
+ f" experiment.module.weights={weight_init}"
+ f" experiment.module.learning_rate={lr}"
+ f" experiment.module.loss={loss}"
+ " experiment.module.class_set=7"
Expand Down
12 changes: 6 additions & 6 deletions experiments/run_landcoverai_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# Hyperparameter options
model_options = ["unet"]
encoder_options = ["resnet18", "resnet50"]
backbone_options = ["resnet18", "resnet50"]
lr_options = [1e-2, 1e-3, 1e-4]
loss_options = ["ce", "jaccard"]
weight_init_options = ["null", "imagenet"]
Expand All @@ -35,11 +35,11 @@ def do_work(work: "Queue[str]", gpu_idx: int) -> bool:
if __name__ == "__main__":
work: "Queue[str]" = Queue()

for (model, encoder, lr, loss, weight_init) in itertools.product(
model_options, encoder_options, lr_options, loss_options, weight_init_options
for (model, backbone, lr, loss, weight_init) in itertools.product(
model_options, backbone_options, lr_options, loss_options, weight_init_options
):

experiment_name = f"{model}_{encoder}_{lr}_{loss}_{weight_init}"
experiment_name = f"{model}_{backbone}_{lr}_{loss}_{weight_init}"

output_dir = os.path.join("output", "landcoverai_experiments")
log_dir = os.path.join(output_dir, "logs")
Expand All @@ -54,8 +54,8 @@ def do_work(work: "Queue[str]", gpu_idx: int) -> bool:
+ f" experiment.module.segmentation_model={model}"
+ f" experiment.module.learning_rate={lr}"
+ f" experiment.module.loss={loss}"
+ f" experiment.module.encoder_name={encoder}"
+ f" experiment.module.encoder_weights={weight_init}"
+ f" experiment.module.backbone={backbone}"
+ f" experiment.module.weights={weight_init}"
+ f" program.output_dir={output_dir}"
+ f" program.log_dir={log_dir}"
+ f" program.data_dir={DATA_DIR}"
Expand Down
14 changes: 7 additions & 7 deletions experiments/run_landcoverai_seed_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# Hyperparameter options
model_options = ["unet"]
encoder_options = ["resnet18", "resnet50"]
backbone_options = ["resnet18", "resnet50"]
lr_options = [1e-2, 1e-3, 1e-4]
loss_options = ["ce", "jaccard"]
weight_init_options = ["null", "imagenet"]
Expand All @@ -35,11 +35,11 @@ def do_work(work: "Queue[str]", gpu_idx: int) -> bool:
if __name__ == "__main__":
work: "Queue[str]" = Queue()

for (model, encoder, lr, loss, weight_init) in itertools.product(
model_options, encoder_options, lr_options, loss_options, weight_init_options
for (model, backbone, lr, loss, weight_init) in itertools.product(
model_options, backbone_options, lr_options, loss_options, weight_init_options
):

experiment_name = f"{model}_{encoder}_{lr}_{loss}_{weight_init}"
experiment_name = f"{model}_{backbone}_{lr}_{loss}_{weight_init}"

output_dir = os.path.join("output", "landcoverai_experiments")
log_dir = os.path.join(output_dir, "logs")
Expand All @@ -51,11 +51,11 @@ def do_work(work: "Queue[str]", gpu_idx: int) -> bool:
"python train.py"
+ f" config_file={config_file}"
+ f" experiment.name={experiment_name}"
+ f" experiment.module.segmentation_model={model}"
+ f" experiment.module.model={model}"
+ f" experiment.module.learning_rate={lr}"
+ f" experiment.module.loss={loss}"
+ f" experiment.module.encoder_name={encoder}"
+ f" experiment.module.encoder_weights={weight_init}"
+ f" experiment.module.backbone={backbone}"
+ f" experiment.module.weights={weight_init}"
+ f" program.output_dir={output_dir}"
+ f" program.log_dir={log_dir}"
+ f" program.data_dir={DATA_DIR}"
Expand Down
7 changes: 3 additions & 4 deletions tests/conf/chesapeake_cvpr_5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ experiment:
task: "chesapeake_cvpr"
module:
loss: "ce"
segmentation_model: "unet"
encoder_name: "resnet50"
encoder_weights: null
encoder_output_stride: 16
model: "unet"
backbone: "resnet50"
weights: null
learning_rate: 1e-3
learning_rate_schedule_patience: 6
in_channels: 4
Expand Down
2 changes: 1 addition & 1 deletion tests/conf/chesapeake_cvpr_7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ experiment:
task: "chesapeake_cvpr"
module:
loss: "ce"
segmentation_model: "unet"
model: "unet"
encoder_name: "resnet18"
encoder_weights: null
encoder_output_stride: 16
Expand Down
2 changes: 1 addition & 1 deletion tests/conf/chesapeake_cvpr_prior.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ experiment:
task: "chesapeake_cvpr"
module:
loss: "ce"
segmentation_model: "unet"
model: "unet"
encoder_name: "resnet50"
encoder_weights: null
encoder_output_stride: 16
Expand Down
6 changes: 3 additions & 3 deletions tests/conf/deepglobelandcover_0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ experiment:
task: "deepglobelandcover"
module:
loss: "ce"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: null
model: "unet"
backbone: "resnet18"
weights: null
learning_rate: 1e-3
learning_rate_schedule_patience: 6
verbose: false
Expand Down
6 changes: 3 additions & 3 deletions tests/conf/deepglobelandcover_5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ experiment:
task: "deepglobelandcover"
module:
loss: "ce"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: null
model: "unet"
backbone: "resnet18"
weights: null
learning_rate: 1e-3
learning_rate_schedule_patience: 6
verbose: false
Expand Down
6 changes: 3 additions & 3 deletions tests/conf/etci2021.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ experiment:
task: "etci2021"
module:
loss: "ce"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: null
model: "unet"
backbone: "resnet18"
weights: null
learning_rate: 1e-3
learning_rate_schedule_patience: 6
in_channels: 6
Expand Down
6 changes: 3 additions & 3 deletions tests/conf/inria.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ experiment:
task: "inria"
module:
loss: "ce"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: "imagenet"
model: "unet"
backbone: "resnet18"
weights: "imagenet"
learning_rate: 1e-3
learning_rate_schedule_patience: 6
in_channels: 3
Expand Down
6 changes: 3 additions & 3 deletions tests/conf/landcoverai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ experiment:
task: "landcoverai"
module:
loss: "ce"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: null
model: "unet"
backbone: "resnet18"
weights: null
learning_rate: 1e-3
learning_rate_schedule_patience: 6
verbose: false
Expand Down
7 changes: 3 additions & 4 deletions tests/conf/naipchesapeake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ experiment:
task: "naipchesapeake"
module:
loss: "ce"
segmentation_model: "deeplabv3+"
encoder_name: "resnet34"
encoder_weights: null
encoder_output_stride: 16
model: "deeplabv3+"
backbone: "resnet34"
weights: null
learning_rate: 1e-3
learning_rate_schedule_patience: 2
in_channels: 4
Expand Down
6 changes: 3 additions & 3 deletions tests/conf/oscd_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ experiment:
task: "oscd"
module:
loss: "jaccard"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: null
model: "unet"
backbone: "resnet18"
weights: null
learning_rate: 1e-3
learning_rate_schedule_patience: 6
verbose: false
Expand Down
6 changes: 3 additions & 3 deletions tests/conf/oscd_rgb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ experiment:
task: "oscd"
module:
loss: "jaccard"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: null
model: "unet"
backbone: "resnet18"
weights: null
learning_rate: 1e-3
learning_rate_schedule_patience: 6
verbose: false
Expand Down
7 changes: 3 additions & 4 deletions tests/conf/sen12ms_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ experiment:
task: "sen12ms"
module:
loss: "ce"
segmentation_model: "unet"
encoder_name: "resnet18"
encoder_weights: null
encoder_output_stride: 16
model: "unet"
backbone: "resnet18"
weights: null
learning_rate: 1e-3
learning_rate_schedule_patience: 2
in_channels: 15
Expand Down
Loading

0 comments on commit d5ff69c

Please sign in to comment.