Skip to content

fix(foundation-stereo): run_hierachical passes tuple to (+1 more) - #65

Draft
andrewwhitecdw wants to merge 1 commit into
NVlabs:masterfrom
andrewwhitecdw:bugfix/foundation-stereo-assorted-bd440f29
Draft

fix(foundation-stereo): run_hierachical passes tuple to (+1 more)#65
andrewwhitecdw wants to merge 1 commit into
NVlabs:masterfrom
andrewwhitecdw:bugfix/foundation-stereo-assorted-bd440f29

Conversation

@andrewwhitecdw

@andrewwhitecdw andrewwhitecdw commented Jul 27, 2026

Copy link
Copy Markdown

Small fixes in core/foundation_stereo.py:

fix: run_hierachical passes tuple to padder.unpad

Fix: Replace:

      disp = self.forward(image1, image2, iters=iters, test_mode=test_mode, low_memory=low_memory, init_disp=init_disp)
      disp = padder.unpad(disp)
      return disp

with:

      disp = self.forward(image1, image2, iters=iters, test_mode=test_mode, low_memory=low_memory, init_disp=init_disp)
      if test_mode:
        disp = padder.unpad(disp)
      else:
        init_disp, disp_preds = disp
        init_disp = padder.unpad(init_disp)
        disp_preds = [padder.unpad(d) for d in disp_preds]
        disp = (init_disp, disp_preds)
      return disp

fix: wrongly adds horizontal padding to disparity values

Fix: Replace:

      image1, image2, disp_small_up = padder.pad(image1, image2, disp_small_up)
      disp_small_up += padder._pad[0]
      init_disp = F.interpolate(disp_small_up, scale_factor=0.25, mode='bilinear', align_corners=True) * 0.25   # Init disp will be 1/4

with:

      image1, image2, disp_small_up = padder.pad(image1, image2, disp_small_up)
      init_disp = F.interpolate(disp_small_up, scale_factor=0.25, mode='bilinear', align_corners=True) * 0.25   # Init disp will be 1/4

Files changed

  • core/foundation_stereo.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant