Git Product home page Git Product logo

freenerf_plus_sparsenerf's People

Contributors

wanggcong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

freenerf_plus_sparsenerf's Issues

Does the Blender dataset class support depth rank loss?

I didn't find where to load the depth images in your code:

class Blender(Dataset):
"""Blender Dataset."""
def _load_renderings(self, config):
"""Load images from disk."""
if config.render_path:
raise ValueError('render_path cannot be used for the blender dataset.')
with utils.open_file(
path.join(self.data_dir, f'transforms_{self.split}.json'), 'r') as fp:
meta = json.load(fp)
images = []
disp_images = []
normal_images = []
cams = []
for frame in meta['frames']:
fprefix = os.path.join(self.data_dir, frame['file_path'])
if self.use_tiffs:
channels = []
for ch in ['R', 'G', 'B', 'A']:
with utils.open_file(fprefix + f'_{ch}.tiff', 'rb') as imgin:
channels.append(np.array(Image.open(imgin), dtype=np.float32))
# Convert image to sRGB color space.
image = math.linear_to_srgb(np.stack(channels, axis=-1))
else:
with utils.open_file(fprefix + '.png', 'rb') as imgin:
image = np.array(Image.open(imgin), dtype=np.float32) / 255.
if self.load_disps:
with utils.open_file(fprefix + '_disp.tiff', 'rb') as imgin:
disp_image = np.array(Image.open(imgin), dtype=np.float32)
if self.load_normals:
with utils.open_file(fprefix + '_normal.png', 'rb') as imgin:
normal_image = np.array(
Image.open(imgin), dtype=np.float32)[Ellipsis, :3] * 2. / 255. - 1.
if config.factor > 1:
image = downsample(image, config.factor)
if self.load_disps:
disp_image = downsample(disp_image, config.factor)
if self.load_normals:
normal_image = downsample(normal_image, config.factor)
cams.append(np.array(frame['transform_matrix'], dtype=np.float32))
images.append(image)
if self.load_disps:
disp_images.append(disp_image)
if self.load_normals:
normal_images.append(normal_image)
self.images = np.stack(images, axis=0)
if self.load_disps:
self.disp_images = np.stack(disp_images, axis=0)
if self.load_normals:
self.normal_images = np.stack(normal_images, axis=0)
rgb, alpha = self.images[Ellipsis, :3], self.images[Ellipsis, -1:]
images = rgb * alpha + (1. - alpha) if config.white_background else rgb
self.images_all = images
self.camtoworlds_all = np.stack(cams, axis=0)
if self.split == 'train' and config.n_input_views > 0:
self.images = images[:config.n_input_views]
self.camtoworlds = np.stack(cams[:config.n_input_views], axis=0)
else:
self.images = images
self.camtoworlds = np.stack(cams, axis=0)
self.height, self.width = self.images.shape[1:3]
self.resolution = self.height * self.width
self.focal = .5 * self.width / np.tan(.5 * float(meta['camera_angle_x']))
self.n_examples = self.images.shape[0]

And your example config files are about DTU and LLFF.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.