• 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
16"""Config parameters for YOLOv3 models."""
17
18
19class ConfigYOLOV3ResNet18:
20    """
21    Config parameters for YOLOv3.
22
23    Examples:
24        ConfigYoloV3ResNet18.
25    """
26    img_shape = [352, 640]
27    feature_shape = [32, 3, 352, 640]
28    num_classes = 2
29    nms_max_num = 50
30
31    backbone_input_shape = [64, 64, 128, 256]
32    backbone_shape = [64, 128, 256, 512]
33    backbone_layers = [2, 2, 2, 2]
34    backbone_stride = [1, 2, 2, 2]
35
36    ignore_threshold = 0.5
37    obj_threshold = 0.3
38    nms_threshold = 0.4
39
40    anchor_scales = [(10, 13),
41                     (16, 30),
42                     (33, 23),
43                     (30, 61),
44                     (62, 45),
45                     (59, 119),
46                     (116, 90),
47                     (156, 198),
48                     (163, 326)]
49    out_channel = int(len(anchor_scales) / 3 * (num_classes + 5))
50