Skip to content

Commit

Permalink
Updating FlyingThings3D validation. Updating README.
Browse files Browse the repository at this point in the history
  • Loading branch information
lahavlipson committed Sep 24, 2021
1 parent 3d11137 commit b8a182c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ If the camera focal length and camera baseline are known, disparity predictions

<img src="depth_eq.png" width="320">

Note that the units of the focal length are _pixels_ not millimeters.
Note that the units of the focal length are _pixels_ not millimeters. (cx1-cx0) is the x-difference of principal points.

## Evaluation

Expand Down
18 changes: 10 additions & 8 deletions core/stereo_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,16 @@ def _add_things(self, split='TRAIN'):
right_images = [ im.replace('left', 'right') for im in left_images ]
disparity_images = [ im.replace(self.dstype, 'disparity').replace('.png', '.pfm') for im in left_images ]

with open(osp.join('datasets', 'flyingthings_validation.txt')) as f:
validation_files = set(f.read().splitlines())

for img1, img2, disp in zip(left_images, right_images, disparity_images):
if split == 'TEST' and disp not in validation_files:
continue
self.image_list += [ [img1, img2] ]
self.disparity_list += [ disp ]
# Choose a random subset of 400 images for validation
state = np.random.get_state()
np.random.seed(1000)
val_idxs = set(np.random.permutation(len(left_images))[:400])
np.random.set_state(state)

for idx, (img1, img2, disp) in enumerate(zip(left_images, right_images, disparity_images)):
if (split == 'TEST' and idx in val_idxs) or split == 'TRAIN':
self.image_list += [ [img1, img2] ]
self.disparity_list += [ disp ]
logging.info(f"Added {len(self.disparity_list) - original_length} from FlyingThings {self.dstype}")

def _add_monkaa(self):
Expand Down
Binary file modified depth_eq.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b8a182c

Please sign in to comment.