Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support DreamFusion #1563

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

LeoXing1996
Copy link
Collaborator

@LeoXing1996 LeoXing1996 commented Dec 30, 2022

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

Support Dreamfusion. Refers to https://github.com/ashawkey/stable-dreamfusion

Who can help? @ them here!

BC-breaking (Optional)

Does the modification introduce changes that break the backward-compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

Checklist

Before PR:

  • I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • New functionalities are covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • If the modification has potential influence on downstream or other related projects, this PR should be tested with some of those projects.
  • CLA has been signed and all committers have signed the CLA in this PR.

@LeoXing1996 LeoXing1996 self-assigned this Dec 30, 2022
@zengyh1900 zengyh1900 requested review from junshutang and removed request for seanywang0408 August 4, 2023 07:27
@LeoXing1996 LeoXing1996 changed the base branch from dev-1.x to main August 7, 2023 03:08
@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Patch coverage: 19.77% and project coverage change: -1.72% ⚠️

Comparison is base (5b5f895) 82.23% compared to head (858a650) 80.52%.

❗ Current head 858a650 differs from pull request most recent head a234d8e. Consider uploading reports for the commit a234d8e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1563      +/-   ##
==========================================
- Coverage   82.23%   80.52%   -1.72%     
==========================================
  Files         416      425       +9     
  Lines       27960    28747     +787     
  Branches     4374     4461      +87     
==========================================
+ Hits        22994    23148     +154     
- Misses       4026     4658     +632     
- Partials      940      941       +1     
Flag Coverage Δ
unittests 80.52% <19.77%> (-1.72%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
mmagic/models/editors/dreamfusion/renderer.py 13.88% <13.88%> (ø)
mmagic/models/editors/dreamfusion/camera.py 15.47% <15.47%> (ø)
mmagic/models/editors/dreamfusion/dreamfusion.py 16.00% <16.00%> (ø)
mmagic/models/editors/dreamfusion/vanilla_nerf.py 19.62% <19.62%> (ø)
...ls/editors/dreamfusion/stable_diffusion_wrapper.py 23.40% <23.40%> (ø)
mmagic/engine/hooks/dreamfusion_hook.py 28.94% <28.94%> (ø)
mmagic/datasets/dummy_dataset.py 38.09% <38.09%> (ø)
mmagic/models/utils/tensor_utils.py 75.00% <50.00%> (-25.00%) ⬇️
mmagic/models/editors/dreamfusion/activate.py 69.23% <69.23%> (ø)
mmagic/datasets/__init__.py 100.00% <100.00%> (ø)
... and 3 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


self.clamp_mode = clamp_mode
self.white_back = white_back

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add occupancy grid transmittance estimator for spatial skipping. "nerfacc.OccGridEstimator(roi_aabb, resolution, levels)"

ray_start,
ray_end,
depth_resolution,
perturb=self.training)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sampling with spatial skipping.

ray_indices, t_starts, t_ends = grid.sampling(rays_o, rays_d, render_step_size=1e-3)
t_mid = (t_starts + t_ends) / 2.0
sample_locs = rays_o[ray_indices] + t_mid * rays_d[ray_indices]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants