Skip to content

Commit

Permalink
fix for special case when < 5 frames as input
Browse files Browse the repository at this point in the history
  • Loading branch information
bmild authored May 25, 2020
1 parent ae548c1 commit 889dece
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions llff/inference/mpi_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ def run_inference(imgs, poses, mpi_bds, ibr_runner, num_planes, patched=False, d
dists = np.sum(np.square(poses[:3, 3, i:i+1] - poses[:3, 3, :]), 0)
neighs = np.argsort(dists)

neighs = neighs[1:]
if len(neighs) < 5:
neighs += [i] * (5 - len(neighs))
neighs = list(neighs[1:])
if len(neighs) < 4:
neighs += [i] * (4 - len(neighs))
print( 'Had to extend to', neighs )

# We always use 5 inputs now
Expand Down Expand Up @@ -199,4 +199,4 @@ def render_mpis(mpis, render_poses, use_N,
print('Finished rendering, {} secs'.format(time.time() - t))

outframes = np.stack(outframes, 0)
return outframes
return outframes

0 comments on commit 889dece

Please sign in to comment.