• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 Huawei Technologies Co., Ltd
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14# ============================================================================
15"""Config parameters for Darknet based yolov3_darknet53 models."""
16
17
18class ConfigYOLOV3DarkNet53:
19    """
20    Config parameters for the yolov3_darknet53.
21    Examples:
22        ConfigYOLOV3DarkNet53()
23    """
24    # train_param
25    # data augmentation related
26    hue = 0.1
27    saturation = 1.5
28    value = 1.5
29    jitter = 0.3
30
31    resize_rate = 1
32    multi_scale = [[320, 320],
33                   [352, 352],
34                   [384, 384],
35                   [416, 416],
36                   [448, 448],
37                   [480, 480],
38                   [512, 512],
39                   [544, 544],
40                   [576, 576],
41                   [608, 608]
42                   ]
43
44    num_classes = 80
45    max_box = 50
46
47    backbone_input_shape = [32, 64, 128, 256, 512]
48    backbone_shape = [64, 128, 256, 512, 1024]
49    backbone_layers = [1, 2, 8, 8, 4]
50
51    # confidence under ignore_threshold means no object when training
52    ignore_threshold = 0.7
53
54    # h->w
55    anchor_scales = [(10, 13),
56                     (16, 30),
57                     (33, 23),
58                     (30, 61),
59                     (62, 45),
60                     (59, 119),
61                     (116, 90),
62                     (156, 198),
63                     (373, 326)]
64    out_channel = 255
65
66    # test_param
67    test_img_shape = [416, 416]
68
69    label_smooth = 0
70    label_smooth_factor = 0.1
71