Ejemplo n.º 1
0
if __name__ == '__main__':

    #
    #   Load configurations
    #
    try:
        config_path = sys.argv[1]
    except IndexError:
        config_path = "train.yml"
    opt = DictAsMember(yaml_load(config_path))

    #
    #   Instantiate models
    #
    model = load_from_file(opt.network, 'IlluminationPredictorNet', opt)

    #
    #   Instantiate loaders
    #
    ldr_image_handler = LDRImageHandler(opt.ldr_mean_std)
    hdr_image_handler = HDRImageHandler(opt.hdr_mean_std,
                                        perform_scale_perturbation=False)
    train_dataset = IlluminationPredictorDataset(opt.data_path,
                                                 dataset_purpose='train',
                                                 configs=opt,
                                                 transform=ldr_image_handler)

    valid_dataset = IlluminationPredictorDataset(opt.data_path,
                                                 dataset_purpose='valid',
                                                 configs=opt,
Ejemplo n.º 2
0
if __name__ == '__main__':

    #
    #   Load configurations
    #
    try:
        config_path = sys.argv[1]
    except IndexError:
        config_path = "test.yml"
    opt = DictAsMember(yaml_load(config_path))

    #
    #   Instantiate models
    #
    model = load_from_file(opt.network, 'AutoEncoderNet')

    #
    #   Instantiate loaders
    #
    hdr_image_handler = HDRImageHandler(opt.mean_std,
                                        perform_scale_perturbation=False)

    test_dataset = AutoEncoderDataset(
        opt.data_path, transform=hdr_image_handler.normalization_ops)

    test_loader = data.DataLoader(test_dataset,
                                  batch_size=1,
                                  num_workers=0,
                                  pin_memory=True)