rhiestan / Regard3D

A open source structure-from-motion program based on OpenMVG.
240 stars 43 forks source link

WebAssembly and distributed computing #6

Open lastmjs opened 7 years ago

lastmjs commented 7 years ago

This is pretty awesome! I might like to get involved with this project. I'm especially interested in getting it to run in the browser. Have you considered compiling to WebAssembly? WebAssembly is out as an MVP in Firefox and Chrome now. Compiling to the web could have some major advantages, including ease of use and potential distributed computing across arbitrary peers. We could also look into easily taking advantage of hardware acceleration through the GPU with WebGL. I'd like to explore these ideas and see how they could fit in with one of my other projects that is a prototype for distributing computing completely peer-to-peer in the browser: https://github.com/lastmjs/browser-based-super-grid

Anyway, I would love any thoughts or direction on these ideas, and especially to see if this is a direction Regard3D would like to go.

pmoulon commented 7 years ago

Hi @lastmjs if you want we can play and try to run some part of the OpenMVG pipeline on the web. Please tell how I can help. We could think about using the super-grid to compute features and matches on the cloud ;-)

lastmjs commented 7 years ago

That's where I was headed, getting OpenMVG compiled. So, the biggest barrier for me in getting started is where to start, or what to compile first. I don't know much about how OpenMVG works, the pipeline, or anything. Is there a simple command-line task that OpenMVG performs that we could start with?

lastmjs commented 7 years ago

Also, if you want to start getting setup for WebAssembly, it's​ pretty simple to get started with, they've done a good job: http://webassembly.org/getting-started/developers-guide/

pmoulon commented 7 years ago

For the build instruction you can find some here: https://github.com/openMVG/openMVG/blob/master/BUILD

For running the pipeline I advise first people to play with the python tutorial that launch the pipeline http://openmvg.readthedocs.io/en/latest/software/SfM/SfM/#openmvg-sfm-pipelines-demo

It checkout a tiny image dataset and process it with the lib.

lastmjs commented 7 years ago

That will be a great place to start, thanks. I'm pretty busy this next week or so, but I'd love to dig into this soon. Seems pretty straightforward so far, we'll need to figure out how emscripten compiles large C++ applications. We'll also have to figure out how WebAssembly handles file IO, or somehow port over those Python scripts as well. I might rewrite the Python scripts in JS and call into the compiled WebAssembly, not sure yet without digging into it.

stefaneidelloth commented 4 years ago

Could you please describe your experiences with WebAssembly and distributed computations? Did you combine WebAssembly with your peer-to-peer in the browser project?

lastmjs commented 4 years ago

I did not use WebAssembly for that project, it was a university demo project, and thus didn't need great performance. The project used WebRTC very effectively though, and did its simple computations in JavaScript. I still stand behind WebAssembly as a great way (if not the only viable way) to Port something like OpenMVG to the browser. Though, I don't have much interest in doing it

stefaneidelloth commented 4 years ago

Ok, thank you for your reply and the hint to WebRTC. I just found following project: https://distributed.computer Unfortunately they don't seem to provide their code as open source. If you hear about some active open source project on distributed computation with browsers, please let me know.