示例#1
0
def get_tusimple(params):
    # augmentation
    flip = Flip()
    translate = Translate()
    rotate = Rotate()
    add_noise = AddGaussianNoise()
    change_intensity = ChangeIntensity()
    resize = Resize(rows=256, cols=512)
    norm_to_1 = NormalizeInstensity()
    whc_to_cwh = TransposeNumpyArray((2, 0, 1))

    train_dataset = DatasetTusimple(
        root_path=params.train_root_url,
        json_files=params.train_json_file,
        transform=transforms.Compose([
            flip, translate, rotate, add_noise, change_intensity, resize,
            norm_to_1, whc_to_cwh
        ]),
    )
    val_dataset = DatasetTusimple(
        params.val_root_url,
        params.val_json_file,
        transform=transforms.Compose([resize, norm_to_1, whc_to_cwh]),
    )
    return train_dataset, val_dataset
示例#2
0
    def __init__(self, ):
        print("usage examples:")
        print("python -m dataset.culane.test sample")
        print("python -m dataset.culane.test batch")
        print("python -m dataset.culane.test batch shuffle=False")
        flip = Flip(1.0)
        translate = Translate(1.0)
        rotate = Rotate(1.0)
        add_noise = AddGaussianNoise(1.0)
        change_intensity = ChangeIntensity(1.0)
        resize = Resize(rows=256, cols=512)
        hwc_to_chw = TransposeNumpyArray((2, 0, 1))
        norm_to_1 = NormalizeInstensity()

        self.train_dataset = DatasetCollections(transform=transforms.Compose([
            flip, translate, rotate, add_noise, change_intensity, resize,
            norm_to_1, hwc_to_chw
        ]), )
示例#3
0
    def __init__(self,):
        flip = Flip(1.0)
        translate = Translate(1.0)
        rotate = Rotate(1.0)
        add_noise = AddGaussianNoise(1.0)
        change_intensity = ChangeIntensity(1.0)
        resize = Resize(rows=256, cols=512)
        hwc_to_chw = TransposeNumpyArray((2, 0, 1))
        norm_to_1 = NormalizeInstensity()

        json_file = ['label_data_0313.json', 'label_data_0531.json', 'label_data_0601.json']
        self.train_dataset = DatasetTusimple(root_path="/media/zzhou/data-tusimple/lane_detection/train_set/",
                                             json_files=json_file,
                                             transform=transforms.Compose([flip,
                                                                           translate,
                                                                           rotate,
                                                                           add_noise,
                                                                           change_intensity,
                                                                           resize,
                                                                           norm_to_1,
                                                                           hwc_to_chw]),)
示例#4
0
    def __init__(self,):
        print("usage examples:")
        print("python -m dataset.bdd100k.test sample")
        print("python -m dataset.bdd100k.test batch")
        print("python -m dataset.bdd100k.test batch shuffle=False")
        flip = Flip(1.0)
        translate = Translate(1.0)
        rotate = Rotate(1.0)
        add_noise = AddGaussianNoise(1.0)
        change_intensity = ChangeIntensity(1.0)
        resize = Resize(rows=256, cols=512)
        hwc_to_chw = TransposeNumpyArray((2, 0, 1))
        norm_to_1 = NormalizeInstensity()

        self.train_dataset = DatasetBDD100K(root_path="/media/zzhou/data-BDD100K/bdd100k/",
                                            json_files="labels/bdd100k_labels_images_train.json",
                                            transform=transforms.Compose([flip,
                                                                          translate,
                                                                          rotate,
                                                                          add_noise,
                                                                          change_intensity,
                                                                          resize,
                                                                          norm_to_1,
                                                                          hwc_to_chw]), )