Meshroom: Custom CLI pipe

Created on 8 Apr 2020  Â·  9Comments  Â·  Source: alicevision/meshroom

Meshroom 2019.2.0 on Linux

Running pure CLI pipe.

For changing node parameters I've been dropping uncompiled .py from the Develop branch in place of the compiled nodes from the release.

Works great.

I'd like to add a denoise and decimate node to the pipe but for the life of me I can not figure out where or how to create a custom base project.mg

I've spent a good deal of time looking and this does not seem to be documented anywhere.

Thank you for any leads you may be able to provide.

cli question

All 9 comments

When using meshroom_photogrammetry you can to set a parameter directly from the command line: "--paramOverrides NODE.param=value"

To add nodes, use 1) a Meshroom mg file created via the GUI (--pipeline graph.mg), 2) --save the default graph and manually edit it or 3) manually create your graph in the CLI by adding the nodes in the order you want, including parameters.

Default parameters are used when no parameters are set. Parameters printed to the Meshroom GUI Log can be used as reference. Example (you need to adjust the path to your OS):

aliceVision_cameraInit --sensorDatabase "PATH-TO\Meshroom-2019.2.0\aliceVision\share\aliceVision\cameraSensors.db" --defaultFieldOfView 45.0 --groupCameraFallback folder --verboseLevel info --output "PATH-TO/MeshroomCache/CameraInit/ea736ae9/cameraInit.sfm" --allowSingleView 1 --input "PATH-TO/MeshroomCache/CameraInit/ea736ae9/viewpoints.sfm"

https://github.com/alicevision/AliceVision/wiki/CLI-Parameters

Thanks but still struggling here. Let me see if I can restate the question.

I would like to alter / edit / refine the default parameters / graph if possible.

This will be running entirely headless / automated.

We have a pipe already that takes populates inputs and the pipe runs CLI through to final output.

We are creating directories with uid's, populating with input and output directories. We have a separate process that populates the inputs. We run meshroom and save the project.mg in the project directory.

I get that we can create a new graph using GUI which we have done but for the life of me can not get it to load as the default or rather in place of the default graph so that it is saved as our project.mg

The relevant portions of the script.

_Scaffold project file for meshroom project_
os.system("{!s}/meshroom_photogrammetry --input {!s}/{!s}/input --output {!s}/{!s}/output --save {!s}/{!s}/project.mg"
​
_Start processing meshroom project file_
os.system("{!s}/meshroom_compute {!s}/{!s}/project.mg --toNode Publish_1 --forceStatus"

Thoughts?

Thank you

You should add "--pipeline path/to/your_custom_pipeline.mg" to your meshroom_photogrammetry command line.

Hi @NexTechAR-Scott ,
please also refer to this other issue
https://github.com/alicevision/meshroom/issues/683#issuecomment-545801680

Update. All working as intended and expected.

Issue was unrelated, if part of my script failed it was not recovering cleanly.

Thanks for the input.

Hi @natowi, how to manually create graph in CLI? Could you give an example?

@Sachet12345 use meshroom_photogrammetry with your graph created in the meshroom gui.
Otherwise you need to call each node in correct order and provide input and output paths. https://github.com/alicevision/AliceVision/wiki/CLI-Tools
https://github.com/alicevision/AliceVision/wiki/CLI-Parameters

Solved! - Meshroom CLI with custom node settings on Google Colab

This solution was tested on Google Colab using a script from AB3D-Studio. Download the _"RunMeshroom.ipynb"_ script file. You can check out the YouTube tutorial here for the complete setup.

Steps:

  1. Open your local Meshroom GUI and set up all the nodes and their parameters as per your desired requirements.
  2. Save your file as _MyMESH.mg_ and copy it to your Google Drive (My Drive/Documents for example).
  3. Open Google Colab, upload the notebook script _"RunMeshroom.ipynb"_ and follow the instructions to mount your google drive.
  4. Copy your input files to your folder in Google Drive.
  5. Copy the file paths of _MyMesh.mg_ and your input files from Colab and replace all the file paths inside your _MyMesh.mg_ file. You might have to be careful while doing this. Make sure you have completely replaced all the local paths to the Colab's reference paths. For example inputs > _path: "C:\Users\USER_NAME\Documents\"_ to _path: "/content/drive/My Drive/Documents/"_.
  6. If you haven't set a custom output folder in your Publish Node, the output is saved in the default cache folder.
  1. Now run this command under 'Meshing' after you have performed the above steps correctly:
    !./meshroom/Meshroom-2020.1.0/meshroom_compute --forceCompute /content/drive/My Drive/Documents/MyMesh.mg

Note:
Check the Meshroom version that you are using, I have used the 2020 version.
Check CLI Parameters for more info.

@vinayadatta thanks, I have added this to the wiki.

Was this page helpful?
0 / 5 - 0 ratings