forked from boostcampaitech6/level2-objectdetection-cv-08
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase_config.py
97 lines (89 loc) · 2.25 KB
/
base_config.py
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
88
89
90
91
92
93
94
95
96
97
# The new config inherits a base config to highlight the necessary modification
_base_ = ""
# We also need to change the num_classes in head to match the dataset's annotation
model = dict(
data_preprocessor=dict(
mean=[123.65, 117.40, 110.07],
std=[54.01, 53.36, 54.77],
),
)
vis_backends = [dict(type="LocalVisBackend")]
visualizer = dict(
type="DetLocalVisualizer", vis_backends=vis_backends, name="visualizer"
)
default_hooks = dict(
visualization=dict(type="DetVisualizationHook", draw=True, interval=20)
)
custom_hooks = [
# test_out_dir : 저장할 폴더 이름
# mode : val일 경우 train, test일 경우 test
# out_file : 저장할 csv파일 이름
dict(type="SubmissionHook", test_out_dir="submit", mode="test", out_file="submission"),
dict(type="MetricHook"),
]
# Modify dataset related settings
data_root = "data/recycle/"
metainfo = {
"classes": (
"General trash",
"Paper",
"Paper pack",
"Metal",
"Glass",
"Plastic",
"Styrofoam",
"Plastic bag",
"Battery",
"Clothing",
),
"palette": [
(220, 20, 60),
(119, 11, 32),
(0, 0, 230),
(106, 0, 228),
(60, 20, 220),
(0, 80, 100),
(0, 0, 70),
(50, 0, 192),
(250, 170, 30),
(255, 0, 0),
],
}
train_dataloader = dict(
batch_size=8,
num_workers=4,
dataset=dict(
data_root=data_root,
metainfo=metainfo,
ann_file="train_eye_eda.json",
data_prefix=dict(img=""),
),
)
val_dataloader = dict(
dataset=dict(
data_root=data_root,
metainfo=metainfo,
ann_file="val_eye_eda.json",
data_prefix=dict(img=""),
)
)
test_dataloader = dict(
dataset=dict(
data_root=data_root,
metainfo=metainfo,
ann_file="test.json",
data_prefix=dict(img=""),
)
)
# Modify metric related settings
val_evaluator = dict(
type="CocoMetric",
ann_file=data_root + "val_eye_eda.json",
metric="bbox",
format_only=False,
classwise=True,
)
test_evaluator = dict(ann_file=data_root + "test.json")
randomness = dict(seed=49)
# We can use the pre-trained Mask RCNN model to obtain higher performance
load_from = ""