Skip to content

Commit

Permalink
Refactor Augmentation config (#67)
Browse files Browse the repository at this point in the history
* Refactor Augmentation config

* Modify ckpts

* Refactor pipeline config (#68)

* Refactor preprocessing config

* Merge train and val data configs

* Remove pipeline name

* Modify backbone_config

* Modify ckpts

* Fix inference tests

* Fix device for inference

* Fix scale in inference

* Fix Predictor

* Modify `bottom_up` to `bottomup`

* Fix bottomup inference

* Fix scale in augmentation

* Remove `image` key from TopDownConfmaps pipeline (#71)

* Refactor preprocessing config

* Merge train and val data configs

* Remove pipeline name

* Modify backbone_config

* Modify ckpts

* Fix inference tests

* Fix device for inference

* Fix scale in inference

* Fix Predictor

* Modify `bottom_up` to `bottomup`

* Fix bottomup inference

* Fix scale in augmentation

* Test remove image

* Fix instance cropping

* Fix tests

* Remove scale in pipelines
  • Loading branch information
gitttt-1234 authored Aug 14, 2024
1 parent 08ac252 commit 2f44d2d
Show file tree
Hide file tree
Showing 34 changed files with 1,559 additions and 2,373 deletions.
197 changes: 107 additions & 90 deletions docs/config.md

Large diffs are not rendered by default.

169 changes: 37 additions & 132 deletions docs/config_bottomup.yaml
Original file line number Diff line number Diff line change
@@ -1,118 +1,36 @@
data_config:
provider: LabelsReader
pipeline: BottomUp
train:
labels_path: minimal_instance.pkg.slp
train_labels_path: minimal_instance.pkg.slp
val_labels_path: minimal_instance.pkg.slp
preprocessing:
max_width: null
max_height: null
scale: 1.0
is_rgb: false
preprocessing:
crop_hw:
- 160
- 160
augmentation_config:
random_crop:
random_crop_p: 0
random_crop_hw:
- 160
- 160
use_augmentations: true
augmentations:
intensity:
uniform_noise:
- 0.0
- 0.04
uniform_noise_p: 0
gaussian_noise_mean: 0.02
gaussian_noise_std: 0.004
gaussian_noise_p: 0
contrast:
- 0.5
- 2.0
contrast_p: 0
brightness: 0.0
brightness_p: 0
geometric:
rotation: 180.0
scale: 0
translate:
- 0
- 0
affine_p: 0.5
erase_scale:
- 0.0001
- 0.01
erase_ratio:
- 1
- 1
erase_p: 0
mixup_lambda: null
mixup_p: 0
val:
labels_path: minimal_instance.pkg.slp
max_width: null
max_height: null
is_rgb: false
scale: 1.0
preprocessing:
crop_hw:
- 160
- 160
augmentation_config:
random_crop:
random_crop_p: 0
random_crop_hw:
- 160
- 160
use_augmentations: false
augmentations:
intensity:
uniform_noise:
- 0.0
- 0.04
uniform_noise_p: 0
gaussian_noise_mean: 0.02
gaussian_noise_std: 0.004
gaussian_noise_p: 0
contrast:
- 0.5
- 2.0
contrast_p: 0
brightness: 0.0
brightness_p: 0
geometric:
rotation: 180.0
scale: 0
translate:
- 0
- 0
affine_p: 0.5
erase_scale:
- 0.0001
- 0.01
erase_ratio:
- 1
- 1
erase_p: 0
mixup_lambda: null
mixup_p: 0
use_augmentations_train: true
augmentation_config:
geometric:
rotation: 180.0
scale: null
translate_width: 0
translate_height: 0
affine_p: 0.5

model_config:
init_weights: xavier
pre_trained_weights: null
backbone_type: unet
backbone_config:
backbone_type: unet
backbone_config:
in_channels: 1
kernel_size: 3
filters: 16
filters_rate: 2
max_stride: 16
convs_per_block: 2
stacks: 1
stem_stride: null
middle_block: true
up_interpolate: true
in_channels: 1
kernel_size: 3
filters: 16
filters_rate: 2
max_stride: 16
convs_per_block: 2
stacks: 1
stem_stride: null
middle_block: true
up_interpolate: true

# pre_trained_weights: ConvNeXt_Tiny_Weights
# backbone_config:
Expand Down Expand Up @@ -144,20 +62,20 @@ model_config:
# stem_patch_stride: 2

head_configs:
confmaps:
head_type: MultiInstanceConfmapsHead
head_config:
part_names: None
sigma: 1.5
output_stride: 2
loss_weight: 1.0
pafs:
head_type: PartAffinityFieldsHead
head_config:
edges: None
sigma: 50
output_stride: 4
loss_weight: 1.0
single_instance:
centered_instance:
centroid:
bottomup:
confmaps:
part_names: None
sigma: 1.5
output_stride: 2
loss_weight: 1.0
pafs:
edges: None
sigma: 50
output_stride: 4
loss_weight: 1.0
trainer_config:
train_data_loader:
batch_size: 4
Expand All @@ -169,7 +87,6 @@ trainer_config:
model_ckpt:
save_top_k: 1
save_last: true
device: cpu
trainer_devices: 1
trainer_accelerator: cpu
enable_progress_bar: false
Expand All @@ -179,18 +96,6 @@ trainer_config:
use_wandb: false
save_ckpt: true
save_ckpt_path: min_inst_bottomup1
wandb:
entity: team-ucsd
project: test_centroid_centered
name: fly_unet_centered
wandb_mode: ''
api_key: ''
log_params:
- trainer_config.optimizer_name
- trainer_config.optimizer.amsgrad
- trainer_config.optimizer.lr
- model_config.backbone_config.backbone_type
- model_config.init_weights
optimizer_name: Adam
optimizer:
lr: 0.0001
Expand Down
Loading

0 comments on commit 2f44d2d

Please sign in to comment.