-
Notifications
You must be signed in to change notification settings - Fork 517
/
yolox.py
66 lines (52 loc) · 2.4 KB
/
yolox.py
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
from super_gradients.common.registry.registry import register_model
from super_gradients.common.object_names import Models
from super_gradients.training.models.detection_models.yolo_base import YoloBase, YoloDarknetBackbone
from super_gradients.training.utils.utils import HpmStruct
@register_model(Models.YOLOX_N)
class YoloX_N(YoloBase):
def __init__(self, arch_params: HpmStruct):
arch_params.depth_mult_factor = 0.33
arch_params.width_mult_factor = 0.25
arch_params.yolo_type = "yoloX"
arch_params.depthwise = True
super().__init__(backbone=YoloDarknetBackbone, arch_params=arch_params)
@register_model(Models.YOLOX_T)
class YoloX_T(YoloBase):
def __init__(self, arch_params: HpmStruct):
arch_params.depth_mult_factor = 0.33
arch_params.width_mult_factor = 0.375
arch_params.yolo_type = "yoloX"
super().__init__(backbone=YoloDarknetBackbone, arch_params=arch_params)
@register_model(Models.YOLOX_S)
class YoloX_S(YoloBase):
def __init__(self, arch_params: HpmStruct):
arch_params.depth_mult_factor = 0.33
arch_params.width_mult_factor = 0.50
arch_params.yolo_type = "yoloX"
super().__init__(backbone=YoloDarknetBackbone, arch_params=arch_params)
@register_model(Models.YOLOX_M)
class YoloX_M(YoloBase):
def __init__(self, arch_params: HpmStruct):
arch_params.depth_mult_factor = 0.67
arch_params.width_mult_factor = 0.75
arch_params.yolo_type = "yoloX"
super().__init__(backbone=YoloDarknetBackbone, arch_params=arch_params)
@register_model(Models.YOLOX_L)
class YoloX_L(YoloBase):
def __init__(self, arch_params: HpmStruct):
arch_params.depth_mult_factor = 1.0
arch_params.width_mult_factor = 1.0
arch_params.yolo_type = "yoloX"
super().__init__(backbone=YoloDarknetBackbone, arch_params=arch_params)
@register_model(Models.YOLOX_X)
class YoloX_X(YoloBase):
def __init__(self, arch_params: HpmStruct):
arch_params.depth_mult_factor = 1.33
arch_params.width_mult_factor = 1.25
arch_params.yolo_type = "yoloX"
super().__init__(backbone=YoloDarknetBackbone, arch_params=arch_params)
@register_model(Models.CUSTOM_YOLO_X)
class CustomYoloX(YoloBase):
def __init__(self, arch_params: HpmStruct):
arch_params.yolo_type = "yoloX"
super().__init__(backbone=arch_params.backbone, arch_params=arch_params)