Skip to content

Commit

Permalink
update configs to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
fcakyon committed Mar 19, 2022
1 parent 35b7a8f commit 9477519
Show file tree
Hide file tree
Showing 13 changed files with 557 additions and 460 deletions.
115 changes: 115 additions & 0 deletions mmdet_configs/visdrone_fcos/fcos_crop_480_960_cls_60.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
_base_ = ["../fcos/fcos_center-normbbox-centeronreg-giou_r50_caffe_fpn_gn-head_1x_coco.py"]

TAGS = ["fcos", "crop=480_960", "24epochs", "num_cls=60", "repeat=5"]
EXP_NAME = "fcos_crop_480_960_cls_60"
DATA_ROOT = "data/visdrone2019/"
BATCH_MULTIPLIER = 16
LR_MULTIPLIER = 1
EVAL_INTERVAL = 3
NUM_CLASSES = 10
CLASSES = ("pedestrian", "people", "bicycle", "car", "van", "truck", "tricycle", "awning-tricycle", "bus", "motor")

# model settings
model = dict(
bbox_head=dict(
num_classes=NUM_CLASSES,
),
)

# dataset settings
img_norm_cfg = dict(mean=[103.530, 116.280, 123.675], std=[1.0, 1.0, 1.0], to_rgb=False)
train_pipeline = [
dict(type="LoadImageFromFile"),
dict(type="LoadAnnotations", with_bbox=True),
dict(
type="AutoAugment",
policies=[
[
dict(type="RandomCrop", crop_type="absolute_range", crop_size=(480, 960), allow_negative_crop=True),
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
],
[
dict(type="RandomCrop", crop_type="absolute_range", crop_size=(480, 960), allow_negative_crop=True),
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
],
[
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
],
],
),
dict(type="RandomFlip", flip_ratio=0.5),
dict(type="Normalize", **img_norm_cfg),
dict(type="Pad", size_divisor=32),
dict(type="DefaultFormatBundle"),
dict(type="Collect", keys=["img", "gt_bboxes", "gt_labels"]),
]
test_pipeline = [
dict(type="LoadImageFromFile"),
dict(
type="MultiScaleFlipAug",
img_scale=(1333, 800),
flip=False,
transforms=[
dict(type="Resize", keep_ratio=True),
dict(type="RandomFlip"),
dict(type="Normalize", **img_norm_cfg),
dict(type="Pad", size_divisor=32),
dict(type="ImageToTensor", keys=["img"]),
dict(type="Collect", keys=["img"]),
],
),
]

data = dict(
samples_per_gpu=2 * BATCH_MULTIPLIER,
workers_per_gpu=2,
train=dict(
type="RepeatDataset",
times=5,
dataset=dict(
type="CocoDataset",
classes=CLASSES,
ann_file=DATA_ROOT + "coco/train.json",
img_prefix=DATA_ROOT + "VisDrone2019-DET-train/",
pipeline=train_pipeline,
),
),
val=dict(
classes=CLASSES,
ann_file=DATA_ROOT + "sliced/val_640_0.json",
img_prefix=DATA_ROOT + "sliced/val_images_640_0/",
pipeline=test_pipeline,
),
test=dict(
classes=CLASSES,
ann_file=DATA_ROOT + "sliced/val_640_0.json",
img_prefix=DATA_ROOT + "sliced/val_images_640_0/",
pipeline=test_pipeline,
),
)

# optimizer
# default 8 gpu
# /8 for 1 gpu
optimizer = dict(
lr=0.01 / 8 * BATCH_MULTIPLIER * LR_MULTIPLIER, paramwise_cfg=dict(bias_lr_mult=2.0, bias_decay_mult=0.0)
)

checkpoint_config = dict(interval=1, max_keep_ckpts=1, save_optimizer=False)
evaluation = dict(interval=EVAL_INTERVAL, metric="bbox", save_best="auto")

# learning policy
lr_config = dict(policy="step", warmup="constant", warmup_iters=500, warmup_ratio=1.0 / 3, step=[16, 22])
runner = dict(type="EpochBasedRunner", max_epochs=24)

# logger settings
log_config = dict(
interval=50,
hooks=[
dict(type="TextLoggerHook"),
dict(type="TensorboardLoggerHook", reset_flag=False),
],
)

load_from = "https://download.openmmlab.com/mmdetection/v2.0/fcos/fcos_center-normbbox-centeronreg-giou_r50_caffe_fpn_gn-head_1x_coco/fcos_center-normbbox-centeronreg-giou_r50_caffe_fpn_gn-head_1x_coco-0a0d75a8.pth"
work_dir = f"runs/visdrone/{EXP_NAME}/"
Original file line number Diff line number Diff line change
@@ -1,91 +1,26 @@
_base_ = ["../fcos/fcos_center-normbbox-centeronreg-giou_r50_caffe_fpn_gn-head_1x_coco.py"]

