facebookresearch / iSDF

Real-time Neural Signed Distance Fields for Robot Perception
https://joeaortiz.github.io/iSDF/
MIT License
417 stars 51 forks source link

Destination of SDF map and resulting mesh when using ROS implementation. #12

Closed gsznaier closed 2 years ago

gsznaier commented 2 years ago

Hi!

Thank you for sharing your code, this is very cool work!

I would like to compare against your approach and I had a quick question regarding your implementation when running with ROS. Where does your approach store the resulting SDF map and mesh as it trains?

Thanks in advance!!

joeaortiz commented 2 years ago

Hi Gadi,

The SDF map is simply stored in the weights of the MLP network which is in the iSDF ROS node. The mesh is generated by querying the SDF network on a regular grid and then running marching cubes (https://github.com/facebookresearch/iSDF/blob/main/isdf/modules/trainer.py#L1500). The mesh is only generated when the visualisation window asks for a mesh to display.

Feel free to reopen if you have follow up questions.

gsznaier commented 2 years ago

Hi Joe,

Thanks for the quick response! One more question, does the SDF store the network weights in a specific folder during training or is the result lost once the training script is terminated?

Thanks in advance!

joeaortiz commented 2 years ago

You can save the weights by saving the model state dict, e.g. torch.save(model.state_dict(), PATH). You can set the period at which the weights are saved in the config file: https://github.com/facebookresearch/iSDF/blob/main/isdf/train/configs/replicaCAD.json#L27