Commit Graph
76 Commits
Author SHA1 Message Date
emma be37bcddea Remove an outdated comment in RayGenerator class (#2606)
clean up comment
2023-11-14 08:21:03 +00:00
Maxim BonnaerensandBrent Yi 793fca55e6 Make resetting the near_plane in NearFarCollider optional. (#2465)
* Make resetting the near_plane in NearFarCollider optional.

It is not always desired to reset the near plane to 0.0 during inference.
Added an optional flag.

* no need to change precision

* Update scene_colliders.py

---------

Co-authored-by: Brent Yi <yibrenth@gmail.com>
2023-10-27 13:55:39 -07:00
Justin Kerr e694f341a7 Move camera optimization out of datamanager and parallelize dataloading (#2092) 2023-10-10 14:52:25 -07:00
Maxim Bonnaerens 53037ba8a7 Allow custom sampler in ProposalNetworkSampler (#2464)
* Allow custom sampler in ProposalNetworkSampler

This allows custom (pdf)samplers in distinct repositories while still
using the base ProposalNetworkSampler.

* sampler should inherit from pdf sampler

* docstring
2023-09-24 12:06:16 +02:00
Maxim BonnaerensandBrent Yi cc98fb6bd4 Fix benchmarking: apply get_background_color in renderer and set profiler to none (#2397)
* apply get_background_color and set profiler to none

* Apply override first

---------

Co-authored-by: Brent Yi <yibrenth@gmail.com>
2023-09-11 18:07:52 +00:00
85ef567682 Flesh out viewer beta (#2086)
* Increase max_res of first proposal network

* fix render statemachine logic for viewer beta

* clicking on cameras in the viewer

* fix fov calculation, update camera positions while training

* cleanup

* backup

* fix configure theme

* Fix theme configure for latest dev version of viser

* Fix runtime errors

* add set up direction button

* add pause resume button

* Export panel

* Render tab skeleton

* make responsiveness more snappy by stopping training

* depth composite

* start implementing viewercontrol in new viewer

* refactor background img to use depth and add depth layering option

* show/hide images

* speed up rendering

* fix crop color background

* crop

* rotated crops

* rotated crops

* transform handle on crop box

* fix xyzw for crop

* oriented crop export for pointclouds, not for meshes yet

* Initial render panel

* Fix export button

* Theme tweaks

* fix background issue in cropping

* export rotated poisson meshe

* double normals definition in export panel

* Visual nits

* remove tsdf from export panel

* Add licenses

* Fix some CI errors

* Type fixes

* Fix tests

* Fix numpy broken

* various bugfix

---------

Co-authored-by: Brent Yi <yibrenth@gmail.com>
Co-authored-by: terrancewang <terrance.3512@gmail.com>
2023-09-08 05:10:00 +00:00
Maxim Bonnaerens 242c23f0f0 cast background to device (#2381)
* cast background_color to device

* make onliner instead
2023-08-29 15:07:43 -07:00
Justin Kerr d56338bce1 Fixes crop background color override (#2373)
fix crop color background
2023-08-27 11:50:57 -07:00
6e37b2b542 Enable SparseNerf depth ranking loss to be used with GT/Sensor depth (#2312)
* add ranking loss to depth-nerfacto with GT depth

* formating

* pair pixel sampler bug fix from pr #2315

---------

Co-authored-by: Sasha Sax <asax@stanford.edu>
Co-authored-by: Ethan Weber <ethanweber@berkeley.edu>
Co-authored-by: AdamRashid96 <abrashid@berkeley.edu>
Co-authored-by: AdamRashid96 <71362382+AdamRashid96@users.noreply.github.com>
2023-08-26 02:56:52 -07:00
71c6b9cf3d Monodepth Regularization (#2284)
* monodepth implemented

* device

* pair pixel sampler

* docstring

* removing unused imports

* fix bugs

* cache in cache dir, no longer edit json file

* moving to depth nerfacto

* fixed bug using median depth by accident

* removing depthdataset from nerfacto

* added pixelsamplerconfig

* added equirectangular warning back

* bug fix

* delete sample_config.py + small fixes

* rename to pixel_sampler

* cleaning

* test

* passing num_rays_per_batch properly

* fixed transforms typo

* renaming in nerfacto

* remove depth files from test data

* removed defaulting to base pixel sampler with mask

* adding patch_size back

---------

Co-authored-by: AdamRashid96 <abrashid@berkeley.edu>
Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
2023-08-01 18:52:47 -07:00
hturki 4d80f0ceee Use correct pixel area in volumetric sampler (#2268) 2023-07-25 18:05:40 -07:00
hturki 4f2157cd58 support packed samples in semantic renderer (#2247) 2023-07-20 09:48:25 -07:00
Nicholas PfaffandJonas Kulhanek 9f487a464f Implement nerfacto alpha transparency training (#2165)
* Implement nerfacto alpha transparency training

* Stop adding all ones alpha channel and clean up blend_background

* Make background_color a required argument in blend_background

* Enable alpha transparent training by default

* Improve background_color typing

* Blend uniform background color for metric computation

* Fix typing error

* Clean up typing

* Fix background_color to outputs assignment

* Model outputs returns unblended RGB (black bg) for random bg

* Update renderers

* Fix comments

* Add support for transparent BG for other methods

* Minor refac

* Fix get_background_color

* Fix typing error for blend_background

* Fix comments

* Export utils support transparency

* Pylint fix

* Fix pcd export masking

* Filter pcd view directions based on opacity

* Clean up get_rgba_image

---------

Co-authored-by: Jonas Kulhanek <jonas.kulhanek@live.com>
2023-07-18 12:54:52 +02:00
b17268e83b [WIP] dreamfusion implementation (#1008)
* starting the framework for dreamfusion

* Removed view direction from RGB to calculate albedo

* Started diffusion

* Added dreamfusion to CLI, removed direction embeddings

* Normals in dreamfusion

* Lambertian shading added

* Train normals in Dreamfusion

* Stable diffusion from Stable Dreamfusion

* Fix normal orientation loss

* Configurable light direction sampling

* adding density initalization at origin

* V1 datamanager

* Don't train normals for first 1k iters

* SDS loss added to dreamfusion

* Dreamfusion pipeline

* Background MLP and SphereCollider

* Normals prediction training fixed

* Sigmoid on background, prompt in config

* Shading hyperparameter adjustements

* Shading hyperparameter tuning

* Location based prompting, density initialization fades, LR change

* Cleaned imports, more config options

* Tuning, more config changes

* remove unused sampler, normalize predicted normals from network

* change position encoding to direction encoding for background color mlp

* Updating dreamfusion to use custom trainer, fixed bug, multi-gpu support (put diffusion on one specific device), merged with main

* Hard coding less, offloading to config

* Appeasing the linter

* First pass opacity / sparsity losses

* Small patches and configs

* Accidentally pushed logs

* Removing logs for real this time

* Transmittance loss bug fix

* 12 GB Dreamfusion!

* Lint

* Remove unecissary collider changes

* Start SD cleanup

* Cleanup SD code

* adding overhead location prompting

* Use lambertian renderer

* turn grad accum off by default, decrease background mlp size, add overhead text embedding

* Cleanup

* Fix normals vis

* change uniform sampler to prediction network, add option to jit unet for faster sds_loss

* Use shaders

* cleaning up jit code

* add warning if using non jit unet

* add proposal network optimizer to config

* speed up render and cleanup code

* Clean up datamanager

* Add distortion loss

* fix wanb

* adding interpolated location sampling

* Update configs

* interpolated location prompting option, lowering init density, transmittance loss interpolation flipped

* rename alphas mult to alphas loss mult

* Mess around with normals

* add option to use random bg color + bg mlp

* Remove Dreamfusion Trainer (#1423)

* Dreamfusion trainer no longer needed

* Added typing for grad scaler

* SDS return loss

* Fix CFG

* Cleanup

* Update configs

* Fix opacity loss, use unform sampling first round of prop

* add prompt edditing to viewer

* Choose your own diffusion

* remove dreamfusion pipeline file

* merging + remove dreamfusion pipeline file

* Update configs

* add stable diff utils

* cleanup

* cleanup

* Fix test

* positional prompting bugfix

* Warmups

* tune

* lint

* Remove dataparser

* merging + text embedding bugfix

* Set data path to launch viewer for DreamFusion (#1776)

* Set data path to launch viewer for DreamFusion

* Apply formatter

* Fallback to 'base_dir' if data manager has no path

* Make if statement non-inline

* Reformat

---------

Co-authored-by: Matthew Tancik <mattt4001@gmail.com>

* add deepfloyd option first try

* merging

* merging from main

* merging

* removing comments, cleaning code, making stable diff utils usable for deepfloyd, remove deepfloyd text encoder after use

* undo chagnes in data folder

* cleaning code, removing unneccesary changes from main, removed normals prediction network

* remove old scripts files, rename generative pipeline flag to no_input_data, revert to default histogram padding in proposal sampler

* changing pipeline flag

* move no input data flag from pipeline to datamanager

* undo config and merge in deepfloyd from main

* merging grad scaler pipeline addition

* merging + setting proposal net scheduler

* revert nerfacto config change

* typing + linting

* rename dreamfusion datamanager to random camras datamanager, check datamanager typing in pipeline and trainer

* fix test import

* fix test import

* changing datamanager check in trainer, add typing in random cameras datamanager

* add Tensor to randomcamerasdatamanager

* remove old comments

* resolve tyro warning

* update fields to use tcnn

* lint

* add packages for deepfloyd

* add versions

* docs first draft

* rename to generfacto, clean docs

* fix import error

* minor changes

* fix orientation loss bug, retune params

* cleanup

* typing

* trying docs fix

* fixing generative package imports

* fix pyright

* docs fix

* merge w main

* docs minor change

* tuning + bugfixes

* remove torch.backends

---------

Co-authored-by: Abhik Ahuja <ahujaabhik@berkeley.edu>
Co-authored-by: David McAllister <davidrmc2@gmail.com>
Co-authored-by: Jake Austin <jake-austin@berkeley.edu>
Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
Co-authored-by: Matt Tancik <mattt4001@gmail.com>
Co-authored-by: SeungWoo Yoo <dreamy1534@gmail.com>
Co-authored-by: ayaanzhaque <ayaanzhaque@gmail.com>
Co-authored-by: Ayaan Haque <ayaanzhaque@berkeley.edu>
2023-06-17 23:34:04 -07:00
Justin Kerr 8fad92c39a nerfacto-huge (#2003)
An even larger version of nerfacto with scaled hashgrid resolution, MLP sizes, batch sizes, appearance embeddings, proposal sampler resolution, and more.
Also includes some minor tweaks to nerfacto-big configs
2023-06-15 11:05:53 -07:00
Ethan WeberandEthan Weber bb6925bac6 Ability to use vanilla pytorch instead of tcnn for Nerfacto (#1936)
* started a package to easily swap out tcnn for pytorch

* trains with pytorch and not tcnn

* cleaned up imports

* making it easy to install on mac

* removed/reverted files

* merged main

* reverted changes

* updating config

* starting to add nerfacto to tests

* fixxing default value

* fixed default implementation

* defaults to torch if tcnn and not installed

* update log

* add comment

* resolved pr comments

* fix

* update default

---------

Co-authored-by: Ethan Weber <ethanweber@eecs-128-32-175-250.dhcp.berkeley.edu>
2023-05-25 14:55:42 -07:00
Milan van Wouden d413ca4204 fix large number of typos in repository (#1977)
* fix large number of typos in repository

* fix typos in tests
2023-05-23 10:41:49 -07:00
Jonáš Kulhánekandmachenmusik 3bc160cc7d Backward compatibility for torch 1.x and fix for windows (#1962)
* backward compatibility for torch 1.x and fix for windows

* Update pyproject.toml

* Update README.md

* Update README.md

(As per request)

---------

Co-authored-by: machenmusik <machenmusik@users.noreply.github.com>
2023-05-22 08:58:08 -07:00
Matthew TancikandBrent Yi 2b0831b6d4 Final typing fixes + add Pyright to CI (#1944)
* knocking out a couple

* Fix more errors

* Add pyright

* Remove some unnecessary cv2 type ignores, warning on missing imports
(for missing tinycudann)

* Minor annotation fixes

* Update docs

* Drop `None` from temporal distortion output

---------

Co-authored-by: Brent Yi <yibrenth@gmail.com>
2023-05-18 02:25:34 -07:00
Jonáš Kulhánek 08e3a1f1a6 Drop backward compatibility for Torch 1.13 (#1948)
* Drop backward compatibility for Torch 1.13

* Fix lint errors
2023-05-18 09:12:51 +02:00
Jonáš KulhánekandBrent Yi f481f5ebec Fix some typing problems (#1940)
* Fix some typing problems

* nerfstudio.data typing error fixes

* Add tiny fixes

* Remove ABC from pipeline

* Prevent circular imports

* Tweak ModuleList typing

* TrainingCallbackAttributes cleanup

* Various minor nits

* More nits

* Run `ruff`

---------

Co-authored-by: Brent Yi <yibrenth@gmail.com>
2023-05-17 17:36:56 -07:00
e898f562e6 Switching to Torch 2.0 by default. (#1922)
* Update requirements for torch 2.0

* Update docs

* Fix missing _LRScheduler import

* Fix pylint issues

* Update docs, drop 1.13

* Fix pip postfix version

* fix docs

* Allow python 1.13 (for now)

* Minor fix for torch.compile

* Switch to torch.compile

* ruff

* Fix test

---------

Co-authored-by: Matt Tancik <mattt4001@gmail.com>
Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
2023-05-17 16:03:17 -07:00
Brent YiandMatt Tancik d542646c72 Switch to ruff (#1939)
* `isort` -> `ruff`

* `pylint` -> `ruff`

* Remove line

* More minor cleanup

* Better documentation for rules we are enabling

* Fix gitignore, run black

* vscode settings

---------

Co-authored-by: Matt Tancik <mattt4001@gmail.com>
2023-05-17 10:08:14 -07:00
Brent Yi 814db32ec4 More typing fixes (#1941)
* Fix more types

* Fix tests

* Minor cleaning

* Address comments

* Resolve linting errors

* Re-ignore pymeshlab type

* Add extra assert / error message to mipnerf model
2023-05-17 07:17:40 -07:00
Brent YiandMatt Tancik 6ba2a18b2b torchtyping => jaxtyping (#1838)
* Run `ruff --fix`

* Add jaxtyping migration script

* Run migration scripts + ruff + black

* Merge remote-tracking branch 'origin/main' into brent/jaxtyping

* black

* Fix lint

* fix lint

* Cleanup and more specific types

* Fixed annotation errors

* Fix more errors

* Fix annotation

* Delete _torchtyping_to_jaxtyping.py

---------

Co-authored-by: Matt Tancik <mattt4001@gmail.com>
2023-05-16 15:57:47 -07:00
Ethan Weber 13e0fce122 Update copyright (#1917)
* updated copyright

* including txt file

* updated black

* removing license

* fixing license
2023-05-12 16:16:13 -07:00
Jonáš Kulhánek 02f449b661 Implement gradient scaling (#1901)
* Implement gradient scaling

* Make grad scaling more general

* Fix pylint errors

* Fix lint error + change gradient scaling

* Fix issues with grad scaling

* Fix linting errors
2023-05-12 07:23:41 +02:00
Yan XiaoandYan Xiao 38cbb0f358 implementing l1 and tv reg in the original tensorf paper (#1855)
* implementing l1 and tv reg in the original tensorf paper

* added documentation for tv loss

* added test for tv loss

* fix formating

* fix formatting

---------

Co-authored-by: Yan Xiao <yax010@ucsd.edu>
2023-05-09 09:32:51 -07:00
Brent Yi 63c6303736 Bump minimum Python version to 3.8 (#1876)
* Bump minimum Python version to 3.8

* typing_extensions.Literal -> typing.Literal

* ns-dev-test

* typing_extensions.get_args => typing.get_args

* Format with older version of black

* Bump `black`

* Run black
2023-05-06 13:29:48 -07:00
Ruilong Li(李瑞龙) ea2993d5b1 Update NGP related models with nerfacc 0.5.2 (#1809)
* profiling

* set pose_optimizer to None if it's mode is "off"

* radial_and_tangential_undistort in nerfacc

* fix camera distortions

* update to nerfacc 0.5.1. Upgrade instant-ngp model.

* revert nerfacc to 0.5.1

* format

* allows to fall back to the pytorch undistortion

* format

* fix linting

* fix test

* fix test

* fix nerfplayer-ngp

* enable_collider=False for NGP

* nerfplayer verified.

* zero cone_angle for ngp bounded

* fix format

* fix pylint
2023-04-24 17:11:30 -07:00
wang shuai 24b3db8eb0 Fix bug: sh render is not correct (#1667)
* Update renderers.py

revise the SH renderer

* Update test_renderers.py

change the test target for sh render
2023-03-28 07:58:21 -07:00
Matt Tancik 3ec8c06e83 Cleanup 2023-03-22 14:37:05 -07:00
Pablo Vela ddfa463f4d NeuS Implementation (#1444)
* add initial method configs and data manager

* add neus scheduler

* add initial surface model and neus

* add Neus ray sampler

* add sdf field

* move scale/shift calc to math utils

* add debug and fix sdf_dataset typo

* update vscode neus debug

* fix dataset and get initial working version

* add magic number from original repo

* black fixes

* clean up get weights/transmittance from alphas

* clean up typos in sdf datamanager

* type annotations on neus scheduler and remove unused params

* clean up and annotate sdf field along w/ other fixes

* more clean up

* remove unnessary directions norm

* resolve comments

* update neus scheduler to follow refactor

* fix linter errors

* fix some typos

* remove get_weights_from_alpha

* more comment fixes

* more linter error fixes

* clean up and add comments

* more little fixes for types/comments

* more comments

* rename NeuS Scheduler to DelayedScheduler

* rename DelayedScheduler to CosineDecayScheduler
2023-03-12 16:01:18 -04:00
Koke_Cacao edb54602da Bug fix for SHRenderer() (#1526)
The current SHRenderer does not apply the activation function correctly due to a typo. Now it's fixed.
2023-02-27 10:40:17 -08:00
Sacha Lewin 151b1060fe Uniform Sampler in Nerfacto (#1464)
* Allow black/white background color in Nerfacto

* Use white background in Nerfacto Blender Benchmark

* Fixed unused import

* Updated index for license headers script

* Removed debug code in NGP models

* Uniform initial sampler config in Nerfacto

* Undo changes in settings.json

* Removed unwanted settings file

* Removed unneeded config parameter

* Use uniform sampler on Blender benchmark
2023-02-21 09:17:57 -08:00
Sacha Lewin 8e4ae6bebf Allow use of black or white background in Nerfacto models (#1441)
* Allow black/white background color in Nerfacto

* Use white background in Nerfacto Blender Benchmark

* Fixed unused import

* Updated index for license headers script
2023-02-17 20:39:10 -08:00
Matthew Tancik 2357332e66 Proposal network initial sampler (#1435)
Allow first proposal sampling method
2023-02-15 15:35:08 -08:00
Pablo Vela 6619dd1ac2 add monosdf normal loss and midas scale invariant depth loss (#1410)
* add monosdf normal loss and midas scale invariant depth loss

* add context to scale/shift calc and normal loss, consolidate MidasMSE loss

* consolidated, add info on gradient reg term

* add info on ssi

* more documentation and type annotation

* move compute scale/shift to class

* fix pylint errors

* fix tensortype error

* fix comments

* change single var name and update comment

* fix input tensortype

* fix black error

* fix mask shape
2023-02-15 13:49:35 -06:00
NCJ 92cadf5ce4 Fix Multiple Typos (#1376)
fix multiple typos
2023-02-08 10:33:23 -08:00
Yiming Zhou 8c9c2ba2ab Add support for sparse depth maps (#1373)
Add support for sparse depth maps (#2)

* sparse depth maps

* pr comments

* unified loss

* minor

* lint
2023-02-07 16:26:05 -08:00
Matthew Tancik 59d7e99c80 Create shaders (#1344) 2023-02-03 11:21:54 -08:00
Jeffrey Hu a0976d1ff8 Fix depth-supervised nerf when using z-buffer depth. (#1340)
* fix z buffer depth

* remove script
2023-02-02 18:22:55 -08:00
Matthew Tancik 2e79c93cd2 Fix normals visualization (#1341) 2023-02-02 18:06:11 -08:00
cf1794acb1 Add lambertian renderer (#1336)
* add lambertian shading renderer

* adding more functionality

* adding to comments

* optionally detach normals, fixing naming and typing

* Update description

---------

Co-authored-by: Matt Tancik <mattt4001@gmail.com>
Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
2023-02-02 13:07:14 -08:00
LSongandmachenmusik e73692e599 nerfplayer with ngp and nerfacto (#1277)
* nerfplayer with ngp and nerfacto

* update comments

* update cpp extension build

* avoid Windows repeated CUDA compile

---------

Co-authored-by: machenmusik <machenmusik@users.noreply.github.com>
2023-01-31 11:56:28 -08:00
Matthew TancikandDavid McAllister 61dc520e17 Add sphere collider (#1310)
Co-authored-by: David McAllister <davidrmc2@gmail.com>
2023-01-30 10:55:13 -08:00
Matthew TancikandAbhik Ahuja 8c41a263b8 Fix normal orientation loss (#1298)
Co-authored-by: Abhik Ahuja <ahujaabhik@berkeley.edu>
2023-01-27 13:56:19 -08:00
Matthew Tancik 90489b5a6d Allow users to modify background color when cropping (#1289) 2023-01-25 17:47:45 -08:00
2120bd5dd9 CropBox GUI implementation (#1205)
* fixed an exception bug in case of num_samples is 0

fixed an exception bug when num samples is 0 , 
"IndexError tensors used as indices must be long, byte or bool tensors"

change type to long ( was float32)

* implemented crop box in gui. For now works on instant-ngp-bounded

* fixed import bugs

* update aabb every time and not only on training

* prevent crash when chosing accomulation and crop box

* Checkbox

* max_box is bounded by scevne box in the gui

* implemented altenative intesection to nerfacc

* convert str to bool correctly

* fixed isort bug

* fixed isort bug2

* update viewer version

* remove json bug

* Update UI

* Force black background

* Fix formatting

Co-authored-by: dror <you@example.com>
Co-authored-by: Matt Tancik <tancik@berkeley.edu>
Co-authored-by: Matthew Tancik <mattt4001@gmail.com>
2023-01-19 17:39:37 -08:00
hturkiandMatthew Tancik bd1060ee83 save image_coords as non-persistent buffer (#1216)
Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
2023-01-16 15:21:44 -08:00