Skip to content

Commit 9477519

Browse files
committed
update configs to latest
1 parent 35b7a8f commit 9477519

13 files changed

+557
-460
lines changed
+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
_base_ = ["../fcos/fcos_center-normbbox-centeronreg-giou_r50_caffe_fpn_gn-head_1x_coco.py"]
2+
3+
TAGS = ["fcos", "crop=480_960", "24epochs", "num_cls=60", "repeat=5"]
4+
EXP_NAME = "fcos_crop_480_960_cls_60"
5+
DATA_ROOT = "data/visdrone2019/"
6+
BATCH_MULTIPLIER = 16
7+
LR_MULTIPLIER = 1
8+
EVAL_INTERVAL = 3
9+
NUM_CLASSES = 10
10+
CLASSES = ("pedestrian", "people", "bicycle", "car", "van", "truck", "tricycle", "awning-tricycle", "bus", "motor")
11+
12+
# model settings
13+
model = dict(
14+
bbox_head=dict(
15+
num_classes=NUM_CLASSES,
16+
),
17+
)
18+
19+
# dataset settings
20+
img_norm_cfg = dict(mean=[103.530, 116.280, 123.675], std=[1.0, 1.0, 1.0], to_rgb=False)
21+
train_pipeline = [
22+
dict(type="LoadImageFromFile"),
23+
dict(type="LoadAnnotations", with_bbox=True),
24+
dict(
25+
type="AutoAugment",
26+
policies=[
27+
[
28+
dict(type="RandomCrop", crop_type="absolute_range", crop_size=(480, 960), allow_negative_crop=True),
29+
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
30+
],
31+
[
32+
dict(type="RandomCrop", crop_type="absolute_range", crop_size=(480, 960), allow_negative_crop=True),
33+
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
34+
],
35+
[
36+
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
37+
],
38+
],
39+
),
40+
dict(type="RandomFlip", flip_ratio=0.5),
41+
dict(type="Normalize", **img_norm_cfg),
42+
dict(type="Pad", size_divisor=32),
43+
dict(type="DefaultFormatBundle"),
44+
dict(type="Collect", keys=["img", "gt_bboxes", "gt_labels"]),
45+
]
46+
test_pipeline = [
47+
dict(type="LoadImageFromFile"),
48+
dict(
49+
type="MultiScaleFlipAug",
50+
img_scale=(1333, 800),
51+
flip=False,
52+
transforms=[
53+
dict(type="Resize", keep_ratio=True),
54+
dict(type="RandomFlip"),
55+
dict(type="Normalize", **img_norm_cfg),
56+
dict(type="Pad", size_divisor=32),
57+
dict(type="ImageToTensor", keys=["img"]),
58+
dict(type="Collect", keys=["img"]),
59+
],
60+
),
61+
]
62+
63+
data = dict(
64+
samples_per_gpu=2 * BATCH_MULTIPLIER,
65+
workers_per_gpu=2,
66+
train=dict(
67+
type="RepeatDataset",
68+
times=5,
69+
dataset=dict(
70+
type="CocoDataset",
71+
classes=CLASSES,
72+
ann_file=DATA_ROOT + "coco/train.json",
73+
img_prefix=DATA_ROOT + "VisDrone2019-DET-train/",
74+
pipeline=train_pipeline,
75+
),
76+
),
77+
val=dict(
78+
classes=CLASSES,
79+
ann_file=DATA_ROOT + "sliced/val_640_0.json",
80+
img_prefix=DATA_ROOT + "sliced/val_images_640_0/",
81+
pipeline=test_pipeline,
82+
),
83+
test=dict(
84+
classes=CLASSES,
85+
ann_file=DATA_ROOT + "sliced/val_640_0.json",
86+
img_prefix=DATA_ROOT + "sliced/val_images_640_0/",
87+
pipeline=test_pipeline,
88+
),
89+
)
90+
91+
# optimizer
92+
# default 8 gpu
93+
# /8 for 1 gpu
94+
optimizer = dict(
95+
lr=0.01 / 8 * BATCH_MULTIPLIER * LR_MULTIPLIER, paramwise_cfg=dict(bias_lr_mult=2.0, bias_decay_mult=0.0)
96+
)
97+
98+
checkpoint_config = dict(interval=1, max_keep_ckpts=1, save_optimizer=False)
99+
evaluation = dict(interval=EVAL_INTERVAL, metric="bbox", save_best="auto")
100+
101+
# learning policy
102+
lr_config = dict(policy="step", warmup="constant", warmup_iters=500, warmup_ratio=1.0 / 3, step=[16, 22])
103+
runner = dict(type="EpochBasedRunner", max_epochs=24)
104+
105+
# logger settings
106+
log_config = dict(
107+
interval=50,
108+
hooks=[
109+
dict(type="TextLoggerHook"),
110+
dict(type="TensorboardLoggerHook", reset_flag=False),
111+
],
112+
)
113+
114+
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"
115+
work_dir = f"runs/visdrone/{EXP_NAME}/"
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,26 @@
11
_base_ = ["../fcos/fcos_center-normbbox-centeronreg-giou_r50_caffe_fpn_gn-head_1x_coco.py"]
22

