(self, weights)
| 18 | {"testcase_name": "faster_rcnn_weights", "weights": (10.0, 10.0, 5.0, 5.0)}, |
| 19 | ) |
| 20 | def test_encode_and_decode_boxes(self, weights): |
| 21 | coder_cfg = box_coder.BoxCoder.default_config() |
| 22 | if weights: |
| 23 | coder_cfg = coder_cfg.set(weights=weights) |
| 24 | coder = coder_cfg.instantiate() |
| 25 | boxes = jnp.asarray([[10.0, 25.0, 20.0, 25.0], [20.0, 40.0, 30.0, 50.0]]) |
| 26 | anchors = jnp.asarray([[12.0, 23.0, 22.0, 27.0], [22.0, 38.0, 33.0, 47.0]]) |
| 27 | encoded_boxes = coder.encode(boxes=boxes, anchors=anchors) |
| 28 | decoded_boxes = coder.decode(encoded_boxes=encoded_boxes, anchors=anchors) |
| 29 | np.testing.assert_allclose(boxes, decoded_boxes) |
| 30 | |
| 31 | def test_encoded_zero_area_boxes_are_finite(self): |
| 32 | boxes = jnp.asarray( |
nothing calls this directly
no test coverage detected