GaussianSplats3D icon indicating copy to clipboard operation
GaussianSplats3D copied to clipboard

Convert Ksplat to more usable format.

Open AidansLab opened this issue 9 months ago • 19 comments

Is there any way to convert a ksplat to a more usable format? I was sent a ksplat by a friend, but neither of us realised it cannot be loaded into blender for cleanup, and eventually 3d printed. Sadly the ksplat is all we have, as he only had the scanner and software temporarily, so we are stuck with a ksplat.

AidansLab avatar Mar 16 '25 10:03 AidansLab

It's likely that your friend used the "ply to ksplat converter" that's included in this repo. Any chance you can ask your friend for the original ply?

seppestaes avatar Mar 17 '25 06:03 seppestaes

Unfortunately no, he only had the equipment for a short time, and the computer it would presumably be on is no longer available. Surely if it can be converted to a ksplat it can be converted back to a ply or splat, I've already tried to make some code to do it but I'm not that good with js so I couldn't get it to work.

AidansLab avatar Mar 17 '25 06:03 AidansLab

Do you still have the movie/images that were used to create the model? Might be easier to create a new .ply?

seppestaes avatar Mar 17 '25 06:03 seppestaes

Nope, the scan files would be on the computer mentioned before, if they haven't already been deleted by the school which they probably have, but there's no way to get to the computer anyway. The ksplat is the only thing we have available.

AidansLab avatar Mar 17 '25 06:03 AidansLab

There have been ongoing discussions #47 , #82. If a (quick) splat clean up is what you're looking for, you might be better off re-creating the splat and starting from .ply or .splat

seppestaes avatar Mar 17 '25 07:03 seppestaes

Like I said, there's unfortunately no way to recreate the ply or splat. So this is my only option. The main goal is to 3d print this model, so a cleanup is only part of the process.

#82.

I saw this issue before, but it seems to have been forgotten. Also I'm honestly confused at the idea that,

The .splat files are relatively small and are used fairly often, so it may not be strictly necessary to have the functionality to convert ksplat to ply.

A ksplat file is utterly useless other than for viewing, since it cannot be converted to a format that's actually usable. It seems like this is a relatively easy thing to implement from my quick look over create-ksplat.js, I would do it myself but I am not as good with js as with some other languages and all my attempts have failed.

AidansLab avatar Mar 17 '25 07:03 AidansLab

.kspat is a compressed format..., other options like .spz (Niantic) or PlayCanvas' .ply don't offer bidirectionality neither.

seppestaes avatar Mar 17 '25 07:03 seppestaes

mkkellogg themselves said in #82 that it would be possible considering all the data is there, and looking through create-ksplat.js I am inclined to agree. Ksplat does compress, but it's not enough to make the original file unrecoverable.

AidansLab avatar Mar 17 '25 08:03 AidansLab

Didn't say it's impossible. If it's an uncleaned splat you need, why not re-create it? You mentioned you're not a js expert. It might be the easiest solution, that's all I'm saying...

seppestaes avatar Mar 17 '25 08:03 seppestaes

I'm not sure what you mean by recreate it. Like I said, I don't have access to the scanner and software anymore so I can't do a rescan, is there some way to recreate it from the ksplat file?

AidansLab avatar Mar 17 '25 08:03 AidansLab

.kspat files contain gaussian splats. If you have a video of the object/scene you want, you're set. LumaAI offers a free service, so does Polycam. Scaniverse lets you create one locally on your smartphone... Upload your movie, and you can download an uncompressed .ply

seppestaes avatar Mar 17 '25 08:03 seppestaes

Again, unfortunately we don't have any of the original files, only the ksplat. Would it possible to somehow do that with the ksplat? It'll probably be worse resolution, but I'm gonna clean it up anyway.

AidansLab avatar Mar 17 '25 09:03 AidansLab

Then I'd suggest writing back to .ply from the splatbuffer. You can find the header info in the loader classes.

seppestaes avatar Mar 17 '25 09:03 seppestaes

Is the header the only difference? I thought it did some stuff to the splats too.

AidansLab avatar Mar 17 '25 09:03 AidansLab

I would love a solution for this too, working on a project which had scanned and processed a large underwater item. I definitely dont have access to the video and only thing shared with me is .ksplat file, but now I am trying to do both clean up and make a use of react3fiber/drei splat which does not handle ksplat files, and i would love to be able to use this scanned file in my project. I can not actually go underwater myself to capture it again :)

ramifara avatar Apr 02 '25 18:04 ramifara

I've developed a command-line conversion tool in Go (https://github.com/gotoeasy/gsbox), and I'm interested in supporting conversions for ksplat. However, I'm not aware of the internal structure of ksplat, nor do I know if ksplat allows others to parse it.

gotoeasy avatar May 06 '25 14:05 gotoeasy

I've developed a command-line conversion tool in Go (https://github.com/gotoeasy/gsbox), and I'm interested in supporting conversions for ksplat. However, I'm not aware of the internal structure of ksplat, nor do I know if ksplat allows others to parse it.

From what I can gather from my first quick skim, most of the structure of ksplats should be decipherable from util/create-ksplat.js and src/loaders/ksplat/KSplatLoader.js. JS isn't my main language so it's just my rough speculation though. It really would be awesome if you could support ksplats.

AidansLab avatar May 06 '25 17:05 AidansLab

Hi folks. I recommend using the splat-transform CLI tool to convert from .ksplat to other formats.

willeastcott avatar Jul 14 '25 13:07 willeastcott

From what I can gather from my first quick skim, most of the structure of ksplats should be decipherable from util/create-ksplat.js and src/loaders/ksplat/KSplatLoader.js. JS isn't my main language so it's just my rough speculation though. It really would be awesome if you could support ksplats.

gsbox cli tool now supports conversion from ksplat to ply, splat, spx, or spz formats.

# convert ksplat to ply
gsbox k2p -i /path/to/input.ksplat -o /path/to/output.ply

# convert ksplat to splat
gsbox k2s -i /path/to/input.ksplat -o /path/to/output.splat

https://github.com/gotoeasy/gsbox

gotoeasy avatar Aug 23 '25 14:08 gotoeasy