File size: 1,920 Bytes
663494c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from mmdet3d_plugin.eval.detection.data_classes import CustomizedDetectionConfig

carla_eval_config = {
    "class_range": {
        "Car": 50,
        "Pedestrian": 40,
        "Motorcycle": 40,
        "Cyclist": 40,
    },
    "dist_fcn": "center_distance",
    "dist_ths": [0.5, 1.0, 2.0, 4.0],
    "dist_th_tp": 2.0,
    "min_recall": 0.1,
    "min_precision": 0.1,
    "max_boxes_per_sample": 500,
    "mean_ap_weight": 5,
    # "dataset_name": 'carla',
}


nuplan_detection_configs = {
    "class_range": {
        "vehicle": 50,
        "pedestrian": 40,
        "bicycle": 40,
        'generic_object': 40,
        "traffic_cone": 30,
        "barrier": 30,
        'czone_sign': 30
    },
    "dist_fcn": "center_distance",
    "dist_ths": [0.5, 1.0, 2.0, 4.0],
    "dist_th_tp": 2.0,
    "min_recall": 0.1,
    "min_precision": 0.1,
    "max_boxes_per_sample": 500,
    "mean_ap_weight": 5,
    # "dataset_name": 'nuplan',
}


def config_factory_carla() -> CustomizedDetectionConfig:
    """
    Creates a DetectionConfig instance that can be used to initialize a NuScenesEval instance.
    Note that this only works if the config file is located in the nuscenes/eval/detection/configs folder.
    :param configuration_name: Name of desired configuration in eval_detection_configs.
    :return: DetectionConfig instance.
    """

    cfg = CustomizedDetectionConfig.deserialize(carla_eval_config)

    return cfg


def config_factory_nuPlan() -> CustomizedDetectionConfig:
    """
    Creates a DetectionConfig instance that can be used to initialize a NuScenesEval instance.
    Note that this only works if the config file is located in the nuscenes/eval/detection/configs folder.
    :param configuration_name: Name of desired configuration in eval_detection_configs.
    :return: DetectionConfig instance.
    """

    cfg = CustomizedDetectionConfig.deserialize(nuplan_detection_configs)

    return cfg