MCPcopy Create free account
hub / github.com/apache/tvm / _make_valid_boxes

Function _make_valid_boxes

tests/python/relax/test_frontend_tflite.py:2436–2447  ·  view source on GitHub ↗

Generate n random boxes with y1<=y2, x1<=x2 using the given RNG.

(rng, n)

Source from the content-addressed store, hash-verified

2434
2435
2436def _make_valid_boxes(rng, n):
2437 """Generate n random boxes with y1<=y2, x1<=x2 using the given RNG."""
2438 raw = rng.random((n, 4), dtype=np.float32)
2439 return np.stack(
2440 [
2441 np.minimum(raw[:, 0], raw[:, 2]), # y1
2442 np.minimum(raw[:, 1], raw[:, 3]), # x1
2443 np.maximum(raw[:, 0], raw[:, 2]), # y2
2444 np.maximum(raw[:, 1], raw[:, 3]), # x2
2445 ],
2446 axis=1,
2447 ).astype(np.float32)
2448
2449
2450_NMS_V5_CASES = [

Callers 1

Calls 3

astypeMethod · 0.45
minimumMethod · 0.45
maximumMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…