alexklwong / calibrated-backprojection-network

PyTorch Implementation of Unsupervised Depth Completion with Calibrated Backprojection Layers (ORAL, ICCV 2021)
Other
117 stars 24 forks source link

Role of 'datasets.load_image_triplet' in validation #2

Closed rakshith95 closed 2 years ago

rakshith95 commented 2 years ago

Hello, When the image validation is run, the dataloader for inference is in line 764 of kbnet.py is initialized as:

    dataloader = torch.utils.data.DataLoader(
        datasets.KBNetInferenceDataset(
            image_paths=image_paths,
            sparse_depth_paths=sparse_depth_paths,
            intrinsics_paths=intrinsics_paths),
        batch_size=1,
        shuffle=False,
        num_workers=1,
        drop_last=False) 

in which case the KBNetInferenceDataset class is initialized with the default use_image_triplet=True, and tries to fetch and split triplet of images. I understand its function in the training, but why is it so in the validation?

alexklwong commented 2 years ago

Hi, this is an artifact of code reuse, and trying to keep things compatible so that we are able run older code in this repository and make comparisons with ease.

Specifically, some of the baselines use dataloaders that expect triplets during validation: https://github.com/alexklwong/unsupervised-depth-completion-visual-inertial-odometry https://github.com/alexklwong/learning-topology-synthetic-data

So to keep things backwards compatible I also kept the the validation and test set as triplets: https://github.com/alexklwong/calibrated-backprojection-network/blob/master/setup/setup_dataset_kitti.py#L516 https://github.com/alexklwong/calibrated-backprojection-network/blob/master/setup/setup_dataset_void.py#L369

But when users want to run inference on their own images it can be turned off.

rakshith95 commented 2 years ago

Alright, thank you. Is it necessary to run the setup_dataset_void.py before training? In the setup bash script, the images aren't stored as triplets.

alexklwong commented 2 years ago

Yeah you should run all of the setups before training. VOID is also in triplets https://github.com/alexklwong/calibrated-backprojection-network/blob/master/setup/setup_dataset_void.py#L370

rakshith95 commented 2 years ago

Okay, thanks again. Closing this for now. If I have any other queries regarding setting up would you rather I re-open this issue, or open another one?

alexklwong commented 2 years ago

You can open a separate one