yolov8 source code interpretation (part2: detection, segmentation)

This article interprets the detection part in the frame below and the segmentation part that is not drawn.
insert image description here
Pay attention to the number in the upper right corner of each module, which represents the number of modules.
Now the input for detection and segmentation is the output of 15, 18, and 21 modules (circled in the figure).
When interpreting the code, [15,18,21] will be used to prompt that the output of 15, 18, and 21 modules is needed.

The instance segmentation of yolov8 uses the idea in yolact, uses the network to predict proto and mask coefficient,
multiplies them to obtain the segmentation map, and then uses the detection frame to crop the instance segmentation.
Those who are not familiar with yolact can refer to here .
The detection frame uses the idea of ​​(l, t, r, b) in FCOS, anchor-free, but it is still necessary to pre-define the center point of the target frame.

The division is not drawn, but it is still numbered (the number in the upper right corner of the module), labeled [22].

Segment: [22] nn/modules/head.py

class Segment(Detect):
    

Guess you like

Origin blog.csdn.net/level_code/article/details/131530163