TAGS = ["fcos", "crop=300_9999", "24epochs", "num_cls=60"]
EXP_NAME = "fcos_crop_300_9999_cls_60"
DATA_ROOT = "data/xview/"
TAGS = ["fcos", "crop=False", "24epochs", "num_cls=60", "repeat=5"]
EXP_NAME = "fcos_full_cls_60"
DATA_ROOT = "data/visdrone2019/"
BATCH_MULTIPLIER = 16
LR_MULTIPLIER = 1
MAX_DET_PER_IMAGE = 100
EVAL_INTERVAL = 3
NUM_CLASSES = 60
CLASSES = (
"Fixed-wing Aircraft",
"Small Aircraft",
"Cargo Plane",
"Helicopter",
"Passenger Vehicle",
"Small Car",
"Bus",
"Pickup Truck",
"Utility Truck",
"Truck",
"Cargo Truck",
"Truck w/Box",
"Truck Tractor",
"Trailer",
"Truck w/Flatbed",
"Truck w/Liquid",
"Crane Truck",
"Railway Vehicle",
"Passenger Car",
"Cargo Car",
"Flat Car",
"Tank car",
"Locomotive",
"Maritime Vessel",
"Motorboat",
"Sailboat",
"Tugboat",
"Barge",
"Fishing Vessel",
"Ferry",
"Yacht",
"Container Ship",
"Oil Tanker",
"Engineering Vehicle",
"Tower crane",
"Container Crane",
"Reach Stacker",
"Straddle Carrier",
"Mobile Crane",
"Dump Truck",
"Haul Truck",
"Scraper/Tractor",
"Front loader/Bulldozer",
"Excavator",
"Cement Mixer",
"Ground Grader",
"Hut/Tent",
"Shed",
"Building",
"Aircraft Hangar",
"Damaged Building",
"Facility",
"Construction Site",
"Vehicle Lot",
"Helipad",
"Storage Tank",
"Shipping container lot",
"Shipping Container",
"Pylon",
"Tower",
)
NUM_CLASSES = 10
CLASSES = ("pedestrian", "people", "bicycle", "car", "van", "truck", "tricycle", "awning-tricycle", "bus", "motor")

# model settings
model = dict(
bbox_head=dict(
num_classes=NUM_CLASSES,
),
# testing settings
test_cfg=dict(max_per_img=MAX_DET_PER_IMAGE),
)

# dataset settings
img_norm_cfg = dict(mean=[103.530, 116.280, 123.675], std=[1.0, 1.0, 1.0], to_rgb=False)
train_pipeline = [
dict(type="LoadImageFromFile"),
dict(type="LoadAnnotations", with_bbox=True),
dict(type="RandomCrop", crop_type="absolute_range", crop_size=(300, 9999), allow_negative_crop=True),
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
dict(type="RandomFlip", flip_ratio=0.5),
dict(type="Normalize", **img_norm_cfg),
Expand Down Expand Up @@ -115,25 +50,25 @@
workers_per_gpu=2,
train=dict(
type="RepeatDataset",
times=30,
times=5,
dataset=dict(
type="CocoDataset",
classes=CLASSES,
ann_file=DATA_ROOT + "coco/train.json",
img_prefix=DATA_ROOT + "train_images/",
img_prefix=DATA_ROOT + "VisDrone2019-DET-train/",
pipeline=train_pipeline,
),
),
val=dict(
classes=CLASSES,
ann_file=DATA_ROOT + "sliced/val_400_0.json",
img_prefix=DATA_ROOT + "sliced/val_images_400_0/",
ann_file=DATA_ROOT + "sliced/val_640_0.json",
img_prefix=DATA_ROOT + "sliced/val_images_640_0/",
pipeline=test_pipeline,
),
test=dict(
classes=CLASSES,
ann_file=DATA_ROOT + "sliced/val_400_0.json",
img_prefix=DATA_ROOT + "sliced/val_images_400_0/",
ann_file=DATA_ROOT + "sliced/val_640_0.json",
img_prefix=DATA_ROOT + "sliced/val_images_640_0/",
pipeline=test_pipeline,
),
)
Expand All @@ -158,19 +93,8 @@
hooks=[
dict(type="TextLoggerHook"),
dict(type="TensorboardLoggerHook", reset_flag=False),
dict(
type="WandbLoggerHook",
init_kwargs=dict(
project="xview",
entity="fca",
name=EXP_NAME,
tags=TAGS,
),
log_artifact=True,
out_suffix=(".py"),
),
],
)

