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

half float support #76

Closed
wants to merge 1 commit into from
Closed

half float support #76

wants to merge 1 commit into from

Conversation

leventt
Copy link

@leventt leventt commented Dec 12, 2023

Some host applications with PLY file support such as Agisoft Metashape produce half float color (when used with half float image formats such as EXR files).


📚 Documentation preview 📚: https://python-plyfile--76.org.readthedocs.build/en/76/

@dranjan dranjan self-requested a review December 12, 2023 18:59
@dranjan dranjan self-assigned this Dec 12, 2023
@dranjan
Copy link
Owner

dranjan commented Dec 12, 2023

Hey @leventt, thanks for the interest! The usual policy in this project is not to extend the PLY format, unless the extensions are already in wide use (https://python-plyfile.readthedocs.io/en/stable/developing.html#contribution-guidelines). I'm not 100% sure what to do in this case. It may be used in one other tool, but also that one tool appears to be proprietary, which inclines me less to interoperate with it. I'm happy to have a discussion about it, though.

@leventt
Copy link
Author

leventt commented Dec 12, 2023

@dranjan thanks for the quick response and I see your point. If the concern is how wide the use case is and if the host application may be open source, I believe COLMAP and OpenEXR projects are open source and they would also produce similar output in conjunction as another example. For the wideness of the use cases... Source of where the half floats come from is actually OpenEXR. It is pretty widely used in VFX & Animation with 16 bit floats.

Also worth mentioning, PLY files may become more and more popular with the advent and success of a method called 3D Gaussian Splatting. Currently the exchange format used by most open source implementations of it including the official repo, is PLY. Official implementation doesn't output 16 bit floats necessarily but I think it may become more and more popular that it does. Considering the domains that this method caters to (VFX and CG in general) have popular applications and exchange formats such as EXR with 16 bit float color representations.

@leventt
Copy link
Author

leventt commented Dec 13, 2023

@dranjan any objections after my last message?

@dranjan
Copy link
Owner

dranjan commented Dec 13, 2023

I see your points, but let me get back to you in a day or two.

@dranjan
Copy link
Owner

dranjan commented Dec 16, 2023

Ok, finally got around to this.

  • I briefly looked into OpenEXR and I'm not seeing any capability to output PLY files.
  • I briefly looked into COLMAP and although it does support PLY, it doesn't appear to use half-precision floating-point properties.
  • I also looked into a couple of other popular open-source packages that support PLY and they also don't support half-precision.
  • Finally, I checked the original implementation from the author of the format, which as far as I can see is still being maintained (https://faculty.cc.gatech.edu/~turk/ply.tar.gz) and it also still only supports the original property types as documented.

My honest opinion is that Metashape, if it is creating PLY files with half or float16 properties, is simply generating invalid files. I don't see a good reason for them not to simply up-cast to float, since that is well-supported everywhere and can exactly represent all half-precision values.

If the community consensus shifts, or if Greg Turk says this should be allowed, then it becomes a different conversation, but as it is, I don't think it's plyfile's place to extend the format in this way.

@leventt
Copy link
Author

leventt commented Dec 16, 2023 via email

@dranjan
Copy link
Owner

dranjan commented Dec 17, 2023

As always, we can re-evaluate the situation as circumstances change, but for now: closing.

@dranjan dranjan closed this Dec 17, 2023
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.

2 participants