Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update depthwise for YOLOX base config so we can train using depth wise Convolution Neural Network #1529

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions yolox/exp/yolox_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down