MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / test_box

Function test_box

yolo_detector/darknet_opt/src/box.c:181–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181void test_box()
182{
183 test_dintersect();
184 test_dunion();
185 box a = {0, 0, 1, 1};
186 box dxa= {0+.00001, 0, 1, 1};
187 box dya= {0, 0+.00001, 1, 1};
188 box dwa= {0, 0, 1+.00001, 1};
189 box dha= {0, 0, 1, 1+.00001};
190
191 box b = {.5, 0, .2, .2};
192
193 float iou = box_iou(a,b);
194 iou = (1-iou)*(1-iou);
195 printf("%f\n", iou);
196 dbox d = diou(a, b);
197 printf("%f %f %f %f\n", d.dx, d.dy, d.dw, d.dh);
198
199 float xiou = box_iou(dxa, b);
200 float yiou = box_iou(dya, b);
201 float wiou = box_iou(dwa, b);
202 float hiou = box_iou(dha, b);
203 xiou = ((1-xiou)*(1-xiou) - iou)/(.00001);
204 yiou = ((1-yiou)*(1-yiou) - iou)/(.00001);
205 wiou = ((1-wiou)*(1-wiou) - iou)/(.00001);
206 hiou = ((1-hiou)*(1-hiou) - iou)/(.00001);
207 printf("manual %f %f %f %f\n", xiou, yiou, wiou, hiou);
208}
209
210dbox diou(box a, box b)
211{

Callers

nothing calls this directly

Calls 4

test_dintersectFunction · 0.85
test_dunionFunction · 0.85
box_iouFunction · 0.85
diouFunction · 0.85

Tested by

no test coverage detected