import os 

def loader(data_root, datafile):
    data_paths = []
    with open(os.path.join(data_root,datafile), 'r') as fh:
        for line in fh:
            data_paths.append(line.strip())
    return data_paths
    
information = {"nuscenes": {    
                "DATA_PATH_FILE" :{
                        'train': 'data_lists/nuscenes_train.txt',
                        'val': 'data_lists/nuscenes_val.txt',
                        'trainval': 'data_lists/nuscenes_trainval.txt',
                        'test': 'data_lists/nuscenes_test.txt'
                    },
                "loader":loader,
                "MACRO_LABELS":{
                        0: "noise",
                        1: "barrier",
                        2: "bicycle",
                        3: "bus",
                        4: "car",
                        5: "construction_vehicle",
                        6: "motorcycle",
                        7: "pedestrian",
                        8: "traffic_cone",
                        9: "trailer",
                        10: "truck",
                        11: "driveable_surface",
                        12: "other_flat",
                        13: "sidewalk",
                        14: "terrain",
                        15: "manmade",
                        16: "vegetation",
                    },
                "CLASS_LABELS":(
                        "barrier",
                        "bicycle",
                        "bus",
                        "car",
                        "construction_vehicle",
                        "motorcycle",
                        "pedestrian",
                        "traffic_cone",
                        "trailer",
                        "truck",
                        "driveable_surface",
                        "other_flat",
                        "sidewalk",
                        "terrain",
                        "manmade",
                        "vegetation",
                    ),
                "COLOR_MAP":{
                        0: [245, 150, 100],
                        1: [245, 230, 100],
                        2: [150, 60, 30],
                        3: [180, 30, 80],
                        4: [255, 0, 0],
                        5: [30, 30, 255],
                        6: [200, 40, 255],
                        7: [90, 30, 150],
                        8: [255, 0, 255],
                        9: [255, 150, 255],
                        10: [75, 0, 75],
                        11: [75, 0, 175],
                        12: [0, 200, 255],
                        13: [50, 120, 255],
                        14: [0, 175, 0],
                        15: [0, 60, 135],
                        16: [80, 240, 150]
                    },
                "VALID_CLASS_IDS":(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)
                },
            "semantickitti":{
                "DATA_PATH_FILE":{
                        'train': 'data_lists/semanticKITTI_train.txt',
                        'val': 'data_lists/semanticKITTI_val.txt',
                        'trainval': 'data_lists/semanticKITTI_trainval.txt',
                        'test': 'data_lists/semanticKITTI_test.txt'
                    },
                "loader":loader,
                "MACRO_LABELS":{
                        0: "car",
                        1: "bicycle",
                        2: "motorcycle",
                        3: "truck",
                        4: "other-vehicle",
                        5: "person",
                        6: "bicyclist",
                        7: "motorcyclist",
                        8: "road",
                        9: "parking",
                        10: "sidewalk",
                        11: "other-ground",
                        12: "building",
                        13: "fence",
                        14: "vegetation",
                        15: "trunk",
                        16: "terrain",
                        17: "pole",
                        18: "traffic-sign",
                        -1: "unlabeled"
                    },
                "CLASS_LABELS":(
                        'car',
                        'bicycle', 
                        'motorcycle', 
                        'truck', 
                        'other-vehicle', 
                        'person', 
                        'bicyclist', 
                        'motorcyclist', 
                        'road', 
                        'parking', 
                        'sidewalk', 
                        'other-ground', 
                        'building',
                        'fence', 
                        'vegetation', 
                        'trunk', 
                        'terrain', 
                        'pole', 
                        'traffic-sign'
                    ),
                "COLOR_MAP":{
                        -1: [0, 0, 0],
                        0: [245, 150, 100],
                        1: [245, 230, 100],
                        2: [150, 60, 30],
                        3: [180, 30, 80],
                        4: [255, 0, 0],
                        5: [30, 30, 255],
                        6: [200, 40, 255],
                        7: [90, 30, 150],
                        8: [255, 0, 255],
                        9: [255, 150, 255],
                        10: [75, 0, 75],
                        11: [75, 0, 175],
                        12: [0, 200, 255],
                        13: [50, 120, 255],
                        14: [0, 175, 0],
                        15: [0, 60, 135],
                        16: [80, 240, 150],
                        17: [150, 240, 255],
                        18: [0, 0, 255],
                    },
                "VALID_CLASS_IDS":(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18)
                },
            "semanticposs":{
                "DATA_PATH_FILE":{
                        'train': 'data_lists/semanticPOSS_train.txt',
                        'val': 'data_lists/semanticPOSS_val.txt',
                        'trainval': 'data_lists/semanticPOSS_trainval.txt',
                        'test': 'data_lists/semanticPOSS_test.txt'
                    },
                "loader":loader,
                "MACRO_LABELS":{
                        0: "pedestrian",
                        1: "rider",
                        2: "car",
                        3: "trunk",
                        4: "plants",
                        5: "traffic-sign",
                        6: "pole",
                        7: "trashcan",
                        8: "building",
                        9: "cone/stone",
                        10: "fence",
                        11: "bike",
                        12: "ground",
                        -1: "unlabeled"
                    },
                "CLASS_LABELS":(
                        "pedestrian",
                        "rider",
                        "car",
                        "trunk",
                        "plants",
                        "traffic-sign",
                        "pole",
                        "trashcan",
                        "building",
                        "cone/stone",
                        "fence",
                        "bike",
                        "ground",
                    ),
                "COLOR_MAP":{
                        -1: [0, 0, 0],
                        0: [245, 150, 100],
                        1: [245, 230, 100],
                        2: [150, 60, 30],
                        3: [180, 30, 80],
                        4: [255, 0, 0],
                        5: [30, 30, 255],
                        6: [200, 40, 255],
                        7: [90, 30, 150],
                        8: [255, 0, 255],
                        9: [255, 150, 255],
                        10: [75, 0, 75],
                        11: [75, 0, 175],
                        12: [0, 200, 255]
                    },
                "VALID_CLASS_IDS":(0,1,2,3,4,5,6,7,8,9,10,11,12)
                }
}
import os 

