Yolo V3 understand the relationship between the label and bbox

If a bbox coordinates: [35220622933]

The first step: (3 kinds of zoom scaling) BBOX converted into coordinates and width and height of the center of the form

Then onehot: [0 0 0 1 0 0 0 0 0 0 ........], of course, also be smooth

Bbox calculated center coordinates and width and height of (35 + 62) / 2 = 48.5 (220 + 293) /2=256.5 width and height = 62-35 = 73 27293-220

Therefore bbox width and height of the center coordinates (256.5 48.5 2773)

Then scaled according to the scaling (81632)

3 is a scaled set of coordinates [[32.0625 3.375 6.0625 9.125] [3.03 1.68 16.03 4.56] [1.51 8.01 0.84 2.28]]

Step two: anchors get high and wide center

Anchors the center coordinates and the width and height of each group of a total of 3 to 8 scale: [[32.5 1.25 1.625 6.5] [6.5 2 3.75 32.5] [32.5 4.125 2.875 6.5]]

                 A scale of 16: [[3.5 16.5 1.875 3.8125] [2.8125 3.5 3.875 16.5] [16.5 3.6875 3.5 7.4375]]

                 A scale of 32: [[1.5 2.8125 8.5 3.625] [4.875 6.1875 1.5 8.5] [1.5 8.5 11.65625 10.1875]]

Wherein the coordinates of the center coordinates rounding bbox plus 0.5, width and height coordinates of the cluster out kmeans

Then 3 bbox set of coordinates and the three groups were calculated coordinates anchors iou

3 different scaling of the three groups corresponding to bbox anchors find iou> 0.3 and the grid coordinates of the upper left corner mark down.

label格式为[np.zeros((train_output_sizes[i], train_output_sizes[i], anchor_per_scale,5 + num_classes)) for i in range(3)]

Then label i = [1,2,3] representative of three kinds of dimensions:

label [i] [Nice, Indian, iou_mask:] = 0 
label [i] [Nice, Indian, iou_mask, 0: 4] = bbox_xywh
label [i] [Nice, Indian, iou_mask, 4: 5] = 1.0
label [i] [Nice, Indian, iou_mask, 5:] = smooth_onehot

Guess you like

Origin www.cnblogs.com/lzq116/p/12176022.html