-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
BottleneckCSP architecture #781
Comments
@SISTMrL current implementation is correct. |
@SISTMrL by the way, the best way to visualize the current models is probably with Netron viewing an pytorch model, or better an ONNX exported model. |
ok, I'll have a try, thanks! |
@glenn-jocher Thanks for wonderful repo. I have few doubts regarding the CSPNet implementation. As per the paper thehttps://openaccess.thecvf.com/content_CVPRW_2020/papers/w28/Wang_CSPNet_A_New_Backbone_That_Can_Enhance_Learning_Capability_of_CVPRW_2020_paper.pdf , the input should be split into 2 parts which should be processed through 2 branches independently. But in your implementation, Both branches are taking the same input and without any spliting. Please correct me if I understood something wrong |
@abhiagwl4262 yes that is correct. The inputs are not split, they are used in two places here, which I believe aligns with the actual CSPNet implementation. |
@glenn-jocher You guys have chosen to keep it this way because of mistake or for better performance based on experiment? |
@abhiagwl4262 we have not tried the alternative methodology your asked about |
@glenn-jocher Ohhk. Thanks |
@glenn-jocher Hey, Is the input split suggested in CSPNet Paper is same as group convolution(Parallel Convolution) Where we are using groups=2? And What's your intuition behind the pros and cons of that ? |
@abhiagwl4262 similar but not quite the same I think. If I understand correctly the alternative interpretation of splitting the input channels may create small speed/size improvements at the cost of accuracy improvements, as is nearly always the case with reducing operations. If in doubt you can update the CSP bottlenecks and train YOLOv5s to compare to the current implementation. The module is here: Lines 49 to 66 in 702c4fa
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
What does BottleneckCSP do on the features extracted in the previous layers? |
@marziyemahmoudifar |
❔Question
I read the code bottleneckcsp in common.py, and it just convert the c channels into c/2 channels through convolution, the code is shown as follows:
`class BottleneckCSP(nn.Module):
# CSP Bottleneck https://github.com/WongKinYiu/CrossStagePartialNetworks
def init(self, c1, c2, n=1, shortcut=True, g=1, e=0.5): # ch_in, ch_out, number, shortcut, groups, expansion
super(BottleneckCSP, self).init()
c_ = int(c2 * e) # hidden channels
self.cv1 = Conv(c1, c_, 1, 1)
self.cv2 = nn.Conv2d(c1, c_, 1, 1, bias=False)
self.cv3 = nn.Conv2d(c_, c_, 1, 1, bias=False)
self.cv4 = Conv(2 * c_, c2, 1, 1)
self.bn = nn.BatchNorm2d(2 * c_) # applied to cat(cv2, cv3)
self.act = nn.LeakyReLU(0.1, inplace=True)
self.m = nn.Sequential(*[Bottleneck(c_, c_, shortcut, g, e=1.0) for _ in range(n)])
but I read the paper of CSPNet, in the figure, I see the CSPnet just separate the feature map into two part, I think the code above is different from the CSPnet, I couldn't understand
Could you tell me the reason, thanks very much!
Additional context
The text was updated successfully, but these errors were encountered: