Download configs/d2/diffusiondet/fixed_checkpoint.py from procaffenator/KaryoFlow: direct link, hf CLI and curl.
- Browser
- Download file 29.2 kB
-
https://huggingface.co/procaffenator/KaryoFlow/resolve/main/configs/d2/diffusiondet/fixed_checkpoint.py
- Command line
-
hf download hf://procaffenator/KaryoFlow/configs/d2/diffusiondet/fixed_checkpoint.py
-
curl -L -o fixed_checkpoint.py https://huggingface.co/procaffenator/KaryoFlow/resolve/main/configs/d2/diffusiondet/fixed_checkpoint.py
29.2 kB
METAINFO = dict(
classes=(
'A1',
'A2',
'A3',
'B4',
'B5',
'C6',
'C7',
'C8',
'C9',
'C10',
'C11',
'C12',
'D13',
'D14',
'D15',
'E16',
'E17',
'E18',
'F19',
'F20',
'G21',
'G22',
'X',
'Y',
),
palette=[
(
220,
20,
60,
),
(
119,
11,
32,
),
(
0,
0,
142,
),
(
0,
0,
230,
),
(
106,
0,
228,
),
(
0,
60,
100,
),
(
0,
80,
100,
),
(
0,
0,
70,
),
(
0,
0,
192,
),
(
250,
170,
30,
),
(
100,
170,
30,
),
(
220,
220,
0,
),
(
175,
116,
175,
),
(
250,
0,
30,
),
(
165,
42,
42,
),
(
255,
77,
255,
),
(
0,
226,
252,
),
(
182,
182,
255,
),
(
0,
82,
0,
),
(
120,
166,
157,
),
(
110,
76,
0,
),
(
174,
57,
255,
),
(
199,
100,
0,
),
(
72,
0,
118,
),
])
backend_args = None
batch_size = 4
classes = (
'A1',
'A2',
'A3',
'B4',
'B5',
'C6',
'C7',
'C8',
'C9',
'C10',
'C11',
'C12',
'D13',
'D14',
'D15',
'E16',
'E17',
'E18',
'F19',
'F20',
'G21',
'G22',
'X',
'Y',
)
custom_hooks = [
dict(
min_delta=0.001,
monitor='coco/bbox_mAP',
patience=30,
priority=50,
rule='greater',
type='EarlyStoppingHook'),
]
custom_imports = dict(
allow_failed_imports=False,
imports=[
'experiments.mmdet_bridge.registry',
'experiments.mmdet_bridge.detector',
'experiments.mmdet_bridge.hooks',
])
data_root = 'data/24_chromosomes_object/coco/'
dataset_type = 'CocoDataset'
default_hooks = dict(
checkpoint=dict(
interval=1,
max_keep_ckpts=2,
rule='greater',
save_best='coco/bbox_mAP',
save_last=True,
type='CheckpointHook'),
logger=dict(interval=50, type='LoggerHook'),
param_scheduler=dict(type='ParamSchedulerHook'),
sampler_seed=dict(type='DistSamplerSeedHook'),
timer=dict(type='IterTimerHook'),
visualization=dict(draw=False, type='DetVisualizationHook'))
default_scope = 'mmdet'
env_cfg = dict(
cudnn_benchmark=True,
dist_cfg=dict(backend='nccl'),
mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0))
load_from = None
log_level = 'INFO'
log_processor = dict(by_epoch=True, type='LogProcessor', window_size=50)
max_epochs = 150
model = dict(
backbone=dict(
depth=50,
frozen_stages=1,
init_cfg=dict(checkpoint='torchvision://resnet50', type='Pretrained'),
norm_cfg=dict(requires_grad=True, type='BN'),
norm_eval=True,
num_stages=4,
out_indices=(
0,
1,
2,
3,
),
style='pytorch',
type='ResNet'),
bbox_head=dict(
criterion=dict(
assigner=dict(
candidate_topk=5,
center_radius=2.5,
match_costs=[
dict(type='PurePyTorchFocalLossCost', weight=2.0),
dict(type='PurePyTorchBBoxL1Cost', weight=5.0),
dict(
iou_mode='giou', type='PurePyTorchIoUCost',
weight=2.0),
]),
deep_supervision=True,
loss_bbox=dict(loss_weight=5.0, type='PurePyTorchL1Loss'),
loss_cls=dict(loss_weight=2.0, type='PurePyTorchFocalLoss'),
loss_giou=dict(loss_weight=2.0, type='PurePyTorchGIoULoss'),
num_classes=24),
deep_supervision=True,
diffusion_type='ddpm',
feat_channels=256,
num_classes=24,
num_heads=6,
num_proposals=500,
prior_prob=0.01,
rf_schedule='shifted',
rf_shift=3.0,
roi_extractor=dict(
featmap_strides=[
4,
8,
16,
32,
],
out_channels=256,
roi_layer=dict(output_size=7, sampling_ratio=2, type='RoIAlign')),
sampling_timesteps=1,
single_head=dict(
dim_feedforward=2048,
dropout=0.0,
feat_channels=256,
num_classes=24,
num_cls_convs=1,
num_heads=8,
num_reg_convs=3,
time_conditioning='scale_shift'),
snr_scale=2.0,
solver_type='euler',
use_ensemble=False),
data_preprocessor=dict(
bgr_to_rgb=True,
mean=[
123.675,
116.28,
103.53,
],
pad_size_divisor=32,
std=[
58.395,
57.12,
57.375,
],
type='DetDataPreprocessor'),
neck=dict(
in_channels=[
256,
512,
1024,
2048,
],
num_outs=4,
out_channels=256,
type='FPN'),
type='LDMDet')
num_classes = 24
num_workers = 4
optim_wrapper = dict(
clip_grad=dict(max_norm=1.0, norm_type=2),
optimizer=dict(lr=5e-05, type='AdamW', weight_decay=0.0001))
param_scheduler = [
dict(begin=0, by_epoch=True, end=5, start_factor=0.001, type='LinearLR'),
dict(
T_max=150,
begin=5,
by_epoch=True,
end=150,
eta_min=0,
type='CosineAnnealingLR'),
]
resume = False
test_cfg = dict()
test_dataloader = dict(
batch_size=1,
dataset=dict(
ann_file='test/_annotations.coco.json',
data_prefix=dict(img='test/'),
data_root='data/24_chromosomes_object/coco/',
metainfo=dict(
classes=(
'A1',
'A2',
'A3',
'B4',
'B5',
'C10',
'C11',
'C12',
'C6',
'C7',
'C8',
'C9',
'D13',
'D14',
'D15',
'E16',
'E17',
'E18',
'F19',
'F20',
'G21',
'G22',
'X',
'Y',
),
palette=[
(
220,
20,
60,
),
(
119,
11,
32,
),
(
0,
0,
142,
),
(
0,
0,
230,
),
(
106,
0,
228,
),
(
0,
60,
100,
),
(
0,
80,
100,
),
(
0,
0,
70,
),
(
0,
0,
192,
),
(
250,
170,
30,
),
(
100,
170,
30,
),
(
220,
220,
0,
),
(
175,
116,
175,
),
(
250,
0,
30,
),
(
165,
42,
42,
),
(
255,
77,
255,
),
(
0,
226,
252,
),
(
182,
182,
255,
),
(
0,
82,
0,
),
(
120,
166,
157,
),
(
110,
76,
0,
),
(
174,
57,
255,
),
(
199,
100,
0,
),
(
72,
0,
118,
),
]),
pipeline=[
dict(backend_args=None, type='LoadImageFromFile'),
dict(keep_ratio=True, scale=(
1333,
800,
), type='Resize'),
dict(type='LoadAnnotations', with_bbox=True),
dict(
meta_keys=(
'img_id',
'img_path',
'ori_shape',
'img_shape',
'scale_factor',
),
type='PackDetInputs'),
],
test_mode=True,
type='CocoDataset'),
drop_last=False,
num_workers=2,
persistent_workers=False,
sampler=dict(shuffle=False, type='DefaultSampler'))
test_evaluator = dict(
ann_file='data/24_chromosomes_object/coco/test/_annotations.coco.json',
format_only=False,
metric='bbox',
outfile_prefix=
'outputs/predictions',
proposal_nums=(
1,
10,
100,
),
type='CocoMetric')
test_pipeline = [
dict(backend_args=None, type='LoadImageFromFile'),
dict(keep_ratio=True, scale=(
1333,
800,
), type='Resize'),
dict(type='LoadAnnotations', with_bbox=True),
dict(
meta_keys=(
'img_id',
'img_path',
'ori_shape',
'img_shape',
'scale_factor',
),
type='PackDetInputs'),
]
train_cfg = dict(max_epochs=150, type='EpochBasedTrainLoop')
train_dataloader = dict(
batch_sampler=dict(type='AspectRatioBatchSampler'),
batch_size=4,
dataset=dict(
ann_file='train/_annotations.coco.json',
backend_args=None,
data_prefix=dict(img='train/'),
data_root='data/24_chromosomes_object/coco/',
filter_cfg=dict(filter_empty_gt=True, min_size=32),
metainfo=dict(
classes=(
'A1',
'A2',
'A3',
'B4',
'B5',
'C10',
'C11',
'C12',
'C6',
'C7',
'C8',
'C9',
'D13',
'D14',
'D15',
'E16',
'E17',
'E18',
'F19',
'F20',
'G21',
'G22',
'X',
'Y',
),
palette=[
(
220,
20,
60,
),
(
119,
11,
32,
),
(
0,
0,
142,
),
(
0,
0,
230,
),
(
106,
0,
228,
),
(
0,
60,
100,
),
(
0,
80,
100,
),
(
0,
0,
70,
),
(
0,
0,
192,
),
(
250,
170,
30,
),
(
100,
170,
30,
),
(
220,
220,
0,
),
(
175,
116,
175,
),
(
250,
0,
30,
),
(
165,
42,
42,
),
(
255,
77,
255,
),
(
0,
226,
252,
),
(
182,
182,
255,
),
(
0,
82,
0,
),
(
120,
166,
157,
),
(
110,
76,
0,
),
(
174,
57,
255,
),
(
199,
100,
0,
),
(
72,
0,
118,
),
]),
pipeline=[
dict(backend_args=None, type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True),
dict(prob=0.5, type='RandomFlip'),
dict(
transforms=[
[
dict(
keep_ratio=True,
scales=[
(
480,
1333,
),
(
512,
1333,
),
(
544,
1333,
),
(
576,
1333,
),
(
608,
1333,
),
(
640,
1333,
),
(
672,
1333,
),
(
704,
1333,
),
(
736,
1333,
),
(
768,
1333,
),
(
800,
1333,
),
],
type='RandomChoiceResize'),
],
[
dict(
keep_ratio=True,
scales=[
(
400,
1333,
),
(
500,
1333,
),
(
600,
1333,
),
],
type='RandomChoiceResize'),
dict(
allow_negative_crop=True,
crop_size=(
384,
600,
),
crop_type='absolute_range',
type='RandomCrop'),
dict(
keep_ratio=True,
scales=[
(
480,
1333,
),
(
512,
1333,
),
(
544,
1333,
),
(
576,
1333,
),
(
608,
1333,
),
(
640,
1333,
),
(
672,
1333,
),
(
704,
1333,
),
(
736,
1333,
),
(
768,
1333,
),
(
800,
1333,
),
],
type='RandomChoiceResize'),
],
],
type='RandomChoice'),
dict(type='PackDetInputs'),
],
type='CocoDataset'),
num_workers=4,
persistent_workers=True,
pin_memory=True,
sampler=dict(shuffle=True, type='DefaultSampler'))
train_pipeline = [
dict(backend_args=None, type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True),
dict(prob=0.5, type='RandomFlip'),
dict(
transforms=[
[
dict(
keep_ratio=True,
scales=[
(
480,
1333,
),
(
512,
1333,
),
(
544,
1333,
),
(
576,
1333,
),
(
608,
1333,
),
(
640,
1333,
),
(
672,
1333,
),
(
704,
1333,
),
(
736,
1333,
),
(
768,
1333,
),
(
800,
1333,
),
],
type='RandomChoiceResize'),
],
[
dict(
keep_ratio=True,
scales=[
(
400,
1333,
),
(
500,
1333,
),
(
600,
1333,
),
],
type='RandomChoiceResize'),
dict(
allow_negative_crop=True,
crop_size=(
384,
600,
),
crop_type='absolute_range',
type='RandomCrop'),
dict(
keep_ratio=True,
scales=[
(
480,
1333,
),
(
512,
1333,
),
(
544,
1333,
),
(
576,
1333,
),
(
608,
1333,
),
(
640,
1333,
),
(
672,
1333,
),
(
704,
1333,
),
(
736,
1333,
),
(
768,
1333,
),
(
800,
1333,
),
],
type='RandomChoiceResize'),
],
],
type='RandomChoice'),
dict(type='PackDetInputs'),
]
val_cfg = dict()
val_dataloader = dict(
batch_size=1,
dataset=dict(
ann_file='valid/_annotations.coco.json',
backend_args=None,
data_prefix=dict(img='valid/'),
data_root='data/24_chromosomes_object/coco/',
metainfo=dict(
classes=(
'A1',
'A2',
'A3',
'B4',
'B5',
'C10',
'C11',
'C12',
'C6',
'C7',
'C8',
'C9',
'D13',
'D14',
'D15',
'E16',
'E17',
'E18',
'F19',
'F20',
'G21',
'G22',
'X',
'Y',
),
palette=[
(
220,
20,
60,
),
(
119,
11,
32,
),
(
0,
0,
142,
),
(
0,
0,
230,
),
(
106,
0,
228,
),
(
0,
60,
100,
),
(
0,
80,
100,
),
(
0,
0,
70,
),
(
0,
0,
192,
),
(
250,
170,
30,
),
(
100,
170,
30,
),
(
220,
220,
0,
),
(
175,
116,
175,
),
(
250,
0,
30,
),
(
165,
42,
42,
),
(
255,
77,
255,
),
(
0,
226,
252,
),
(
182,
182,
255,
),
(
0,
82,
0,
),
(
120,
166,
157,
),
(
110,
76,
0,
),
(
174,
57,
255,
),
(
199,
100,
0,
),
(
72,
0,
118,
),
]),
pipeline=[
dict(backend_args=None, type='LoadImageFromFile'),
dict(keep_ratio=True, scale=(
1333,
800,
), type='Resize'),
dict(type='LoadAnnotations', with_bbox=True),
dict(
meta_keys=(
'img_id',
'img_path',
'ori_shape',
'img_shape',
'scale_factor',
),
type='PackDetInputs'),
],
test_mode=True,
type='CocoDataset'),
drop_last=False,
num_workers=2,
persistent_workers=True,
pin_memory=True,
sampler=dict(shuffle=False, type='DefaultSampler'))
val_evaluator = dict(
ann_file='data/24_chromosomes_object/coco/valid/_annotations.coco.json',
backend_args=None,
format_only=False,
metric='bbox',
type='CocoMetric')
vis_backends = [
dict(type='LocalVisBackend'),
]
visualizer = dict(
name='visualizer',
type='DetLocalVisualizer',
vis_backends=[
dict(type='LocalVisBackend'),
])
work_dir = 'outputs/d2/diffusiondet/seed_42'
METAINFO = dict(
classes=(
'A1',
'A2',
'A3',
'B4',
'B5',
'C6',
'C7',
'C8',
'C9',
'C10',
'C11',
'C12',
'D13',
'D14',
'D15',
'E16',
'E17',
'E18',
'F19',
'F20',
'G21',
'G22',
'X',
'Y',
),
palette=[
(
220,
20,
60,
),
(
119,
11,
32,
),
(
0,
0,
142,
),
(
0,
0,
230,
),
(
106,
0,
228,
),
(
0,
60,
100,
),
(
0,
80,
100,
),
(
0,
0,
70,
),
(
0,
0,
192,
),
(
250,
170,
30,
),
(
100,
170,
30,
),
(
220,
220,
0,
),
(
175,
116,
175,
),
(
250,
0,
30,
),
(
165,