Added max_boxes for yolo v3
| | |
| | | |
| | | char *a = option_find_str(options, "mask", 0); |
| | | int *mask = parse_yolo_mask(a, &num); |
| | | layer l = make_yolo_layer(params.batch, params.w, params.h, num, total, mask, classes); |
| | | int max_boxes = option_find_int_quiet(options, "max", 30); |
| | | layer l = make_yolo_layer(params.batch, params.w, params.h, num, total, mask, classes, max_boxes); |
| | | assert(l.outputs == params.inputs); |
| | | |
| | | l.max_boxes = option_find_int_quiet(options, "max", 90); |
| | | //l.max_boxes = option_find_int_quiet(options, "max", 90); |
| | | l.jitter = option_find_float(options, "jitter", .2); |
| | | |
| | | l.ignore_thresh = option_find_float(options, "ignore_thresh", .5); |
| | |
| | | #include <string.h> |
| | | #include <stdlib.h> |
| | | |
| | | layer make_yolo_layer(int batch, int w, int h, int n, int total, int *mask, int classes) |
| | | layer make_yolo_layer(int batch, int w, int h, int n, int total, int *mask, int classes, int max_boxes) |
| | | { |
| | | int i; |
| | | layer l = {0}; |
| | |
| | | l.bias_updates = calloc(n*2, sizeof(float)); |
| | | l.outputs = h*w*n*(classes + 4 + 1); |
| | | l.inputs = l.outputs; |
| | | l.truths = 90*(4 + 1); |
| | | l.max_boxes = max_boxes; |
| | | printf(" l.max_boxes = %d \n", l.max_boxes); |
| | | l.truths = l.max_boxes*(4 + 1); // 90*(4 + 1); |
| | | l.delta = calloc(batch*l.outputs, sizeof(float)); |
| | | l.output = calloc(batch*l.outputs, sizeof(float)); |
| | | for(i = 0; i < total*2; ++i){ |
| | |
| | | #include "layer.h" |
| | | #include "network.h" |
| | | |
| | | layer make_yolo_layer(int batch, int w, int h, int n, int total, int *mask, int classes); |
| | | layer make_yolo_layer(int batch, int w, int h, int n, int total, int *mask, int classes, int max_boxes); |
| | | void forward_yolo_layer(const layer l, network_state state); |
| | | void backward_yolo_layer(const layer l, network_state state); |
| | | void resize_yolo_layer(layer *l, int w, int h); |