3-
TAGS = ["fcos", "crop=300_9999", "24epochs", "num_cls=60"]
4-
EXP_NAME = "fcos_crop_300_9999_cls_60"
5-
DATA_ROOT = "data/xview/"
3+
TAGS = ["fcos", "crop=False", "24epochs", "num_cls=60", "repeat=5"]
4+
EXP_NAME = "fcos_full_cls_60"
5+
DATA_ROOT = "data/visdrone2019/"
66
BATCH_MULTIPLIER = 16
77
LR_MULTIPLIER = 1
8-
MAX_DET_PER_IMAGE = 100
98
EVAL_INTERVAL = 3
10-
NUM_CLASSES = 60
11-
CLASSES = (
12-
"Fixed-wing Aircraft",
13-
"Small Aircraft",
14-
"Cargo Plane",
15-
"Helicopter",
16-
"Passenger Vehicle",
17-
"Small Car",
18-
"Bus",
19-
"Pickup Truck",
20-
"Utility Truck",
21-
"Truck",
22-
"Cargo Truck",
23-
"Truck w/Box",
24-
"Truck Tractor",
25-
"Trailer",
26-
"Truck w/Flatbed",
27-
"Truck w/Liquid",
28-
"Crane Truck",
29-
"Railway Vehicle",
30-
"Passenger Car",
31-
"Cargo Car",
32-
"Flat Car",
33-
"Tank car",
34-
"Locomotive",
35-
"Maritime Vessel",
36-
"Motorboat",
37-
"Sailboat",
38-
"Tugboat",
39-
"Barge",
40-
"Fishing Vessel",
41-
"Ferry",
42-
"Yacht",
43-
"Container Ship",
44-
"Oil Tanker",
45-
"Engineering Vehicle",
46-
"Tower crane",
47-
"Container Crane",
48-
"Reach Stacker",
49-
"Straddle Carrier",
50-
"Mobile Crane",
51-
"Dump Truck",
52-
"Haul Truck",
53-
"Scraper/Tractor",
54-
"Front loader/Bulldozer",
55-
"Excavator",
56-
"Cement Mixer",
57-
"Ground Grader",
58-
"Hut/Tent",
59-
"Shed",
60-
"Building",
61-
"Aircraft Hangar",
62-
"Damaged Building",
63-
"Facility",
64-
"Construction Site",
65-
"Vehicle Lot",
66-
"Helipad",
67-
"Storage Tank",
68-
"Shipping container lot",
69-
"Shipping Container",
70-
"Pylon",
71-
"Tower",
72-
)
9+
NUM_CLASSES = 10
10+
CLASSES = ("pedestrian", "people", "bicycle", "car", "van", "truck", "tricycle", "awning-tricycle", "bus", "motor")
7311

