TRI-ML / packnet-sfm

TRI-ML Monocular Depth Estimation Repository
https://tri-ml.github.io/packnet-sfm/
MIT License
1.24k stars 243 forks source link

Specifying intrinsics when using ImageDataset #130

Closed vbelissen closed 3 years ago

vbelissen commented 3 years ago

Hi, Is there a way to specify camera intrinsics instead of dummy instrinsics, when using ImageDataset? By the way, should these intrinsics be adapted when the image resolution is modified? Cheers

VitorGuizilini-TRI commented 3 years ago

You can modify the ImageDataset directly to return the intrinsics you want:

https://github.com/TRI-ML/packnet-sfm/blob/c03e4bf929f202ff67819340135c53778d36047f/packnet_sfm/datasets/image_dataset.py#L14

And yes, these intrinsics should be adapted, but that is done automatically by the data transformations. Let me know if you have any other questions!

vbelissen commented 3 years ago

Thanks again, I had missed that. And thank you very much for making the code public, it is very helpful!

porwalnaman01 commented 3 years ago

Hello there, I am also trying to train it on a different dataset containing just images in a folder. I am also using ImageDataset but when I try to run the script, it reads the validation files but do not read the training files. My dataset is a folder containing .jpg images. Can you please help me here? Thanks in advance!

Config file that I am using :

model:
    name: 'SelfSupModel'
    optimizer:
        name: 'Adam'
        depth:
            lr: 0.0002
        pose:
            lr: 0.0002
    scheduler:
        name: 'StepLR'
        step_size: 30
        gamma: 0.5
    depth_net:
        name: 'DepthResNet'
        version: '50pt'
    pose_net:
        name: 'PoseNet'
        version: ''
    params:
        crop: 'garg'
        min_depth: 0.0
datasets:
    augmentation:
        image_shape: (192, 640)
    train:
        batch_size: 4
        dataset: ['Image']
        path: ['/disk1/dan/datasets/vgg-faces/train']
        split: ['train_split.txt']

    validation:
        dataset: ['Image']
        path: ['/disk1/dan/datasets/vgg-faces/val']
        split: ['val_split.txt']

checkpoint:
    filepath: '/disk1/dan/Naman/packnet-sfm-0.1.2/experiments1'
    monitor: 'abs_rel_pp_gt'
    monitor_index: 0
    mode: 'min'