def loader(data_root, datafile):
    data_paths = []
    with open(os.path.join(data_root,datafile), 'r') as fh:
        for line in fh:
            data_paths.append(line.strip())
    return data_paths
    
information = {"nuscenes": {    
                "DATA_PATH_FILE" :{
                        'train': 'data_lists/nuscenes_train.txt',
                        'val': 'data_lists/nuscenes_val.txt',
                        'trainval': 'data_lists/nuscenes_trainval.txt',
                        'test': 'data_lists/nuscenes_test.txt'
                    },
                "loader":loader,
                "MACRO_LABELS":{
                        0: "noise",
                        1: "barrier",
                        2: "bicycle",
                        3: "bus",
                        4: "car",
                        5: "construction_vehicle",
                        6: "motorcycle",
                        7: "pedestrian",
                        8: "traffic_cone",
                        9: "trailer",
                        10: "truck",
                        11: "driveable_surface",
                        12: "other_flat",
                        13: "sidewalk",
                        14: "terrain",
                        15: "manmade",
                        16: "vegetation",
                    },
                "CLASS_LABELS":(
                        "barrier",
                        "bicycle",
                        "bus",
                        "car",
                        "construction_vehicle",
                        "motorcycle",
                        "pedestrian",
                        "traffic_cone",
                        "trailer",
                        "truck",
                        "driveable_surface",
                        "other_flat",
                        "sidewalk",
                        "terrain",
                        "manmade",
                        "vegetation",
                    ),
                "COLOR_MAP":{
                        0: [245, 150, 100],
                        1: [245, 230, 100],
                        2: [150, 60, 30],
                        3: [180, 30, 80],
                        4: [255, 0, 0],
                        5: [30, 30, 255],
                        6: [200, 40, 255],
                        7: [90, 30, 150],
                        8: [255, 0, 255],
                        9: [255, 150, 255],
                        10: [75, 0, 75],
                        11: [75, 0, 175],
                        12: [0, 200, 255],
                        13: [50, 120, 255],
                        14: [0, 175, 0],
                        15: [0, 60, 135],
                        16: [80, 240, 150]
                    },
                "VALID_CLASS_IDS":(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)
                },
            "semantickitti":{
                "DATA_PATH_FILE":{
                        'train': 'data_lists/semanticKITTI_train.txt',
                        'val': 'data_lists/semanticKITTI_val.txt',
                        'trainval': 'data_lists/semanticKITTI_trainval.txt',
                        'test': 'data_lists/semanticKITTI_test.txt'
                    },
                "loader":loader,
                "MACRO_LABELS":{
                        0: "car",
                        1: "bicycle",
                        2: "motorcycle",
                        3: "truck",
                        4: "other-vehicle",
                        5: "person",
                        6: "bicyclist",
                        7: "motorcyclist",
                        8: "road",
                        9: "parking",
                        10: "sidewalk",
                        11: "other-ground",
                        12: "building",
                        13: "fence",
                        14: "vegetation",
                        15: "trunk",
                        16: "terrain",
                        17: "pole",
                        18: "traffic-sign",
                        -1: "unlabeled"
                    },
                "CLASS_LABELS":(
                        'car',
                        'bicycle', 
                        'motorcycle', 
                        'truck', 
                        'other-vehicle', 
                        'person', 
                        'bicyclist', 
                        'motorcyclist', 
                        'road', 
                        'parking', 
                        'sidewalk', 
                        'other-ground', 
                        'building',
                        'fence', 
                        'vegetation', 
                        'trunk', 
                        'terrain', 
                        'pole', 
                        'traffic-sign'
                    ),
                "COLOR_MAP":{
                        -1: [0, 0, 0],
                        0: [245, 150, 100],
                        1: [245, 230, 100],
                        2: [150, 60, 30],
                        3: [180, 30, 80],
                        4: [255, 0, 0],
                        5: [30, 30, 255],
                        6: [200, 40, 255],
                        7: [90, 30, 150],
                        8: [255, 0, 255],
                        9: [255, 150, 255],
                        10: [75, 0, 75],
                        11: [75, 0, 175],
                        12: [0, 200, 255],
                        13: [50, 120, 255],
                        14: [0, 175, 0],
                        15: [0, 60, 135],
                        16: [80, 240, 150],
                        17: [150, 240, 255],
                        18: [0, 0, 255],
                    },
                "VALID_CLASS_IDS":(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18)
                },
            "semanticposs":{
                "DATA_PATH_FILE":{
                        'train': 'data_lists/semanticPOSS_train.txt',
                        'val': 'data_lists/semanticPOSS_val.txt',
                        'trainval': 'data_lists/semanticPOSS_trainval.txt',
                        'test': 'data_lists/semanticPOSS_test.txt'
                    },
                "loader":loader,
                "MACRO_LABELS":{
                        0: "pedestrian",
                        1: "rider",
                        2: "car",
                        3: "trunk",
                        4: "plants",
                        5: "traffic-sign",
                        6: "pole",
                        7: "trashcan",
                        8: "building",
                        9: "cone/stone",
                        10: "fence",
                        11: "bike",
                        12: "ground",
                        -1: "unlabeled"
                    },
                "CLASS_LABELS":(
                        "pedestrian",
                        "rider",
                        "car",
                        "trunk",
                        "plants",
                        "traffic-sign",
                        "pole",
                        "trashcan",
                        "building",
                        "cone/stone",
                        "fence",
                        "bike",
                        "ground",
                    ),
                "COLOR_MAP":{
                        -1: [0, 0, 0],
                        0: [245, 150, 100],
                        1: [245, 230, 100],
                        2: [150, 60, 30],
                        3: [180, 30, 80],
                        4: [255, 0, 0],
                        5: [30, 30, 255],
                        6: [200, 40, 255],
                        7: [90, 30, 150],
                        8: [255, 0, 255],
                        9: [255, 150, 255],
                        10: [75, 0, 75],
                        11: [75, 0, 175],
                        12: [0, 200, 255]
                    },
                "VALID_CLASS_IDS":(0,1,2,3,4,5,6,7,8,9,10,11,12)
                }
}