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

Add multi-processing support for cache_image. Fixed the issue of insufficient precision leading to a completely black image when converting from RGBA to RGB. #2867

Merged
merged 23 commits into from
Feb 5, 2024

Conversation

KevinXu02
Copy link
Contributor

@KevinXu02 KevinXu02 commented Feb 2, 2024

Add multi-processing support for cache_images. Now caching image is way more faster.

(Kind of messed up with branches and comments, the only changed file is full_images_datamanager.py. Please bear with me.)

Copy link
Collaborator

@brentyi brentyi left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me! Just left two comments 🙂

@KevinXu02
Copy link
Contributor Author

Looks reasonable to me! Just left two comments 🙂

Hi! I have updated the code based on the comments. Thank you for your suggestions!

@KevinXu02 KevinXu02 changed the title Add multi-processing support for cache_images Add multi-processing support for cache_image. Fixed the issue of insufficient precision leading to a completely black image when converting from RGBA to RGB. Feb 3, 2024
@KevinXu02
Copy link
Contributor Author

Also fixed the issue of insufficient precision leading to a completely black image when converting from RGBA to RGB.

@@ -103,7 +103,7 @@ def get_image_uint8(self, image_idx: int) -> UInt8[Tensor, "image_height image_w
assert (self._dataparser_outputs.alpha_color >= 0).all() and (
self._dataparser_outputs.alpha_color <= 1
).all(), "alpha color given is out of range between [0, 1]."
image = image[:, :, :3] * image[:, :, -1:] / 255.0 + 255.0 * self._dataparser_outputs.alpha_color * (
image = image[:, :, :3] * (image[:, :, -1:] / 255.0) + 255.0 * self._dataparser_outputs.alpha_color * (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for catching this bug.

@jb-ye
Copy link
Collaborator

jb-ye commented Feb 5, 2024

lgtm

Copy link
Collaborator

@kerrj kerrj left a comment

Choose a reason for hiding this comment

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

sgtm!

@kerrj kerrj enabled auto-merge (squash) February 5, 2024 16:59
@kerrj kerrj merged commit 52cda21 into nerfstudio-project:main Feb 5, 2024
2 checks passed
@KevinXu02 KevinXu02 deleted the viser branch February 26, 2024 20:14
ArpegorPSGH pushed a commit to ArpegorPSGH/nerfstudio that referenced this pull request Jun 22, 2024
…fficient precision leading to a completely black image when converting from RGBA to RGB. (nerfstudio-project#2867)
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.

4 participants