-
Notifications
You must be signed in to change notification settings - Fork 2
/
example_config.yaml
87 lines (77 loc) · 1.92 KB
/
example_config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# env
deterministic: true
allow_tf32_on_matmul: true
allow_tf32_on_cudnn: true
seed: 0
# path
vit_name: vit_h
model_path: /data/zhoupeilin/model/sam_vit_h_4b8939.pth
data_dir: /data/zhoupeilin/data/cellpose_generalized
result_pth_path: /data/zhoupeilin/data/cellpose_generalized/cellseg1/cellseg1_cellpose_generalized_5/sam_lora.pth
train_image_dir: /data/zhoupeilin/data/cellpose_generalized/train/images
train_mask_dir: /data/zhoupeilin/data/cellpose_generalized/train/masks
# data
resize_size: [512, 512]
patch_size: 256
sam_image_size: 512
train_id: [0, 1, 2, 3, 4]
duplicate_data: 32
# train
epoch_max: 300
batch_size: 4
gradient_accumulation_step: 8
base_lr: 3.0e-3
onecycle_lr_pct_start: 0.3
num_workers: 4
## Do not change the following parameters unless you know what you are doing
# net
image_encoder_lora_rank: 4
mask_decoder_lora_rank: 4
freeze_image_encoder: true
freeze_prompt_encoder: true
freeze_mask_decoder_transformer: true
freeze_upscaling_cnn: true
freeze_output_hypernetworks_mlps: true
freeze_mask_decoder_mask_tokens: true
freeze_mask_decoder_iou: true
lora_dropout: 0.1
# random sample point
pos_rate: 1.0
neg_rate: 0.5
max_point_num: 30
edge_distance: 20
neg_area_ratio_threshold: 5
neg_area_threshold: 1000
min_cell_area: 100
foreground_sample_area_ratio: 0.2
background_sample_area_ratio: 0.2
foreground_equal_prob: True
background_equal_prob: True
# data augment
data_augmentation: true
bright_limit: 0.1
contrast_limit: 0.1
bright_prob: 0.5
flip_prob: 0.75
rotate_prob: 0.8
scale_limit: [-0.5, 0.5]
crop_prob: 0.5
crop_scale: [0.3, 1.0]
crop_ratio: [0.75, 1.3333]
# loss
ce_loss_weight: 1.0
punish_background_point: false
# predict
crop_n_layers: 1
crop_n_points_downscale_factor: 1
points_per_side: 32
points_per_batch: 64
max_mask_region_area_ratio: 0.1
min_mask_region_area: 20
box_nms_thresh: 0.05
crop_nms_thresh: 0.05
pred_iou_thresh: 0.8
stability_score_thresh: 0.6
stability_score_offset: 0.8
# log
track_gpu_memory: false