fixed consistency darknet and python code

pull/4364/head
AlexeyAB 6 years ago
parent 61f8f569b7
commit 3abbd85808
  1. 3
      build/darknet/x64/darknet.py
  2. 3
      darknet.py
  3. 8
      src/gaussian_yolo_layer.c

@ -60,7 +60,8 @@ class DETECTION(Structure):
("mask", POINTER(c_float)),
("objectness", c_float),
("sort_class", c_int),
("uc", POINTER(c_float))]
("uc", POINTER(c_float)),
("points", c_int)]
class IMAGE(Structure):

@ -60,7 +60,8 @@ class DETECTION(Structure):
("mask", POINTER(c_float)),
("objectness", c_float),
("sort_class", c_int),
("uc", POINTER(c_float))]
("uc", POINTER(c_float)),
("points", c_int)]
class IMAGE(Structure):

@ -136,10 +136,10 @@ box get_gaussian_yolo_box(float *x, float *biases, int n, int index, int i, int
b.w = exp(x[index + 4 * stride]) * biases[2 * n] / w;
b.h = exp(x[index + 6 * stride]) * biases[2 * n + 1] / h;
b.x = (i + x[index + 0 * stride]) / lw;
b.y = (j + x[index + 2 * stride]) / lh;
if (yolo_point == YOLO_CENTER) {
b.x = (i + x[index + 0 * stride]) / lw;
b.y = (j + x[index + 2 * stride]) / lh;
}
else if (yolo_point == YOLO_LEFT_TOP) {
b.x = (i + x[index + 0 * stride]) / lw + b.w / 2;
@ -176,12 +176,12 @@ float delta_gaussian_yolo_box(box truth, float *x, float *biases, int n, int ind
float tx, ty, tw, th;
tx = (truth.x*lw - i);
ty = (truth.y*lh - j);
tw = log(truth.w*w / biases[2 * n]);
th = log(truth.h*h / biases[2 * n + 1]);
if (yolo_point == YOLO_CENTER) {
tx = (truth.x*lw - i);
ty = (truth.y*lh - j);
}
else if (yolo_point == YOLO_LEFT_TOP) {
tx = ((truth.x - truth.w / 2)*lw - i);

Loading…
Cancel
Save