Because most of our tools are written in MATLAB/Octave, I found that the generated .glbfile is difficult to convert.
I just added a little bit code to allow the demo.py GUI to export data to a JSON/binary JSON construct (with the JMesh mesh data annotation) - which can be potentially parsed/shared in other environments (like JavaScript/Node/C++/MATLAB). I also added a drop down menu in the demo to let user choose output format.
in my test, the generated scene from 10 images took 43MB size in glb, 44MB in binary json (.bmsh) and 59MB for JSON (due to base64). No noticeable difference in loading/saving speed. For both JSON/binary JSON file, changing the compressor to 'lzma'could lead to much smaller file size.
just want to share this in case others see similar needs. I am also happy to create a PR if the developers are interested in adding this feature.
First, congrats to the developers. a powerful tool, found immediate use for my projects.
Because most of our tools are written in MATLAB/Octave, I found that the generated
.glb
file is difficult to convert.I just added a little bit code to allow the demo.py GUI to export data to a JSON/binary JSON construct (with the JMesh mesh data annotation) - which can be potentially parsed/shared in other environments (like JavaScript/Node/C++/MATLAB). I also added a drop down menu in the demo to let user choose output format.
Here are my commits
https://github.com/NeuroJSON/dust3r/commit/a13b18c0cde7496b83c86d95c2778a0e13d07c92 https://github.com/NeuroJSON/dust3r/commit/935ace7089e6b4c88fd86d0d4eb5d3bdbe3895c2
to export to JSON, only one extra dependency
jdata
(16 kb) is needed. To export to a binary JSON format (for smaller file sizes), another small packagebjdata
(65 kb).loading the data in MATLAB/Octave
loading the data back to Python
in my test, the generated scene from 10 images took 43MB size in glb, 44MB in binary json (.bmsh) and 59MB for JSON (due to base64). No noticeable difference in loading/saving speed. For both JSON/binary JSON file, changing the compressor to
'lzma'
could lead to much smaller file size.just want to share this in case others see similar needs. I am also happy to create a PR if the developers are interested in adding this feature.