Skip to content

Commit

Permalink
Rename _yolov5_darknet_pan to build_model (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqwang authored Oct 12, 2021
1 parent 2b0b8da commit f6ede44
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions yolort/models/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"yolov5_darknet_pan_m_r40",
"yolov5_darknet_pan_l_r40",
"yolov5_darknet_tan_s_r40",
"_yolov5_darknet_pan",
"build_model",
]


Expand Down Expand Up @@ -229,7 +229,7 @@ def load_from_yolov5(
}


def _yolov5_darknet_pan(
def build_model(
backbone_name: str,
depth_multiple: float,
width_multiple: float,
Expand Down Expand Up @@ -289,7 +289,7 @@ def yolov5_darknet_pan_s_r31(
depth_multiple = 0.33
width_multiple = 0.5
version = "r3.1"
return _yolov5_darknet_pan(
return build_model(
backbone_name,
depth_multiple,
width_multiple,
Expand Down Expand Up @@ -319,7 +319,7 @@ def yolov5_darknet_pan_m_r31(
depth_multiple = 0.67
width_multiple = 0.75
version = "r3.1"
return _yolov5_darknet_pan(
return build_model(
backbone_name,
depth_multiple,
width_multiple,
Expand Down Expand Up @@ -349,7 +349,7 @@ def yolov5_darknet_pan_l_r31(
depth_multiple = 1.0
width_multiple = 1.0
version = "r3.1"
return _yolov5_darknet_pan(
return build_model(
backbone_name,
depth_multiple,
width_multiple,
Expand Down Expand Up @@ -379,7 +379,7 @@ def yolov5_darknet_pan_s_r40(
depth_multiple = 0.33
width_multiple = 0.5
version = "r4.0"
return _yolov5_darknet_pan(
return build_model(
backbone_name,
depth_multiple,
width_multiple,
Expand Down Expand Up @@ -409,7 +409,7 @@ def yolov5_darknet_pan_m_r40(
depth_multiple = 0.67
width_multiple = 0.75
version = "r4.0"
return _yolov5_darknet_pan(
return build_model(
backbone_name,
depth_multiple,
width_multiple,
Expand Down Expand Up @@ -439,7 +439,7 @@ def yolov5_darknet_pan_l_r40(
depth_multiple = 1.0
width_multiple = 1.0
version = "r4.0"
return _yolov5_darknet_pan(
return build_model(
backbone_name,
depth_multiple,
width_multiple,
Expand Down Expand Up @@ -469,7 +469,7 @@ def yolov5_darknet_pan_s_r60(
depth_multiple = 0.33
width_multiple = 0.5
version = "r6.0"
return _yolov5_darknet_pan(
return build_model(
backbone_name,
depth_multiple,
width_multiple,
Expand Down Expand Up @@ -499,7 +499,7 @@ def yolov5_darknet_pan_m_r60(
depth_multiple = 0.67
width_multiple = 0.75
version = "r6.0"
return _yolov5_darknet_pan(
return build_model(
backbone_name,
depth_multiple,
width_multiple,
Expand Down Expand Up @@ -529,7 +529,7 @@ def yolov5_darknet_pan_l_r60(
depth_multiple = 1.0
width_multiple = 1.0
version = "r6.0"
return _yolov5_darknet_pan(
return build_model(
backbone_name,
depth_multiple,
width_multiple,
Expand Down
2 changes: 1 addition & 1 deletion yolort/utils/update_module_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def __init__(
weights_name = (
f"yolov5_darknet_pan_{yolov5_size}_{version.replace('.', '')}_coco"
)
model = yolo._yolov5_darknet_pan(
model = yolo.build_model(
backbone_name,
depth_multiple,
width_multiple,
Expand Down

0 comments on commit f6ede44

Please sign in to comment.