mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
fixed consistency darknet and python code
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user