7412
# model settings
7513
model = dict(
7614
bbox_head=dict(
7715
num_classes=NUM_CLASSES,
7816
),
79-
# testing settings
80-
test_cfg=dict(max_per_img=MAX_DET_PER_IMAGE),
8117
)
8218

8319
# dataset settings
8420
img_norm_cfg = dict(mean=[103.530, 116.280, 123.675], std=[1.0, 1.0, 1.0], to_rgb=False)
8521
train_pipeline = [
8622
dict(type="LoadImageFromFile"),
8723
dict(type="LoadAnnotations", with_bbox=True),
88-
dict(type="RandomCrop", crop_type="absolute_range", crop_size=(300, 9999), allow_negative_crop=True),
8924
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
9025
dict(type="RandomFlip", flip_ratio=0.5),
9126
dict(type="Normalize", **img_norm_cfg),
@@ -115,25 +50,25 @@
11550
workers_per_gpu=2,
11651
train=dict(
11752
type="RepeatDataset",
118-
times=30,
53+
times=5,
11954
dataset=dict(
12055
type="CocoDataset",
12156
classes=CLASSES,
12257
ann_file=DATA_ROOT + "coco/train.json",
123-
img_prefix=DATA_ROOT + "train_images/",
58+
img_prefix=DATA_ROOT + "VisDrone2019-DET-train/",
12459
pipeline=train_pipeline,
12560
),
12661
),
12762
val=dict(
12863
classes=CLASSES,
129-
ann_file=DATA_ROOT + "sliced/val_400_0.json",
130-
img_prefix=DATA_ROOT + "sliced/val_images_400_0/",
64+
ann_file=DATA_ROOT + "sliced/val_640_0.json",
65+
img_prefix=DATA_ROOT + "sliced/val_images_640_0/",
13166
pipeline=test_pipeline,
13267
),
13368
test=dict(
13469
classes=CLASSES,
135-
ann_file=DATA_ROOT + "sliced/val_400_0.json",
136-
img_prefix=DATA_ROOT + "sliced/val_images_400_0/",
70+
ann_file=DATA_ROOT + "sliced/val_640_0.json",
71+
img_prefix=DATA_ROOT + "sliced/val_images_640_0/",
13772
pipeline=test_pipeline,
13873
),
13974
)
@@ -158,19 +93,8 @@
15893
hooks=[
15994
dict(type="TextLoggerHook"),
16095
dict(type="TensorboardLoggerHook", reset_flag=False),
161-
dict(
162-
type="WandbLoggerHook",
163-
init_kwargs=dict(
164-
project="xview",
165-
entity="fca",
166-
name=EXP_NAME,
167-
tags=TAGS,
168-
),
169-
log_artifact=True,
170-
out_suffix=(".py"),
171-
),
17296
],
17397
)
17498

