-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Issue 7153 - 3DGS IO #7191
base: main
Are you sure you want to change the base?
Issue 7153 - 3DGS IO #7191
Conversation
* Include additional 3DGS properties for reading operation * Add validation methods for 3DGS mandatory properties * Read and Write including additional vertex * Add the validation check to the write method * Add a unit test for a valid ReadCloutPoint operation * PLY read to point cloud * PLY write correction * Inline documentation * Add constant defines for magic numbers and attribute names * Add unit tests for reading and writing 3DGS formatted point clouds * Add 3DGS attribute verification to the read operation --------- Co-authored-by: Juan Cruz <[email protected]> Co-authored-by: Gomez Rodriguez, Diego <[email protected]>
* Add splat writer * Add splat reader * Splat reader added to PointCloudIO.h * Fix CMakeList.txt * Add test for reading PointCloud from SPLAT format * Fixing Style --------- Co-authored-by: ikun03 <[email protected]>
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Thanks @lumurillo and team for this very useful contribution!
Naming: Can we replace the use of 3DGS
to GaussianSplat
everywhere?
This also take care of variants of 3DGS such as 2D Gaussian Splatting. Also splat seems to be the more common / short name for this representation in other software.
Btw: a good way to remember the f_rest size is that it's n^2-1 for order n :-)
PS: Review is WIP: Will review test and docs later.
rot.cwiseMin(255.0).cwiseMax(0.0).cast<int>(); | ||
|
||
for (int idx = 0; idx < 4; ++idx) { | ||
splat_write_byte(splat_file, int_to_byte(int_rot[idx])); |
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.
The bounds checking inside int_to_byte is unnecessary, since we have clamped the values above. Simpler static_cast
should be faster.
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.
Ok. Done.
@@ -309,16 +359,11 @@ TEST(TPointCloudIO, WritePTSColorConversion1) { | |||
|
|||
// Check PTS color boolean to uint8 conversion. | |||
TEST(TPointCloudIO, WritePTSColorConversion2) { |
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.
Is this .pts
file IO test deletion accidental?
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.
I think we need to modify the unit tests a bit:
ply:
- Start with a ply file as a string [Done].
- Create tensors for each of the attributes (manually fill them in). See example here.
- Write ply string to disk as ply.
- Read it back from disk.
- Test - all attributes are present, are the right shape and data type as the tensors in step 2.
- Test all attribute values match (See example here).
splat:
- Start with .splat file as a binary blob - you can get this by converting the .ply file above to .splat with the reference convert.py script (antimatter github). You can convert it to a C array with
xxd -i infile.splat outfile.h
. If the C array is too big, let me know and we can add it directly to the git repo (with some cmake additions). This step directly proves that antimatter reference splats can be read by Open3D. - Start with the same tensor attributes as in the ply test.
- Write it to disk as splat.
- Read it back from disk.
- Test - all attributes are present, are the right shape and data type as the tensors.
- Test all attribute values match (See example here).
This simplifies the tests by using round trip test, no data file is needed for splat,
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.
We don't add data to the repo (as much as possible), so we can delete it from here. Instead, I'll add it to the Open3D downloads site.
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.
Thanks @joserochh!
I have modified splat unit tests. |
Fixes #7153
Motivation and Context
Provide IO capabilities with 3DGS support for files like PLY and SPLAT.
Checklist:
python util/check_style.py --apply
to apply Open3D code styleto my code.
updated accordingly.
results (e.g. screenshots or numbers) here.
Notes