backbones.py 1.12 KB
Newer Older
A. Unique TensorFlower's avatar
A. Unique TensorFlower committed
1
# Copyright 2022 The TensorFlow Authors. All Rights Reserved.
2
3
4
5
6
7
8
9
10
11
12
13
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Yeqing Li's avatar
Yeqing Li committed
14

vishnubanna's avatar
vishnubanna committed
15
16
"""Backbones configurations."""
import dataclasses
17
from official.modeling import hyperparams
Abdullah Rashwan's avatar
Abdullah Rashwan committed
18
from official.vision.configs import backbones
19

20

vishnubanna's avatar
vishnubanna committed
21
@dataclasses.dataclass
Jaeyoun Kim's avatar
Jaeyoun Kim committed
22
class Darknet(hyperparams.Config):
Vishnu Banna's avatar
Vishnu Banna committed
23
24
  """DarkNet config."""
  model_id: str = 'cspdarknet53'
Vishnu Banna's avatar
Vishnu Banna committed
25
26
  width_scale: float = 1.0
  depth_scale: float = 1.0
Jaeyoun Kim's avatar
Jaeyoun Kim committed
27
  dilate: bool = False
Abdullah Rashwan's avatar
Abdullah Rashwan committed
28
29
  min_level: int = 3
  max_level: int = 5
Vishnu Banna's avatar
Vishnu Banna committed
30
31
  use_separable_conv: bool = False
  use_reorg_input: bool = False
32

33

vishnubanna's avatar
vishnubanna committed
34
35
@dataclasses.dataclass
class Backbone(backbones.Backbone):
Jaeyoun Kim's avatar
Jaeyoun Kim committed
36
  darknet: Darknet = Darknet()