load_from = "https://download.openmmlab.com/mmdetection/v2.0/fcos/fcos_center-normbbox-centeronreg-giou_r50_caffe_fpn_gn-head_1x_coco/fcos_center-normbbox-centeronreg-giou_r50_caffe_fpn_gn-head_1x_coco-0a0d75a8.pth"
work_dir = f"runs/xview/{EXP_NAME}/"
work_dir = f"runs/visdrone/{EXP_NAME}/"
113 changes: 113 additions & 0 deletions mmdet_configs/visdrone_tood/tood_crop_480_960_cls_60.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
_base_ = ["../tood/tood_r50_fpn_1x_coco.py"]

TAGS = ["tood", "crop=480_960", "24epochs", "num_cls=60", "repeat=5"]
EXP_NAME = "tood_crop_480_960_cls_60"
DATA_ROOT = "data/visdrone2019/"
BATCH_MULTIPLIER = 8
LR_MULTIPLIER = 1
EVAL_INTERVAL = 3
NUM_CLASSES = 10
CLASSES = ("pedestrian", "people", "bicycle", "car", "van", "truck", "tricycle", "awning-tricycle", "bus", "motor")

# model settings
model = dict(
bbox_head=dict(
num_classes=NUM_CLASSES,
),
)

# dataset settings
img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type="LoadImageFromFile"),
dict(type="LoadAnnotations", with_bbox=True),
dict(
type="AutoAugment",
policies=[
[
dict(type="RandomCrop", crop_type="absolute_range", crop_size=(480, 960), allow_negative_crop=True),
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
],
[
dict(type="RandomCrop", crop_type="absolute_range", crop_size=(480, 960), allow_negative_crop=True),
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
],
[
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
],
],
),
dict(type="RandomFlip", flip_ratio=0.5),
dict(type="Normalize", **img_norm_cfg),
dict(type="Pad", size_divisor=32),
dict(type="DefaultFormatBundle"),
dict(type="Collect", keys=["img", "gt_bboxes", "gt_labels"]),
]
test_pipeline = [
dict(type="LoadImageFromFile"),
dict(
type="MultiScaleFlipAug",
img_scale=(1333, 800),
flip=False,
transforms=[
dict(type="Resize", keep_ratio=True),
dict(type="RandomFlip"),
dict(type="Normalize", **img_norm_cfg),
dict(type="Pad", size_divisor=32),
dict(type="ImageToTensor", keys=["img"]),
dict(type="Collect", keys=["img"]),
],
),
]

data = dict(
samples_per_gpu=2 * BATCH_MULTIPLIER,
workers_per_gpu=2,
train=dict(
type="RepeatDataset",
times=5,
dataset=dict(
type="CocoDataset",
classes=CLASSES,
ann_file=DATA_ROOT + "coco/train.json",
img_prefix=DATA_ROOT + "VisDrone2019-DET-train/",
pipeline=train_pipeline,
),
),
val=dict(
classes=CLASSES,
ann_file=DATA_ROOT + "sliced/val_640_0.json",
img_prefix=DATA_ROOT + "sliced/val_images_640_0/",
pipeline=test_pipeline,
),
test=dict(
classes=CLASSES,
ann_file=DATA_ROOT + "sliced/val_640_0.json",
img_prefix=DATA_ROOT + "sliced/val_images_640_0/",
pipeline=test_pipeline,
),
)

# optimizer
# default 8 gpu
# /8 for 1 gpu
optimizer = dict(lr=0.01 / 8 * BATCH_MULTIPLIER * LR_MULTIPLIER, momentum=0.9, weight_decay=0.0001)

checkpoint_config = dict(interval=1, max_keep_ckpts=1, save_optimizer=False)
evaluation = dict(interval=EVAL_INTERVAL, metric="bbox", save_best="auto")

# learning policy
lr_config = dict(policy="step", warmup="linear", warmup_iters=500, warmup_ratio=0.001, step=[16, 22])
runner = dict(type="EpochBasedRunner", max_epochs=24)

# logger settings
log_config = dict(
interval=50,
hooks=[
dict(type="TextLoggerHook"),
dict(type="TensorboardLoggerHook", reset_flag=False),
],
)

load_from = "https://download.openmmlab.com/mmdetection/v2.0/tood/tood_r50_fpn_1x_coco/tood_r50_fpn_1x_coco_20211210_103425-20e20746.pth"
work_dir = f"runs/visdrone/{EXP_NAME}/"
Loading

0 comments on commit 9477519

Please sign in to comment.