AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.65k stars 7.96k forks source link

Question related to [route] and group? #8030

Closed sbmalik closed 3 years ago

sbmalik commented 3 years ago

What are groups and group_id in [route] layers? I found information on groups for conv layer on yolov4-wikis but there is no explanation of these parameters for route. So I wanted to know how they work in route ?

bkapadia02 commented 3 years ago

You can use a program called "netron" on the yolov4-tiny.cfg to visualize the model to help you get some insights about the architecture. It seems the groups=n parameter slices the filter into n equal slices and group_id is the index of the slice that you want to choose. I am unsure if the indexing starts at 1 or 0.

sbmalik commented 3 years ago

@AbdullahAldosari Are group here represent the concept of depthwise-separable conv operation?

bkapadia02 commented 3 years ago

@m3sibti Depthwise-separable conv operation relies on splitting the kernel channels into smaller parts (groups) and then applying a convolution operation on each of those parts. in the route layer there isn't any convolution operation happening.

The groups keyword is only responsible for separating the channels and nothing else, it is only used as a component to do depthwise-separable convolution (when it is used in a convolutional layer).

sbmalik commented 3 years ago

@AbdullahAldosari, Ok thank you for your clearer explanation.

KuoEuran commented 2 years ago

@sbmalik @bkapadia02 Hi, Do you know how to convert yolo model with depthwise separable convolution stroed in .weights to .tfilte format?

kaarmu commented 2 years ago

To comment on whether group_id starts at 1 or 0.

Just as one would expect, it seems to start at 0.

https://github.com/AlexeyAB/darknet/blob/695d562918d6cd878ffe34104a9c1b518a2de740/src/parser.c#L1107