-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpipeline.config
219 lines (201 loc) · 5.08 KB
/
pipeline.config
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# CenterNet meta-architecture from the "Objects as Points" [2] paper with the
# hourglass[1] backbone. This config achieves an mAP of 41.92 +/- 0.16 on
# COCO 17 (averaged over 5 runs). This config is TPU compatible.
# [1]: https://arxiv.org/abs/1603.06937
# [2]: https://arxiv.org/abs/1904.07850
model {
center_net {
num_classes: 1 # total number of class
feature_extractor {
type: "hourglass_104"
bgr_ordering: true
channel_means: [104.01362025, 114.03422265, 119.9165958 ]
channel_stds: [73.6027665 , 69.89082075, 70.9150767 ]
}
image_resizer {
keep_aspect_ratio_resizer {
min_dimension: 512
max_dimension: 512
pad_to_max_dimension: true
}
}
object_detection_task {
task_loss_weight: 1.0
offset_loss_weight: 1.0
scale_loss_weight: 0.1
localization_loss {
l1_localization_loss {
}
}
}
object_center_params {
object_center_loss_weight: 1.0
min_box_overlap_iou: 0.7
max_box_predictions: 100
classification_loss {
penalty_reduced_logistic_focal_loss {
alpha: 2.0
beta: 4.0
}
}
}
keypoint_label_map_path: "dataset/label_map.pbtxt" #path to label_map.pbtxt
keypoint_estimation_task {
task_name: "plier_keypoint_detection" #task_name of choice
task_loss_weight: 1.0
loss {
localization_loss {
l1_localization_loss {
}
}
classification_loss {
penalty_reduced_logistic_focal_loss {
alpha: 2.0
beta: 4.0
}
}
}
keypoint_class_name: "Plier" # Class name of Catergory 1, match with label_map
keypoint_regression_loss_weight: 0.1
keypoint_heatmap_loss_weight: 1.0
keypoint_offset_loss_weight: 1.0
offset_peak_radius: 3
per_keypoint_offset: true
}
}
}
train_config: {
batch_size: 8
num_steps: 20000
data_augmentation_options {
random_horizontal_flip {
keypoint_flip_permutation: 0
keypoint_flip_permutation: 2
keypoint_flip_permutation: 1
keypoint_flip_permutation: 4
keypoint_flip_permutation: 3
}
}
data_augmentation_options {
random_crop_image {
min_aspect_ratio: 0.5
max_aspect_ratio: 1.7
random_coef: 0.25
}
}
data_augmentation_options {
random_adjust_hue {
}
}
data_augmentation_options {
random_adjust_contrast {
}
}
data_augmentation_options {
random_adjust_saturation {
}
}
data_augmentation_options {
random_adjust_brightness {
}
}
data_augmentation_options {
random_absolute_pad_image {
max_height_padding: 200
max_width_padding: 200
pad_color: [0, 0, 0]
}
}
optimizer {
adam_optimizer: {
epsilon: 1e-7 # Match tf.keras.optimizers.Adam's default.
learning_rate: {
cosine_decay_learning_rate {
learning_rate_base: 1e-3
total_steps: 20000
warmup_learning_rate: 2.5e-4
warmup_steps: 3000
}
}
}
use_moving_average: false
}
max_number_of_boxes: 100
unpad_groundtruth_tensors: false
fine_tune_checkpoint_version: V2
fine_tune_checkpoint: "pretrained_model/centernet_hg104_512x512_kpts_coco17_tpu-32/checkpoint/ckpt-0" # path to pretrained_model checkpoint
fine_tune_checkpoint_type: "detection"
}
train_input_reader: {
label_map_path: "dataset/label_map.pbtxt"
tf_record_input_reader {
input_path: "dataset/tfrecord/coco_train.record-00000-of-00001"
}
num_keypoints: 5
}
eval_config: {
metrics_set: "coco_detection_metrics"
use_moving_averages: false
num_visualizations: 10
max_num_boxes_to_visualize: 20
min_score_threshold: 0.2
batch_size: 1;
parameterized_metric {
coco_keypoint_metrics {
class_label: "Plier"
keypoint_label_to_sigmas {
key: "plier_right_handle"
value: 5
}
keypoint_label_to_sigmas {
key: "plier_left_handle"
value: 5
}
keypoint_label_to_sigmas {
key: "plier_middle"
value: 5
}
keypoint_label_to_sigmas {
key: "plier_right_head"
value: 5
}
keypoint_label_to_sigmas {
key: "plier_left_head"
value: 5
}
}
}
# Provide the edges to connect the keypoints. The setting is suitable for
# our dataset has 5 keypoints
keypoint_edge { # plier_right_handle - plier_left_handle
start: 0
end: 1
}
keypoint_edge { # plier_right_handle - plier_middle
start: 0
end: 2
}
keypoint_edge { # plier_left_handle - plier_middle
start: 1
end: 2
}
keypoint_edge { # plier_middle - plier_right_head
start: 2
end: 3
}
keypoint_edge { # plier_middle - plier_left_head
start: 2
end: 4
}
keypoint_edge { # plier_right_head - plier_left_head
start: 3
end: 4
}
}
eval_input_reader: {
label_map_path: "dataset/label_map.pbtxt" # path to label_map.pbtxt
tf_record_input_reader {
input_path: "dataset/tfrecord/coco_testdev.record-00000-of-00001" # path to val tfrecord
}
num_keypoints: 5
}