Skip to content

Commit 5245161

Browse files
tombstoneTF Object Detection Team
and
TF Object Detection Team
authored
Merged commit includes the following changes: (#8830)
320622111 by rathodv: Internal Change. -- PiperOrigin-RevId: 320622111 Co-authored-by: TF Object Detection Team <[email protected]>
1 parent c9eb355 commit 5245161

File tree

59 files changed

+6823
-812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+6823
-812
lines changed

research/object_detection/README.md

+107-341
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# CenterNet meta-architecture from the "Objects as Points" [2] paper with the
2+
# hourglass[1] backbone.
3+
# [1]: https://arxiv.org/abs/1603.06937
4+
# [2]: https://arxiv.org/abs/1904.07850
5+
# Trained on COCO, initialized from Extremenet Detection checkpoint
6+
# Train on TPU-32 v3
7+
#
8+
# Achieves 44.6 mAP on COCO17 Val
9+
10+
11+
model {
12+
center_net {
13+
num_classes: 90
14+
feature_extractor {
15+
type: "hourglass_104"
16+
bgr_ordering: true
17+
channel_means: [104.01362025, 114.03422265, 119.9165958 ]
18+
channel_stds: [73.6027665 , 69.89082075, 70.9150767 ]
19+
}
20+
image_resizer {
21+
keep_aspect_ratio_resizer {
22+
min_dimension: 1024
23+
max_dimension: 1024
24+
pad_to_max_dimension: true
25+
}
26+
}
27+
object_detection_task {
28+
task_loss_weight: 1.0
29+
offset_loss_weight: 1.0
30+
scale_loss_weight: 0.1
31+
localization_loss {
32+
l1_localization_loss {
33+
}
34+
}
35+
}
36+
object_center_params {
37+
object_center_loss_weight: 1.0
38+
min_box_overlap_iou: 0.7
39+
max_box_predictions: 100
40+
classification_loss {
41+
penalty_reduced_logistic_focal_loss {
42+
alpha: 2.0
43+
beta: 4.0
44+
}
45+
}
46+
}
47+
}
48+
}
49+
50+
train_config: {
51+
52+
batch_size: 128
53+
num_steps: 50000
54+
55+
data_augmentation_options {
56+
random_horizontal_flip {
57+
}
58+
}
59+
60+
data_augmentation_options {
61+
random_adjust_hue {
62+
}
63+
}
64+
65+
data_augmentation_options {
66+
random_adjust_contrast {
67+
}
68+
}
69+
70+
data_augmentation_options {
71+
random_adjust_saturation {
72+
}
73+
}
74+
75+
data_augmentation_options {
76+
random_adjust_brightness {
77+
}
78+
}
79+
80+
data_augmentation_options {
81+
random_square_crop_by_scale {
82+
scale_min: 0.6
83+
scale_max: 1.3
84+
}
85+
}
86+
87+
optimizer {
88+
adam_optimizer: {
89+
epsilon: 1e-7 # Match tf.keras.optimizers.Adam's default.
90+
learning_rate: {
91+
cosine_decay_learning_rate {
92+
learning_rate_base: 1e-3
93+
total_steps: 50000
94+
warmup_learning_rate: 2.5e-4
95+
warmup_steps: 5000
96+
}
97+
}
98+
}
99+
use_moving_average: false
100+
}
101+
max_number_of_boxes: 100
102+
unpad_groundtruth_tensors: false
103+
104+
fine_tune_checkpoint_version: V2
105+
fine_tune_checkpoint: "PATH_TO_BE_CONFIGURED/ckpt-1"
106+
fine_tune_checkpoint_type: "detection"
107+
}
108+
109+
train_input_reader: {
110+
label_map_path: "PATH_TO_BE_CONFIGURED/label_map.txt"
111+
tf_record_input_reader {
112+
input_path: "PATH_TO_BE_CONFIGURED/train2017-?????-of-00256.tfrecord"
113+
}
114+
}
115+
116+
eval_config: {
117+
metrics_set: "coco_detection_metrics"
118+
use_moving_averages: false
119+
batch_size: 1;
120+
}
121+
122+
eval_input_reader: {
123+
label_map_path: "PATH_TO_BE_CONFIGURED/label_map.txt"
124+
shuffle: false
125+
num_epochs: 1
126+
tf_record_input_reader {
127+
input_path: "PATH_TO_BE_CONFIGURED/val2017-?????-of-00032.tfrecord"
128+
}
129+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# CenterNet meta-architecture from the "Objects as Points" [2] paper with the
2+
# hourglass[1] backbone.
3+
# [1]: https://arxiv.org/abs/1603.06937
4+
# [2]: https://arxiv.org/abs/1904.07850
5+
# Trained on COCO, initialized from Extremenet Detection checkpoint
6+
# Train on TPU-8
7+
#
8+
# Achieves 41.9 mAP on COCO17 Val
9+
10+
model {
11+
center_net {
12+
num_classes: 90
13+
feature_extractor {
14+
type: "hourglass_104"
15+
bgr_ordering: true
16+
channel_means: [104.01362025, 114.03422265, 119.9165958 ]
17+
channel_stds: [73.6027665 , 69.89082075, 70.9150767 ]
18+
}
19+
image_resizer {
20+
keep_aspect_ratio_resizer {
21+
min_dimension: 512
22+
max_dimension: 512
23+
pad_to_max_dimension: true
24+
}
25+
}
26+
object_detection_task {
27+
task_loss_weight: 1.0
28+
offset_loss_weight: 1.0
29+
scale_loss_weight: 0.1
30+
localization_loss {
31+
l1_localization_loss {
32+
}
33+
}
34+
}
35+
object_center_params {
36+
object_center_loss_weight: 1.0
37+
min_box_overlap_iou: 0.7
38+
max_box_predictions: 100
39+
classification_loss {
40+
penalty_reduced_logistic_focal_loss {
41+
alpha: 2.0
42+
beta: 4.0
43+
}
44+
}
45+
}
46+
}
47+
}
48+
49+
train_config: {
50+
51+
batch_size: 128
52+
num_steps: 140000
53+
54+
data_augmentation_options {
55+
random_horizontal_flip {
56+
}
57+
}
58+
59+
data_augmentation_options {
60+
random_crop_image {
61+
min_aspect_ratio: 0.5
62+
max_aspect_ratio: 1.7
63+
random_coef: 0.25
64+
}
65+
}
66+
67+
68+
data_augmentation_options {
69+
random_adjust_hue {
70+
}
71+
}
72+
73+
data_augmentation_options {
74+
random_adjust_contrast {
75+
}
76+
}
77+
78+
data_augmentation_options {
79+
random_adjust_saturation {
80+
}
81+
}
82+
83+
data_augmentation_options {
84+
random_adjust_brightness {
85+
}
86+
}
87+
88+
data_augmentation_options {
89+
random_absolute_pad_image {
90+
max_height_padding: 200
91+
max_width_padding: 200
92+
pad_color: [0, 0, 0]
93+
}
94+
}
95+
96+
optimizer {
97+
adam_optimizer: {
98+
epsilon: 1e-7 # Match tf.keras.optimizers.Adam's default.
99+
learning_rate: {
100+
manual_step_learning_rate {
101+
initial_learning_rate: 1e-3
102+
schedule {
103+
step: 90000
104+
learning_rate: 1e-4
105+
}
106+
schedule {
107+
step: 120000
108+
learning_rate: 1e-5
109+
}
110+
}
111+
}
112+
}
113+
use_moving_average: false
114+
}
115+
max_number_of_boxes: 100
116+
unpad_groundtruth_tensors: false
117+
118+
fine_tune_checkpoint_version: V2
119+
fine_tune_checkpoint: "PATH_TO_BE_CONFIGURED/ckpt-1"
120+
fine_tune_checkpoint_type: "detection"
121+
}
122+
123+
train_input_reader: {
124+
label_map_path: "PATH_TO_BE_CONFIGURED/label_map.txt"
125+
tf_record_input_reader {
126+
input_path: "PATH_TO_BE_CONFIGURED/train2017-?????-of-00256.tfrecord"
127+
}
128+
}
129+
130+
eval_config: {
131+
metrics_set: "coco_detection_metrics"
132+
use_moving_averages: false
133+
batch_size: 1;
134+
}
135+
136+
eval_input_reader: {
137+
label_map_path: "PATH_TO_BE_CONFIGURED/label_map.txt"
138+
shuffle: false
139+
num_epochs: 1
140+
tf_record_input_reader {
141+
input_path: "PATH_TO_BE_CONFIGURED/val2017-?????-of-00032.tfrecord"
142+
}
143+
}

0 commit comments

Comments
 (0)