Running COLMAP + OpenMVS in Microsoft Azure blazing fast

495 views
Skip to first unread message

elit...@gmail.com

unread,
May 17, 2018, 9:04:20 AM5/17/18
to COLMAP
Since I do not own a monster computer myself, I've figured out how to run COLMAP and OpenMVS pipeline in Microsoft Azure.

Based on price/performance (with timing on the actual executables) I found these machines best suited:

For COLMAP: NC6s_v2 Standard - 6 vCPU - 112 GB RAM - SSD - 1 nVidia P100 (PCIe) - $2.8 / hour
For OpenMVS: F32s_v2 Standard - 32 vCPU - 64 GB RAM - SSD - $2.6 / hour

The scene I ran consisted of 120 images 1920 x 1080, and it took around 45 minutes - $2.5 (including deploying, installing, copying files and deleting).

Here's how to do it:

Start by downloading the executables for COLMAP and OpenMVS:


and place them in a folder structure like this:

Create folder [COLMAPOpenMVS]
Under COLMAPOpenMVS, create folder [colmap34]
Put these files under COLMAPOpenMVS\colmap34

colmap.exe
Qt5Core.dll
Qt5Widgets.dll
Qt5Gui.dll
cudart64_80
.dll
libglog
.dll
libblas
.dll
libgcc_s_sjlj
-1.dll
libgfortran
-3.dll
liblapack
.dll
libquadmath
-0.dll
glew32
.dll
FreeImage.dll
msvcp120
.dll
msvcr120
.dll
vcomp120
.dll

Under COLMAPOpenMVS\colmap34, create folder [platforms]
Put this file under COLMAPOpenMVS\colmap34\platforms

qwindows.dll

Under COLMAPOpenMVS, create folder [openmvs]
Put these files under COLMAPOpenMVS\openmvs

DensifyPointCloud.exe
InterfaceVisualSFM.exe
ReconstructMesh.exe
RefineMesh.exe
TextureMesh.exe
vcomp140
.dll

Under COLMAPOpenMVS, create empty folder [workspace]
Under COLMAPOpenMVS, create folder images and put the [images] you want to reconstruct in there
Under COLMAPOpenMVS, create RunOnNC6.bat and RunOnF32.bat

The RunOnNC6.bat file should contain this:

.\colmap34\colmap.exe feature_extractor --database_path .\workspace\database.db --image_path .\images\
.\colmap34\colmap.exe exhaustive_matcher --database_path .\workspace\database.db
.\colmap34\colmap.exe mapper --database_path .\workspace\database.db --image_path .\images\ --export_path .\workspace\
.\colmap34\colmap.exe model_converter --input_path .\workspace\0\ --output_path .\workspace\model.nvm --output_type nvm

The RunOnF32.bat file should contain this:

.\openmvs\InterfaceVisualSFM.exe -w .\images\ -i ..\workspace\model.nvm -o ..\workspace\model.mvs -v 0
.\openmvs\DensifyPointCloud.exe -w .\images\ -i ..\workspace\model.mvs -o ..\workspace\model_dense.mvs -v 0
.\openmvs\ReconstructMesh.exe -w .\images\ -i ..\workspace\model_dense.mvs -o ..\workspace\model_dense_mesh.mvs -v 0
.\openmvs\RefineMesh.exe -w .\images\ -i ..\workspace\model_dense_mesh.mvs -o ..\workspace\model_dense_mesh_refine.mvs -v 0
.\openmvs\TextureMesh.exe -w .\images\ -i ..\workspace\model_dense_mesh_refine.mvs -o ..\workspace\model_dense_mesh_refine_texture.mvs --empty-color 0 -v 0 --patch-packing-heuristic 0

Go to Azure and create the NC6s_v2 instance. If you don't have enough quota, create a support case and increase it to 38 cores. It'll take two days to get approved.
Connect to the machine via Remote Desktop.
Copy the COLMAPOpenMVS folder to the machine by select copy on folder on local machine and select paste on the desktop on the remote machine in remote desktop application.
While files are copying, Install the "Azure NC drivers for Windows 2016" by googling it on the remote machine.
Run the RunOnNC6.bat when all files are copied and the drivers installed successfully.
When the application has finished, create the F32s_v2 instance and deploy in the same Resource Group as the NC6s_v2.
Share the desktop folder on the NC6s_v2 to you as a user.
Mount the NC6 Desktop onto the F32, so that you can copy over the files.
Delete all resources belonging to the NC6 in Azure portal to save money.
Run the RunOnF32.bat on the F32.
When finished copy these files over to your local machine:

model_dense_mesh_refine_texture.ply
model_dense_mesh_refine_texture
.png

When copied. Delete all remaining resources from the Resource Group to make sure Azure isn't charging you more than needed.

Download MeshLab, install and run. Drag and drop the model_dense_mesh_refine_texture.ply into MeshLab and watch your 3D model.

If you have any suggestions on how to improve this, please comment!

Johannes Schönberger

unread,
May 17, 2018, 10:05:38 AM5/17/18
to col...@googlegroups.com

Great! Thanks very much for sharing this workflow. This should be useful for other people as well.

 

Cheers, Johannes

--
You received this message because you are subscribed to the Google Groups "COLMAP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to colmap+un...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/colmap/4eb54938-aba4-499f-8f1f-8bc9bc615583%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages