-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 scannetpp dataparser #2498
Add scannetpp dataparser #2498
Conversation
I also noticed that training is much slower with mask (1-2s per iteration for default nerfacto) because the pixel sampler is running nonzero on CPU, especially when the number of images and the image resolution are large. nerfstudio/nerfstudio/data/pixel_samplers.py Lines 96 to 99 in 81db180
One way is to have less image per samples and more frequent sampling like
Or how the mask being used in the code has to be changed. Since the invalid pixels are usually a small part of the pixels among all the images, we could save all the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for adding
@liu115 Hi, I wonder you used nerfacto or nerfacto-huge, and each iteration costs 1-2s? |
I used nerfacto One quick solution to avoid the mask sampling bottleneck is not to use mask during pixel sampling. Instead, apply the mask only during the loss computation For example, in def get_loss_dict(self, outputs, batch, metrics_dict=None):
loss_dict = {}
image = batch["image"].to(self.device)
pred_rgb, gt_rgb = self.renderer_rgb.blend_background_for_loss_computation(
pred_image=outputs["rgb"],
pred_accumulation=outputs["accumulation"],
gt_image=image,
)
if "mask" in batch:
mask = batch["mask"].view(-1)
assert mask.shape[0] == gt_rgb.shape[0]
loss_dict["rgb_loss"] = self.rgb_loss(gt_rgb[mask], pred_rgb[mask])
else:
loss_dict["rgb_loss"] = self.rgb_loss(gt_rgb, pred_rgb) and remove the if statement here nerfstudio/nerfstudio/data/pixel_samplers.py Lines 98 to 101 in 7edd768
|
@liu115 Hi, I have another thing want to confirm with you. That is, there exist two ways that I could get an extrinsic matrix of a camera. One is from the |
Yes. |
@liu115 But I found that the translation vectors extracted from the extrinsic matrix from
|
Reference here when nerfstudio/nerfstudio/process_data/colmap_utils.py Lines 434 to 441 in 3a4ed80
|
Hi. I can run scannetpp data with nerfacto and instant-ngp but it doesn't work with splatfacto:
ns-train 8 train.py 262 entrypoint train.py 247 main train.py 189 launch train.py 100 train_loop trainer.py 261 train profiler.py 112 inner trainer.py 496 train_iteration profiler.py 112 inner base_pipeline.py 303 get_train_loss_dict splatfacto.py 868 get_loss_dict splatfacto.py 649 _downscale_if_required splatfacto.py 95 resize_image RuntimeError: Do you have any idea why this might be? Just to clarify
but is there a fix for it? |
Dataparser for the ScanNet++ dataset adapted from the nerfstudio dataset. The dataset parser follows the dataset file structure and can be used by specifying the dataset root and the scene ID.
Example usage
The scene contain more than 1k images. Set
train_num_images_to_sample_from
andtrain_num_times_to_repeat_images
to avoid cpu out-of-memory.Training with the viewer. The images with red borders are the predefined testing images by the dataset
The result rendering
https://github.com/nerfstudio-project/nerfstudio/assets/8998128/e4c01178-cafa-4e28-837c-6b0bdf5538d5