MCPcopy Create free account
hub / github.com/FoundationVision/ByteTrack / box_candidates

Function box_candidates

yolox/data/data_augment.py:39–51  ·  view source on GitHub ↗
(box1, box2, wh_thr=2, ar_thr=20, area_thr=0.2)

Source from the content-addressed store, hash-verified

37
38
39def box_candidates(box1, box2, wh_thr=2, ar_thr=20, area_thr=0.2):
40 # box1(4,n), box2(4,n)
41 # Compute candidate boxes which include follwing 5 things:
42 # box1 before augment, box2 after augment, wh_thr (pixels), aspect_ratio_thr, area_ratio
43 w1, h1 = box1[2] - box1[0], box1[3] - box1[1]
44 w2, h2 = box2[2] - box2[0], box2[3] - box2[1]
45 ar = np.maximum(w2 / (h2 + 1e-16), h2 / (w2 + 1e-16)) # aspect ratio
46 return (
47 (w2 > wh_thr)
48 & (h2 > wh_thr)
49 & (w2 * h2 / (w1 * h1 + 1e-16) > area_thr)
50 & (ar < ar_thr)
51 ) # candidates
52
53
54def random_perspective(

Callers 2

random_perspectiveFunction · 0.85
mixupMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected