Skip to content

Commit

Permalink
add missing tile recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene123tw committed Sep 9, 2024
1 parent d43226e commit 75cc598
Show file tree
Hide file tree
Showing 5 changed files with 525 additions and 0 deletions.
55 changes: 55 additions & 0 deletions src/otx/recipe/detection/atss_resnext101_tile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
model:
class_path: otx.algo.detection.atss.ResNeXt101ATSS
init_args:
label_info: 80

optimizer:
class_path: torch.optim.SGD
init_args:
lr: 0.004
momentum: 0.9
weight_decay: 0.0001

scheduler:
class_path: otx.core.schedulers.LinearWarmupSchedulerCallable
init_args:
num_warmup_steps: 3
main_scheduler_callable:
class_path: lightning.pytorch.cli.ReduceLROnPlateau
init_args:
mode: max
factor: 0.1
patience: 4
monitor: val/map_50

engine:
task: DETECTION
device: auto

callback_monitor: val/map_50

data: ../_base_/data/detection.yaml
overrides:
gradient_clip_val: 35.0
callbacks:
- class_path: otx.algo.callbacks.adaptive_train_scheduling.AdaptiveTrainScheduling
init_args:
max_interval: 5
decay: -0.025
min_lrschedule_patience: 3

data:
tile_config:
enable_tiler: true
enable_adaptive_tiling: true

train_subset:
batch_size: 4
sampler:
class_path: otx.algo.samplers.balanced_sampler.BalancedSampler

val_subset:
batch_size: 4

test_subset:
batch_size: 4
114 changes: 114 additions & 0 deletions src/otx/recipe/detection/rtdetr_101_tile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
model:
class_path: otx.algo.detection.rtdetr.RTDETR101
init_args:
label_info: 80

optimizer:
class_path: torch.optim.AdamW
init_args:
lr: 0.0001
betas: [0.9, 0.999]
weight_decay: 0.0001

scheduler:
class_path: otx.core.schedulers.LinearWarmupSchedulerCallable
init_args:
num_warmup_steps: 5
main_scheduler_callable:
class_path: lightning.pytorch.cli.ReduceLROnPlateau
init_args:
mode: max
factor: 0.1
patience: 6
monitor: val/map_50

engine:
task: DETECTION
device: auto

callback_monitor: val/map_50

data: ../_base_/data/torchvision_base.yaml
overrides:
callbacks:
- class_path: otx.algo.callbacks.adaptive_train_scheduling.AdaptiveTrainScheduling
init_args:
max_interval: 1
decay: -0.025
min_lrschedule_patience: 3
- class_path: otx.algo.callbacks.adaptive_early_stopping.EarlyStoppingWithWarmup
init_args:
monitor: null
mode: max
patience: 10
check_on_train_epoch_end: false
min_delta: 0.001
warmup_iters: 100
warmup_epochs: 7

data:
tile_config:
enable_tiler: true
enable_adaptive_tiling: true
input_size:
- 640
- 640
task: DETECTION
stack_images: true
data_format: coco_instances
train_subset:
batch_size: 4
to_tv_image: true
transforms:
- class_path: torchvision.transforms.v2.RandomPhotometricDistort
init_args:
p: 0.5
- class_path: torchvision.transforms.v2.RandomZoomOut
init_args:
fill: 0
- class_path: otx.core.data.transform_libs.torchvision.RandomFlip
init_args:
prob: 0.5
- class_path: otx.core.data.transform_libs.torchvision.Resize
init_args:
scale: $(input_size)
keep_ratio: false
transform_bbox: true
is_numpy_to_tvtensor: true
- class_path: torchvision.transforms.v2.ToDtype
init_args:
dtype: ${as_torch_dtype:torch.float32}
scale: true
- class_path: torchvision.transforms.v2.SanitizeBoundingBoxes
sampler:
class_path: otx.algo.samplers.balanced_sampler.BalancedSampler

val_subset:
batch_size: 8
to_tv_image: true
transforms:
- class_path: otx.core.data.transform_libs.torchvision.Resize
init_args:
scale: $(input_size)
keep_ratio: false
transform_bbox: true
is_numpy_to_tvtensor: true
- class_path: torchvision.transforms.v2.ToDtype
init_args:
dtype: ${as_torch_dtype:torch.float32}
scale: true

test_subset:
batch_size: 8
to_tv_image: true
transforms:
- class_path: otx.core.data.transform_libs.torchvision.Resize
init_args:
scale: $(input_size)
keep_ratio: false
transform_bbox: true
is_numpy_to_tvtensor: true
- class_path: torchvision.transforms.v2.ToDtype
init_args:
dtype: ${as_torch_dtype:torch.float32}
scale: true
113 changes: 113 additions & 0 deletions src/otx/recipe/detection/rtdetr_18_tile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
model:
class_path: otx.algo.detection.rtdetr.RTDETR18
init_args:
label_info: 80

optimizer:
class_path: torch.optim.AdamW
init_args:
lr: 0.0001
betas: [0.9, 0.999]
weight_decay: 0.0001

scheduler:
class_path: otx.core.schedulers.LinearWarmupSchedulerCallable
init_args:
num_warmup_steps: 5
main_scheduler_callable:
class_path: lightning.pytorch.cli.ReduceLROnPlateau
init_args:
mode: max
factor: 0.1
patience: 6
monitor: val/map_50
engine:
task: DETECTION
device: auto

callback_monitor: val/map_50

