-
Notifications
You must be signed in to change notification settings - Fork 0
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
Train own dataset #2
Comments
I would also be interested in that regard! |
Hi! Thanks for checking out Neusky. For your own data you'll need a cityscapes segmentation mask for each image, in the paper we use, ViT-Adapter, but any cityscapes segmentation method should work. I've added two Python files you'll need to modify to process your data. neusky.data.dataparser.custom_neusky_dataparser.py containing CustomNeuskyDataparser CustomNeuskyDataparser sets up cameras in the Nerfstudio coordinate convention and locates the image and segmentation files. The mask returned by CustomNeuskyDataset should be a [H, W, 4] tensor made up of the following masks: static_object_mask = get_static_from_cityscapes() # [H, W, 1]
foreground_mask = get_foreground_from_cityscapes() # [H, W, 1]
ground_mask = get_ground_from_cityscapes() # [H, W, 1]
sky_mask = get_sky_from_cityscapes() # [H, W, 1]
mask = torch.cat([static_object_mask, foreground_mask, ground_mask, sky_mask], dim=-1) You'll then need to update this line in the config to use your custom dataparser: neusky/neusky/configs/neusky_config.py Line 47 in 96de93e
And update these lines to use your custom dataset: neusky/neusky/data/datamanagers/neusky_datamanager.py Lines 141 to 157 in 96de93e
I'll probably update the Datamanger to make the dataset swappable via the config rather than changing lines in the code as shown above but this will work for now. I hope this helps. Let me know if you have any issues. |
Thank you very much! I will try it and let you know if I get it to work. If I find something useful for other users I will post it too :) |
Hello again! I've successfully trained Neusky using a nerfstudio-data type dataset. I created a new dataparser "nerfstudio_cityscapes_dataparser" and updated the config file to utilize this parser. There was no need to modify the Dataset and DataManager, which was quite straightforward. This is what I changed in neusky/neusky/configs/neusky_config.py:
An important note for anyone following this approach: you'll need to add the mask paths into the transforms.json file. I've prepared a script that simplifies adding these paths. Ensure the masks are stored in a folder named segmented, and that each segmented image is named identically to its corresponding original image. Here's how the data folder should be organized: data/
I'm looking forward to sharing the nerfstudio_cityscapes_dataparser code with the community, but I want to make sure it aligns with your interests. If you find this contribution valuable, please guide me on the best way to share it :). |
Hello! Nice work! I would like to test the method using my own dataset. What steps should I follow to prepare the data in order to train NeuSky? Thank you!
The text was updated successfully, but these errors were encountered: