diff --git a/yolox/exp/yolox_base.py b/yolox/exp/yolox_base.py index 6e52e6eac..0694e6c93 100644 --- a/yolox/exp/yolox_base.py +++ b/yolox/exp/yolox_base.py @@ -25,6 +25,10 @@ def __init__(self): self.width = 1.00 # activation name. For example, if using "relu", then "silu" will be replaced to "relu". self.act = "silu" + # activate the depthwise convolution at backbone YOLOX + self.depthwise_backbone = True + # activate the depthwise convolution at head YOLOX + self.depthwise_head = True # ---------------- dataloader config ---------------- # # set worker to 4 for shorter dataloader init time @@ -118,8 +122,8 @@ def init_yolo(M): if getattr(self, "model", None) is None: in_channels = [256, 512, 1024] - backbone = YOLOPAFPN(self.depth, self.width, in_channels=in_channels, act=self.act) - head = YOLOXHead(self.num_classes, self.width, in_channels=in_channels, act=self.act) + backbone = YOLOPAFPN(self.depth, self.width, in_channels=in_channels, act=self.act, depthwise=self.depthwise_backbone) + head = YOLOXHead(self.num_classes, self.width, in_channels=in_channels, act=self.act, depthwise=self.depthwise_head) self.model = YOLOX(backbone, head) self.model.apply(init_yolo)