data: ../_base_/data/torchvision_base.yaml
overrides:
callbacks:
- class_path: otx.algo.callbacks.adaptive_train_scheduling.AdaptiveTrainScheduling
init_args:
max_interval: 1
decay: -0.025
min_lrschedule_patience: 3
- class_path: otx.algo.callbacks.adaptive_early_stopping.EarlyStoppingWithWarmup
init_args:
monitor: null
mode: max
patience: 10
check_on_train_epoch_end: false
min_delta: 0.001
warmup_iters: 100
warmup_epochs: 7

data:
tile_config:
enable_tiler: true
enable_adaptive_tiling: true
input_size:
- 640
- 640
task: DETECTION
stack_images: true
data_format: coco_instances
train_subset:
batch_size: 4
to_tv_image: true
transforms:
- class_path: torchvision.transforms.v2.RandomPhotometricDistort
init_args:
p: 0.5
- class_path: torchvision.transforms.v2.RandomZoomOut
init_args:
fill: 0
- class_path: otx.core.data.transform_libs.torchvision.RandomFlip
init_args:
prob: 0.5
- class_path: otx.core.data.transform_libs.torchvision.Resize
init_args:
scale: $(input_size)
keep_ratio: false
transform_bbox: true
is_numpy_to_tvtensor: true
- class_path: torchvision.transforms.v2.ToDtype
init_args:
dtype: ${as_torch_dtype:torch.float32}
scale: true
- class_path: torchvision.transforms.v2.SanitizeBoundingBoxes
sampler:
class_path: otx.algo.samplers.balanced_sampler.BalancedSampler

val_subset:
batch_size: 8
to_tv_image: true
transforms:
- class_path: otx.core.data.transform_libs.torchvision.Resize
init_args:
scale: $(input_size)
keep_ratio: false
transform_bbox: true
is_numpy_to_tvtensor: true
- class_path: torchvision.transforms.v2.ToDtype
init_args:
dtype: ${as_torch_dtype:torch.float32}
scale: true

test_subset:
batch_size: 8
to_tv_image: true
transforms:
- class_path: otx.core.data.transform_libs.torchvision.Resize
init_args:
scale: $(input_size)
keep_ratio: false
transform_bbox: true
is_numpy_to_tvtensor: true
- class_path: torchvision.transforms.v2.ToDtype
init_args:
dtype: ${as_torch_dtype:torch.float32}
scale: true
114 changes: 114 additions & 0 deletions src/otx/recipe/detection/rtdetr_50_tile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
model:
class_path: otx.algo.detection.rtdetr.RTDETR50
init_args:
label_info: 80

optimizer:
class_path: torch.optim.AdamW
init_args:
lr: 0.0001
betas: [0.9, 0.999]
weight_decay: 0.0001

scheduler:
class_path: otx.core.schedulers.LinearWarmupSchedulerCallable
init_args:
num_warmup_steps: 5
main_scheduler_callable:
class_path: lightning.pytorch.cli.ReduceLROnPlateau
init_args:
mode: max
factor: 0.1
patience: 6
monitor: val/map_50

engine:
task: DETECTION
device: auto

callback_monitor: val/map_50

data: ../_base_/data/torchvision_base.yaml
overrides:
callbacks:
- class_path: otx.algo.callbacks.adaptive_train_scheduling.AdaptiveTrainScheduling
init_args:
max_interval: 1
decay: -0.025
min_lrschedule_patience: 3
- class_path: otx.algo.callbacks.adaptive_early_stopping.EarlyStoppingWithWarmup
init_args:
monitor: null
mode: max
patience: 10
check_on_train_epoch_end: false
min_delta: 0.001
warmup_iters: 100
warmup_epochs: 7

data:
tile_config:
enable_tiler: true
enable_adaptive_tiling: true
input_size:
- 640
- 640
task: DETECTION
stack_images: true
data_format: coco_instances
train_subset:
batch_size: 4
to_tv_image: true
transforms:
- class_path: torchvision.transforms.v2.RandomPhotometricDistort
init_args:
p: 0.5
- class_path: torchvision.transforms.v2.RandomZoomOut
init_args:
fill: 0
- class_path: otx.core.data.transform_libs.torchvision.RandomFlip
init_args:
prob: 0.5
- class_path: otx.core.data.transform_libs.torchvision.Resize
init_args:
scale: $(input_size)
keep_ratio: false
transform_bbox: true
is_numpy_to_tvtensor: true
- class_path: torchvision.transforms.v2.ToDtype
init_args:
dtype: ${as_torch_dtype:torch.float32}
scale: true
- class_path: torchvision.transforms.v2.SanitizeBoundingBoxes
sampler:
class_path: otx.algo.samplers.balanced_sampler.BalancedSampler

val_subset:
batch_size: 8
to_tv_image: true
transforms:
- class_path: otx.core.data.transform_libs.torchvision.Resize
init_args:
scale: $(input_size)
keep_ratio: false
transform_bbox: true
is_numpy_to_tvtensor: true
- class_path: torchvision.transforms.v2.ToDtype
init_args:
dtype: ${as_torch_dtype:torch.float32}
scale: true

test_subset:
batch_size: 8
to_tv_image: true
transforms:
- class_path: otx.core.data.transform_libs.torchvision.Resize
init_args:
scale: $(input_size)
keep_ratio: false
transform_bbox: true
is_numpy_to_tvtensor: true
- class_path: torchvision.transforms.v2.ToDtype
init_args:
dtype: ${as_torch_dtype:torch.float32}
scale: true
Loading

0 comments on commit 75cc598

Please sign in to comment.