l5kit icon indicating copy to clipboard operation
l5kit copied to clipboard

AssertionError when running tests

Open zshn25 opened this issue 11 months ago • 0 comments
trafficstars

=================================== FAILURES ===================================
____________________________ test_detect_collision _____________________________

    def test_detect_collision() -> None:
        pred_centroid = np.array([0.0, 0.0])
        pred_yaw = np.array([1.0])
        pred_extent = np.array([5., 2., 2.])
    
        target_agents_dtype = np.dtype([('centroid', '<f8', (2,)),
                                        ('extent', '<f4', (3,)),
                                        ('yaw', '<f4'), ('track_id', '<u8')])
    
        target_agents = np.array([
            ([1000.0, 1000.0], [5., 2., 2.], 1.0, 1),  # Not in range
            ([0., 0.], [5., 2., 2.], 1.0, 2),  # In range
            ([0., 0.], [5., 2., 2.], 1.0, 3),  # In range
        ], dtype=target_agents_dtype)
    
        collision = detect_collision(pred_centroid, pred_yaw, pred_extent, target_agents)
>       assert collision == (CollisionType.SIDE, 2)
E       assert (<CollisionType.FRONT: 0>, 2) == (<CollisionType.SIDE: 2>, 2)
E         
E         At index 0 diff: <CollisionType.FRONT: 0> != <CollisionType.SIDE: 2>
E         Use -v to get more diff

l5kit/tests/evaluation/metrics_test.py:246: AssertionError

zshn25 avatar Nov 25 '24 13:11 zshn25