From 56033b32f55de71c294e2dd8ee2c47c48be3f209 Mon Sep 17 00:00:00 2001 From: Solal Nathan Date: Fri, 22 Jan 2021 11:23:54 +0100 Subject: [PATCH] remove torchsearchsorted dependency --- README.md | 3 --- requirements.txt | 4 ++-- run_nerf_helpers.py | 5 +++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f18bcbe..39dfbf4 100644 --- a/README.md +++ b/README.md @@ -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 ../ ```
diff --git a/requirements.txt b/requirements.txt index 3b1b913..09a7167 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ -torch>=1.4.0 +torch>=1.7.0 torchvision>=0.2.1 imageio imageio-ffmpeg matplotlib configargparse -tensorboard==1.14.0 +tensorboard==1.15.0 tqdm opencv-python diff --git a/run_nerf_helpers.py b/run_nerf_helpers.py index ca270e6..0a3423a 100644 --- a/run_nerf_helpers.py +++ b/run_nerf_helpers.py @@ -5,7 +5,7 @@ import torch.nn.functional as F import numpy as np # TODO: remove this dependency -from torchsearchsorted import searchsorted +#from torchsearchsorted import searchsorted # Misc @@ -232,7 +232,8 @@ def sample_pdf(bins, weights, N_samples, det=False, pytest=False): # Invert CDF u = u.contiguous() - inds = searchsorted(cdf, u, side='right') + # 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)