__init__.py 995 Bytes
Newer Older
dingchang's avatar
dingchang committed
1
# Copyright (c) OpenMMLab. All rights reserved.
2
3
4
5
6
7
from .base_points import BasePoints
from .cam_points import CameraPoints
from .depth_points import DepthPoints
from .lidar_points import LiDARPoints

__all__ = ['BasePoints', 'CameraPoints', 'DepthPoints', 'LiDARPoints']
8
9


10
def get_points_type(points_type: str) -> type:
11
12
13
    """Get the class of points according to coordinate type.

    Args:
14
15
        points_type (str): The type of points coordinate. The valid value are
            "CAMERA", "LIDAR" and "DEPTH".
16
17

    Returns:
18
        type: Points type.
19
    """
20
21
    points_type_upper = points_type.upper()
    if points_type_upper == 'CAMERA':
22
        points_cls = CameraPoints
23
    elif points_type_upper == 'LIDAR':
24
        points_cls = LiDARPoints
25
    elif points_type_upper == 'DEPTH':
26
27
        points_cls = DepthPoints
    else:
28
29
        raise ValueError('Only "points_type" of "CAMERA", "LIDAR" and "DEPTH" '
                         f'are supported, got {points_type}')
30
31

    return points_cls