MCPcopy Create free account
hub / github.com/apple/axlearn / test_clip_boxes

Method test_clip_boxes

axlearn/vision/box_coder_test.py:66–75  ·  view source on GitHub ↗
(self, box_clip_method, expected_output)

Source from the content-addressed store, hash-verified

64 ),
65 )
66 def test_clip_boxes(self, box_clip_method, expected_output):
67 coder_cfg = box_coder.BoxCoder.default_config().set(clip_boxes=box_clip_method)
68 coder = coder_cfg.instantiate()
69 encoded_boxes = jnp.asarray([[10.0, 126.0, 20.0, 126.0], [120.0, 40.0, 130.0, 50.0]])
70 anchors = jnp.asarray([[12.0, 124.0, 22.0, 126.0], [122.0, 38.0, 134.0, 48.0]])
71 decoded_boxes = coder.decode(encoded_boxes=encoded_boxes, anchors=anchors)
72 np.testing.assert_allclose(
73 jnp.asarray(expected_output),
74 decoded_boxes,
75 )
76
77 @parameterized.parameters(
78 (

Callers

nothing calls this directly

Calls 4

setMethod · 0.45
default_configMethod · 0.45
instantiateMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected