Commit Graph
61 Commits
Author SHA1 Message Date
Jonáš Kulhánek 3a90cb529f Fix #2843 - safer typing (#2848) 2024-01-30 11:06:17 -08:00
Jonáš Kulhánek 4779f816d6 Add flag to disable apperance embedding (#2843) 2024-01-29 23:07:37 +00:00
J.Y d8b517d6a5 Add average_init_density to improve robustness of nerfacto training (#2834) 2024-01-28 14:09:27 -08:00
Matthew Hoffman f0aadf9de8 Use ruff as linter and formatter (#2765)
* Switch from black to ruff format

* Sort dependencies with ruff check

* Run ruff format
2024-01-15 13:43:14 -08:00
Ethan WeberandBrent Yi 4c627edbac Encoder + MLP combo (#2063)
* adding encoder + mlp combo

* update documentation

* minor fixes

* fixed issue when tcnn isn't installed

---------

Co-authored-by: Brent Yi <yibrenth@gmail.com>
2023-12-01 03:16:42 +00:00
Justin Kerr e694f341a7 Move camera optimization out of datamanager and parallelize dataloading (#2092) 2023-10-10 14:52:25 -07:00
Maxim BonnaerensandMatthew Tancik 52f26e82b3 Do not materialize mlp_head if no field_heads (#2457)
In case it is used in a proposal network we avoid initializing the head.

Co-authored-by: Matthew Tancik <matt@lumalabs.ai>
2023-09-22 15:36:51 +00:00
Jonáš Kulhánek ef2fd3dbe1 Fix import error when tcnn installed but CUDA runtime not available (#2429) 2023-09-15 17:18:23 -04:00
Yueh-Cheng Liu 劉岳承andMatthew Tancik 8cd9beccd5 Fix arguments that are not passed from config to NerfactoField (#2186)
* Fix arguments that are not passed from config to NerfactoField

* Add comments

* Reset base_res and features_per_level config of nerfacto-big and nerfacto-huge to default to match the original behavior

---------

Co-authored-by: Matthew Tancik <matt@lumalabs.ai>
2023-07-15 14:24:37 +00:00
Saurav Maheshkar 0cb98fbdd8 refactor: get_normalized_directions (#2216)
* refactor: normalized_directions

* fix: directions shape
2023-07-14 05:44:07 +05:30
hyperzy e9a5a66a54 Default fied_heads with instances will cause shared parameters (#2197)
* - Bug report. Modified the default parameters of NeRFField to avoid shared RGBFieldHead

* - Modified to ensure minimal changes

* - Modified type checking
2023-07-11 12:02:48 -04:00
Daniel CrispellandBrent Yi 8ed2a2d667 Make all SDFFieldConfig params configurable via constructor (#2167)
Co-authored-by: Brent Yi <yibrenth@gmail.com>
2023-07-03 21:00:38 +00:00
Matthew Tancik 061d691d43 Default to tcnn (#2159) 2023-07-02 21:36:28 -07:00
Brent Yi d6bb8bd8e5 Fix use_appearance_embedding for instant-ngp (#1999)
* Attempt fixes for instant-ngp

* Run `ns-dev-test`

* Remove NGP field implementation

* Test nerfacto field instead of ngp field

* Black
2023-07-01 18:54:27 +00:00
Konstantin Kozlovtsev 000272f895 Fix unnecessary encodings calculation in tensorf field (#2145)
Fixed unnecessary encodings calculation in tensorf field
2023-06-29 09:54:59 -07: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
LSong 10dab142d0 Move out NeRFPlayer: clean files and add method link (#2072)
* clean files and add method link

* fix black

* update
2023-06-14 13:51:09 -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
Matthew Tancik 27e2c874cb Report tcnn import errors (#1969) 2023-05-22 09:36:00 -07: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
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
Matthew Tancik 8b9574bb5a Type fixes and cleanup (#1937) 2023-05-16 18:47:46 -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
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
Daniel Crispell cf74119adc SceneContraction maps to range [-2, 2], not [-1, 1]. (#1872) 2023-05-04 10:04:30 -07:00
Sophus 68f2edcb05 Fix torchfield #1749 #1539 (#1859)
* fix bugs in TorchNerfactoField

* remove unused package
2023-05-04 09:25:30 -07:00
Milan van Wouden cc80a331aa Fix typos in SDF Field (#1860) 2023-05-03 08:00:51 -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
Saurav Maheshkar de6af6c4e5 feat(fields): create common get_normalized_directions fn (#1599)
* feat(fields): create common get_normalized_directions fn

* style: run black

* refactor: rename func and update docstring
2023-03-14 22:55:48 +05:30
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
Georgy Ponimatkin f48fa6a923 Instant ngp args (#1549)
* Expand instant-ngp args.

* Fixed misplaced string.
2023-03-02 23:49:30 +01:00
Saurav Maheshkar 258ee26983 feat(fields): Improve Type Hints (#1524)
* feat(fields/tensorf_fields): Improve Type Hints

* feat(fields/base_field): Improve Type Hints

* feat(fields/density_fields): Improve Type Hints

* feat(fields/instant_ngp_field): Improve Type Hints

* feat(fields/nerfacto_field): Improve Type Hints

* feat(fields/nerplayer_nerfacto_field): Improve Type Hints

* fix(fields/nerplayer_nerfacto_field): add typing imports

* feat(fields/nerfplayer_ngp_field): Improve Type Hints

* feat(fields/nerfw_field): Improve Type Hints

* feat(fields/semantic_nerf_field): Improve Type Hints

* feat(fields/vanilla_nerf_field): Improve Type Hints

* fix(fields/nerfplayer/nerfacto_field): reorder imports

* fix(feilds): str -> FieldHeadNames

* fix: remove Optionals

* fix: add missing comma
2023-02-27 13:22:56 -08:00
Fernando Rivas-ManzanequeandMatthew Tancik 9053643932 Volinga model and NVOL documentation (#1486)
* added volinga model to NeRFStudio

* Removed unused dependencies

* Modified dockerfile to match main

* Corrected typo in core_code_checks.yml

* Corrected typo in core_code_checks.yml

* updated test with Volinga

* Added conversion to NVOL documentation

* [WIP] Refactor documentation and removing Volinga config

* Volinga use existing NerfactoModelConfig

* Added Unreal Engine documentation to extensions

* removed unused field class import

* Updated docs

* Documentation ready

* Update Dockerfile

---------

Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
2023-02-25 14:49:53 -08:00
Ruilong Li(李瑞龙) 7dc7129cf8 fixes for nerf synthetic dataset (#1507)
* fixes for nerf synthetic dataset

* restore eval script

* fix format with black
2023-02-25 14:37:10 -08:00
Nikhil Mohanandmachenmusik a91b92f89d semantic_nerfw_configurability (#1467)
* fix semseg vis

* semantic configs

* change defaults

* Fix type

* format

* fix imports

* suggested fix for issue 1465

* fix docstring placement; avoid log spam and runtime errors

`nerfstudio\models\semantic_nerfw.py:81: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
  self.colormap = torch.tensor(self.semantics.colors).to(self.device)`

* hide semantics output choice, since it kills the viewer

* revert some changes

* caps

* move both image and mask to GPU to avoid runtime error

as suggested in https://github.com/nerfstudio-project/nerfstudio/issues/1465#issuecomment-1441117562

---------

Co-authored-by: machenmusik <machenmusik@users.noreply.github.com>
2023-02-22 22:21:04 -05:00
NCJ 92cadf5ce4 Fix Multiple Typos (#1376)
fix multiple typos
2023-02-08 10:33:23 -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
matsurenandMatthew Tancik 408ab709ec Fix typo (#1231)
* Fix typo COLAMP->COLMAP

* Fix more typo

Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
2023-01-16 12:12:55 -08:00
Dreek Fire 5710b09b6d Add hashmap size and num_levels to instant_ngp_field, issue 1158 (#1196)
add hashmap size and num_levels to instant_ngp_field, issue 1158
2022-12-31 23:30:27 -08:00
Matthew Tancik b375727f7e Update docstrings (#1165) 2022-12-23 14:20:48 -07:00
Terrance Wang 008cc8f144 change normals grad calculation (#1108)
* change normals grad calculation

* changing normal calc
2022-12-13 12:39:41 -08:00
Matthew Tancik 676f816156 Bump max res default (#1106) 2022-12-11 13:03:35 -08:00
Zak Murezandzmurez a7df91edc8 config nerfacto (#1020)
Co-authored-by: zmurez <zmurez@eng.ucsd.edu>
2022-11-27 15:56:06 -08:00
Julian Knodt 0d3cfe2d38 bugfix: AABB normalized_positions to [-1, 1] (#998)
AABB normalized_positions to [-1, 1]

Previously, SceneBox.get_normalized_positions() returned a value in 0,1.
This was fine for InstantNGP and Nerfacto, which use these values directly in an MLP.
For TensoRF though, this was an error because grid sample expects values in the range [-1,1].
Thus, I think only 1/4th of the encoding planes were actually being used, and half of the
encoding lines were.
2022-11-21 12:15:01 -08:00
b829499c12 Computing and predicting normals (#905)
* staring normals PR

* code runs but visualization looks bad

* Camera and world coordinate conventions (#889)

* documented coordinate conventions without a figure for now

* another sentence

* update frames docs

* explain intrinsics and extrinsics

* more comments

* fix build

* Start viewer with more accurate speed calculation (#899)

Start viewer with more accurate speed calc

* Minor doc updates (#903)

* fix conflicts

* code runs but visualization looks bad

* normals implemented and vis fixed. still debugging quality

* minor name change

* comment

* fix black

* lint

* predicting normals

* adding detach

* predicted normals

* improved normals prediction performance

* cleaning code

* cleaning code

* cleaning code

* adding type to function param

* fixing tensorf forward func

* reverting tensorf changes

* fix style with tensorf field

* adding normals check to tensorffield

Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
Co-authored-by: terrance <terrance.3512@gmail.com>
2022-11-20 13:22:37 -08:00
Matthew Tancik 4b65180a57 Add missing activation (#933) 2022-11-10 13:27:10 -08:00
Nikhil Mohan 1a24f3e58c Refactor Data Pipeline (#896)
* add none check

* black formatting

* cleanup

* cleanup

* fix tests

* remove new line

* init

* toy example working

* semantic nerf working

* simplify pixel samplers

* cleanup + fix tests

* comments

* fix tests

* fix tests
2022-11-06 07:40:43 -08:00