|
|
@ -456,7 +456,8 @@ void forward_gaussian_yolo_layer(const layer l, network_state state) |
|
|
|
int class_index = entry_gaussian_index(l, b, n*l.w*l.h + j*l.w + i, 9); |
|
|
|
int class_index = entry_gaussian_index(l, b, n*l.w*l.h + j*l.w + i, 9); |
|
|
|
delta_gaussian_yolo_class(l.output, l.delta, class_index, class_id, l.classes, l.w*l.h, 0, l.label_smooth_eps, l.classes_multipliers); |
|
|
|
delta_gaussian_yolo_class(l.output, l.delta, class_index, class_id, l.classes, l.w*l.h, 0, l.label_smooth_eps, l.classes_multipliers); |
|
|
|
box truth = float_to_box_stride(state.truth + best_t*(4 + 1) + b*l.truths, 1); |
|
|
|
box truth = float_to_box_stride(state.truth + best_t*(4 + 1) + b*l.truths, 1); |
|
|
|
delta_gaussian_yolo_box(truth, l.output, l.biases, l.mask[n], box_index, i, j, l.w, l.h, state.net.w, state.net.h, l.delta, (2-truth.w*truth.h), l.w*l.h, l.iou_normalizer, l.iou_loss, l.uc_normalizer, 1, l.yolo_point); |
|
|
|
const float class_multiplier = (l.classes_multipliers) ? l.classes_multipliers[class_id] : 1.0f; |
|
|
|
|
|
|
|
delta_gaussian_yolo_box(truth, l.output, l.biases, l.mask[n], box_index, i, j, l.w, l.h, state.net.w, state.net.h, l.delta, (2-truth.w*truth.h), l.w*l.h, l.iou_normalizer * class_multiplier, l.iou_loss, l.uc_normalizer, 1, l.yolo_point); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -496,15 +497,17 @@ void forward_gaussian_yolo_layer(const layer l, network_state state) |
|
|
|
|
|
|
|
|
|
|
|
int mask_n = int_index(l.mask, best_n, l.n); |
|
|
|
int mask_n = int_index(l.mask, best_n, l.n); |
|
|
|
if(mask_n >= 0){ |
|
|
|
if(mask_n >= 0){ |
|
|
|
|
|
|
|
int class_id = state.truth[t*(4 + 1) + b*l.truths + 4]; |
|
|
|
|
|
|
|
if (l.map) class_id = l.map[class_id]; |
|
|
|
|
|
|
|
|
|
|
|
int box_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 0); |
|
|
|
int box_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 0); |
|
|
|
float iou = delta_gaussian_yolo_box(truth, l.output, l.biases, best_n, box_index, i, j, l.w, l.h, state.net.w, state.net.h, l.delta, (2-truth.w*truth.h), l.w*l.h, l.iou_normalizer, l.iou_loss, l.uc_normalizer, 1, l.yolo_point); |
|
|
|
const float class_multiplier = (l.classes_multipliers) ? l.classes_multipliers[class_id] : 1.0f; |
|
|
|
|
|
|
|
float iou = delta_gaussian_yolo_box(truth, l.output, l.biases, best_n, box_index, i, j, l.w, l.h, state.net.w, state.net.h, l.delta, (2-truth.w*truth.h), l.w*l.h, l.iou_normalizer * class_multiplier, l.iou_loss, l.uc_normalizer, 1, l.yolo_point); |
|
|
|
|
|
|
|
|
|
|
|
int obj_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 8); |
|
|
|
int obj_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 8); |
|
|
|
avg_obj += l.output[obj_index]; |
|
|
|
avg_obj += l.output[obj_index]; |
|
|
|
l.delta[obj_index] = l.cls_normalizer * (1 - l.output[obj_index]); |
|
|
|
l.delta[obj_index] = l.cls_normalizer * (1 - l.output[obj_index]); |
|
|
|
|
|
|
|
|
|
|
|
int class_id = state.truth[t*(4 + 1) + b*l.truths + 4]; |
|
|
|
|
|
|
|
if (l.map) class_id = l.map[class_id]; |
|
|
|
|
|
|
|
int class_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 9); |
|
|
|
int class_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 9); |
|
|
|
delta_gaussian_yolo_class(l.output, l.delta, class_index, class_id, l.classes, l.w*l.h, &avg_cat, l.label_smooth_eps, l.classes_multipliers); |
|
|
|
delta_gaussian_yolo_class(l.output, l.delta, class_index, class_id, l.classes, l.w*l.h, &avg_cat, l.label_smooth_eps, l.classes_multipliers); |
|
|
|
|
|
|
|
|
|
|
@ -527,15 +530,17 @@ void forward_gaussian_yolo_layer(const layer l, network_state state) |
|
|
|
// iou, n
|
|
|
|
// iou, n
|
|
|
|
|
|
|
|
|
|
|
|
if (iou > l.iou_thresh) { |
|
|
|
if (iou > l.iou_thresh) { |
|
|
|
|
|
|
|
int class_id = state.truth[t*(4 + 1) + b*l.truths + 4]; |
|
|
|
|
|
|
|
if (l.map) class_id = l.map[class_id]; |
|
|
|
|
|
|
|
|
|
|
|
int box_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 0); |
|
|
|
int box_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 0); |
|
|
|
float iou = delta_gaussian_yolo_box(truth, l.output, l.biases, n, box_index, i, j, l.w, l.h, state.net.w, state.net.h, l.delta, (2 - truth.w*truth.h), l.w*l.h, l.iou_normalizer, l.iou_loss, l.uc_normalizer, 1, l.yolo_point); |
|
|
|
const float class_multiplier = (l.classes_multipliers) ? l.classes_multipliers[class_id] : 1.0f; |
|
|
|
|
|
|
|
float iou = delta_gaussian_yolo_box(truth, l.output, l.biases, n, box_index, i, j, l.w, l.h, state.net.w, state.net.h, l.delta, (2 - truth.w*truth.h), l.w*l.h, l.iou_normalizer * class_multiplier, l.iou_loss, l.uc_normalizer, 1, l.yolo_point); |
|
|
|
|
|
|
|
|
|
|
|
int obj_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 8); |
|
|
|
int obj_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 8); |
|
|
|
avg_obj += l.output[obj_index]; |
|
|
|
avg_obj += l.output[obj_index]; |
|
|
|
l.delta[obj_index] = l.cls_normalizer * (1 - l.output[obj_index]); |
|
|
|
l.delta[obj_index] = l.cls_normalizer * (1 - l.output[obj_index]); |
|
|
|
|
|
|
|
|
|
|
|
int class_id = state.truth[t*(4 + 1) + b*l.truths + 4]; |
|
|
|
|
|
|
|
if (l.map) class_id = l.map[class_id]; |
|
|
|
|
|
|
|
int class_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 9); |
|
|
|
int class_index = entry_gaussian_index(l, b, mask_n*l.w*l.h + j*l.w + i, 9); |
|
|
|
delta_gaussian_yolo_class(l.output, l.delta, class_index, class_id, l.classes, l.w*l.h, &avg_cat, l.label_smooth_eps, l.classes_multipliers); |
|
|
|
delta_gaussian_yolo_class(l.output, l.delta, class_index, class_id, l.classes, l.w*l.h, &avg_cat, l.label_smooth_eps, l.classes_multipliers); |
|
|
|
|
|
|
|
|
|
|
|