Skip to content

Commit

Permalink
Merge pull request yenchenlin#35 from WillBrennan/feature/replace-sea…
Browse files Browse the repository at this point in the history
…rchsorted

replace searchsorted with in-built function
  • Loading branch information
yenchenlin authored Jun 21, 2021
2 parents ec26d1c + 434e781 commit f1e5b3f
Show file tree
Hide file tree
Showing 20 changed files with 4 additions and 914 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ This project is a faithful PyTorch implementation of [NeRF](http://www.matthewta
git clone https://github.com/yenchenlin/nerf-pytorch.git
cd nerf-pytorch
pip install -r requirements.txt
cd torchsearchsorted
pip install .
cd ../
```

<details>
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
torch>=1.4.0
torchvision>=0.2.1
torch>=1.8
torchvision>=0.9.1
imageio
imageio-ffmpeg
matplotlib
configargparse
tensorboard==1.14.0
tensorboard>=2.0
tqdm
opencv-python
5 changes: 1 addition & 4 deletions run_nerf_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import torch.nn.functional as F
import numpy as np

# TODO: remove this dependency
from torchsearchsorted import searchsorted


# Misc
img2mse = lambda x, y : torch.mean((x - y) ** 2)
Expand Down Expand Up @@ -223,7 +220,7 @@ def sample_pdf(bins, weights, N_samples, det=False, pytest=False):

# Invert CDF
u = u.contiguous()
inds = searchsorted(cdf, u, side='right')
inds = torch.searchsorted(cdf, u, right=True)
below = torch.max(torch.zeros_like(inds-1), inds-1)
above = torch.min((cdf.shape[-1]-1) * torch.ones_like(inds), inds)
inds_g = torch.stack([below, above], -1) # (batch, N_samples, 2)
Expand Down
158 changes: 0 additions & 158 deletions torchsearchsorted/.gitignore

This file was deleted.

29 changes: 0 additions & 29 deletions torchsearchsorted/LICENSE

This file was deleted.

89 changes: 0 additions & 89 deletions torchsearchsorted/README.md

This file was deleted.

71 changes: 0 additions & 71 deletions torchsearchsorted/examples/benchmark.py

This file was deleted.

Loading

0 comments on commit f1e5b3f

Please sign in to comment.