17599
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"
176-
work_dir = f"runs/xview/{EXP_NAME}/"
100+
work_dir = f"runs/visdrone/{EXP_NAME}/"
+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
_base_ = ["../tood/tood_r50_fpn_1x_coco.py"]
2+
3+
TAGS = ["tood", "crop=480_960", "24epochs", "num_cls=60", "repeat=5"]
4+
EXP_NAME = "tood_crop_480_960_cls_60"
5+
DATA_ROOT = "data/visdrone2019/"
6+
BATCH_MULTIPLIER = 8
7+
LR_MULTIPLIER = 1
8+
EVAL_INTERVAL = 3
9+
NUM_CLASSES = 10
10+
CLASSES = ("pedestrian", "people", "bicycle", "car", "van", "truck", "tricycle", "awning-tricycle", "bus", "motor")
11+
12+
# model settings
13+
model = dict(
14+
bbox_head=dict(
15+
num_classes=NUM_CLASSES,
16+
),
17+
)
18+
19+
# dataset settings
20+
img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
21+
train_pipeline = [
22+
dict(type="LoadImageFromFile"),
23+
dict(type="LoadAnnotations", with_bbox=True),
24+
dict(
25+
type="AutoAugment",
26+
policies=[
27+
[
28+
dict(type="RandomCrop", crop_type="absolute_range", crop_size=(480, 960), allow_negative_crop=True),
29+
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
30+
],
31+
[
32+
dict(type="RandomCrop", crop_type="absolute_range", crop_size=(480, 960), allow_negative_crop=True),
33+
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
34+
],
35+
[
36+
dict(type="Resize", img_scale=(1333, 800), keep_ratio=True),
37+
],
38+
],
39+
),
40+
dict(type="RandomFlip", flip_ratio=0.5),
41+
dict(type="Normalize", **img_norm_cfg),
42+
dict(type="Pad", size_divisor=32),
43+
dict(type="DefaultFormatBundle"),
44+
dict(type="Collect", keys=["img", "gt_bboxes", "gt_labels"]),
45+
]
46+
test_pipeline = [
47+
dict(type="LoadImageFromFile"),
48+
dict(
49+
type="MultiScaleFlipAug",
50+
img_scale=(1333, 800),
51+
flip=False,
52+
transforms=[
53+
dict(type="Resize", keep_ratio=True),
54+
dict(type="RandomFlip"),
55+
dict(type="Normalize", **img_norm_cfg),
56+
dict(type="Pad", size_divisor=32),
57+
dict(type="ImageToTensor", keys=["img"]),
58+
dict(type="Collect", keys=["img"]),
59+
],
60+
),
61+
]
62+
63+
data = dict(
64+
samples_per_gpu=2 * BATCH_MULTIPLIER,
65+
workers_per_gpu=2,
66+
train=dict(
67+
type="RepeatDataset",
68+
times=5,
69+
dataset=dict(
70+
type="CocoDataset",
71+
classes=CLASSES,
72+
ann_file=DATA_ROOT + "coco/train.json",
73+
img_prefix=DATA_ROOT + "VisDrone2019-DET-train/",
74+
pipeline=train_pipeline,
75+
),
76+
),
77+
val=dict(
78+
classes=CLASSES,
79+
ann_file=DATA_ROOT + "sliced/val_640_0.json",
80+
img_prefix=DATA_ROOT + "sliced/val_images_640_0/",
81+
pipeline=test_pipeline,
82+
),
83+
test=dict(
84+
classes=CLASSES,
85+
ann_file=DATA_ROOT + "sliced/val_640_0.json",
86+
img_prefix=DATA_ROOT + "sliced/val_images_640_0/",
87+
pipeline=test_pipeline,
88+
),
89+
)
90+
91+
# optimizer
92+
# default 8 gpu
93+
# /8 for 1 gpu
94+
optimizer = dict(lr=0.01 / 8 * BATCH_MULTIPLIER * LR_MULTIPLIER, momentum=0.9, weight_decay=0.0001)
95+
96+
checkpoint_config = dict(interval=1, max_keep_ckpts=1, save_optimizer=False)
97+
evaluation = dict(interval=EVAL_INTERVAL, metric="bbox", save_best="auto")
98+
99+
# learning policy
100+
lr_config = dict(policy="step", warmup="linear", warmup_iters=500, warmup_ratio=0.001, step=[16, 22])
101+
runner = dict(type="EpochBasedRunner", max_epochs=24)
102+
103+
# logger settings
104+
log_config = dict(
105+
interval=50,
106+
hooks=[
107+
dict(type="TextLoggerHook"),
108+
dict(type="TensorboardLoggerHook", reset_flag=False),
109+
],
110+
)
111+
112+
load_from = "https://download.openmmlab.com/mmdetection/v2.0/tood/tood_r50_fpn_1x_coco/tood_r50_fpn_1x_coco_20211210_103425-20e20746.pth"
113+
work_dir = f"runs/visdrone/{EXP_NAME}/"

0 commit comments

Comments
 (0)