Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meshroom Colab not finding images on google drive #1218

Closed
RayzedByRobots opened this issue Jan 7, 2021 · 4 comments
Closed

Meshroom Colab not finding images on google drive #1218

RayzedByRobots opened this issue Jan 7, 2021 · 4 comments

Comments

@RayzedByRobots
Copy link

I'm running Meshroom 2019.1.0 both on PC and with google Colab. I created a .mg file that uses high FeatureExtraction and Guided Matching. I updated the paths in the .mg file to point to google drive. It looks like meshroom can't find the images on google drive - which are indeed in the E2_Folder as jpgs. Anyone have an idea why the images are not being seen by meshroom? If you need more info please let me know. Thanks

Plugins loaded: CameraCalibration, CameraInit, CameraLocalization, CameraRigCalibration, CameraRigLocalization, ConvertSfMFormat, DepthMap, DepthMapFilter, ExportAnimatedCamera, ExportMaya, FeatureExtraction, FeatureMatching, ImageMatching, ImageMatchingMultiSfM, KeyframeSelection, MeshDecimate, MeshDenoising, MeshFiltering, MeshResampling, Meshing, PrepareDenseScene, Publish, SfMAlignment, SfMTransform, StructureFromMotion, Texturing
Nodes to execute: ['CameraInit_1', 'FeatureExtraction_1', 'ImageMatching_1', 'FeatureMatching_1', 'StructureFromMotion_1', 'PrepareDenseScene_1', 'DepthMap_1', 'DepthMapFilter_1', 'Meshing_1', 'MeshFiltering_1', 'Texturing_1']
WARNING: downgrade status on node "CameraInit_1" from Status.ERROR to Status.SUBMITTED

[1/11] CameraInit

  • commandLine: aliceVision_cameraInit --sensorDatabase "/content/drive/MyDrive/Science/Coral/PDAM_H_Davis/E2_Folder" --defaultFieldOfView 45.0 --groupCameraFallback folder --verboseLevel info --output "/content/drive/MyDrive/Science/MeshroomRunFiles/MeshroomCache/CameraInit/c448939571d5c70b05c9ae4ad416ada37d6273ca/cameraInit.sfm" --allowSingleView 1
  • logFile: /content/drive/MyDrive/Science/MeshroomRunFiles/MeshroomCache/CameraInit/c448939571d5c70b05c9ae4ad416ada37d6273ca/log
  • elapsed time: 0:00:00.185615
    ERROR:root:Error on node computation: Error on node "CameraInit_1":
    Log:
    Program called with the following parameters:
  • allowSingleView = 1
  • defaultCameraModel = "" (default)
  • defaultFieldOfView = 45
  • defaultFocalLengthPix = -1 (default)
  • defaultIntrinsic = "" (default)
  • groupCameraFallback = Unknown Type "20EGroupCameraFallback"
  • imageFolder = "" (default)
  • input = "" (default)
  • output = "/content/drive/MyDrive/Science/MeshroomRunFiles/MeshroomCache/CameraInit/c448939571d5c70b05c9ae4ad416ada37d6273ca/cameraInit.sfm"
  • sensorDatabase = "/content/drive/MyDrive/Science/Coral/PDAM_H_Davis/E2_Folder"
  • verboseLevel = "info"

[12:50:03.944917][error] Program need -i or --imageFolder option
No input images.

WARNING: downgrade status on node "ImageMatching_1" from Status.SUBMITTED to Status.NONE
WARNING: downgrade status on node "StructureFromMotion_1" from Status.SUBMITTED to Status.NONE
WARNING: downgrade status on node "Meshing_1" from Status.SUBMITTED to Status.NONE
WARNING: downgrade status on node "MeshFiltering_1" from Status.SUBMITTED to Status.NONE
WARNING: downgrade status on node "Texturing_1" from Status.SUBMITTED to Status.NONE
Traceback (most recent call last):
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/site-packages/cx_Freeze/initscripts/startup.py", line 14, in run
File "/opt/Meshroom/setupInitScriptUnix.py", line 39, in run
File "bin/meshroom_compute", line 64, in
File "/opt/Meshroom/meshroom/core/graph.py", line 1131, in executeGraph
File "/opt/Meshroom/meshroom/core/node.py", line 271, in process
File "/opt/Meshroom/meshroom/nodes/aliceVision/CameraInit.py", line 239, in processChunk
File "/opt/Meshroom/meshroom/core/desc.py", line 452, in processChunk
RuntimeError: Error on node "CameraInit_1":
Log:
Program called with the following parameters:

  • allowSingleView = 1
  • defaultCameraModel = "" (default)
  • defaultFieldOfView = 45
  • defaultFocalLengthPix = -1 (default)
  • defaultIntrinsic = "" (default)
  • groupCameraFallback = Unknown Type "20EGroupCameraFallback"
  • imageFolder = "" (default)
  • input = "" (default)
  • output = "/content/drive/MyDrive/Science/MeshroomRunFiles/MeshroomCache/CameraInit/c448939571d5c70b05c9ae4ad416ada37d6273ca/cameraInit.sfm"
  • sensorDatabase = "/content/drive/MyDrive/Science/Coral/PDAM_H_Davis/E2_Folder"
  • verboseLevel = "info"

[12:50:03.944917][error] Program need -i or --imageFolder option
No input images.

@natowi
Copy link
Member

natowi commented Jan 7, 2021

/content/drive/MyDrive/

You need to change the mg file to match the paths to your local file system.

@RayzedByRobots
Copy link
Author

The way I think it works is my images and .mg file are in a folder on my google drive and I change the sensorDatabase path in my .mg file to point to the folder with my images in google drive like below:
"sensorDatabase": "/content/drive/MyDrive/Science/Coral/PDAM_H_Davis/E2_Folder",

I don't understand what you mean by "change the mg file to match the paths to your local file system." I thought that is what I was doing no?

@natowi
Copy link
Member

natowi commented Jan 7, 2021

In the camerainit node part of the mg file the paths for the images are stored. You need to change the path to your new image path (absolute file paths).

@RayzedByRobots
Copy link
Author

Solved: Added to steps from issue #851

Steps for using Meshroom with Google Colab:

Download meshroom to your computer. Make sure the versions match between the Colab version and your computer version. Insert or drag your images to the Images window in meshroom and set up all the nodes and their parameters as per your desired requirements.

Save your file as MyMESH.mg and copy it to your Google Drive (My Drive/Documents for example).

Then copy those same images to a folder on google drive.

Open Google Colab and load "RunMeshroom.ipynb." Good how to here: https://www.youtube.com/watch?v=xcN_UaZUKew

Go down to the Google Drive cell and mount your drive. Use control-v to paste in the link.

Then go back up to the first cell in the notebook (Add paths for input and output) - do not input anything here for the input or the output - leave blank. However, click on the run cell icon to get to the next cell.

At this point, open your MyMESH.mg file by navigating to your google drive within the Colab file structure - double click to open the .mg file. You will need to make some changes to this file:
First copy the cameraSensors path - navigate to content/meshroom/Meshroom-2019.1.0/aliceVision/share/aliceVision/cameraSensors.db and copy this path (using the three dots when you mouseover the cameraSensors file).
Then in your MyMESH.mg file, find the sensorDatabase line which should look something like this:
"sensorDatabase": "C:\Program Files\Meshroom\Meshroom-2019.1.0\aliceVision\share\aliceVision\cameraSensors.db",
and insert your new path:
"sensorDatabase": "/content/meshroom/Meshroom-2019.1.0/aliceVision/share/aliceVision/cameraSensors.db",

Then navigate to content/meshroom/Meshroom-2019.1.0/aliceVision/share/aliceVision/vlfeat_K80L3.SIFT.tree and copy this path.
Then in the MyMESH.mg file, find the .tree line which should look like:
"tree": "C:\Program Files\Meshroom\Meshroom-2019.1.0\aliceVision\share\aliceVision\vlfeat_K80L3.SIFT.tree",
and insert your copied path:
"tree": "/content/meshroom/Meshroom-2019.1.0/aliceVision/share/aliceVision/vlfeat_K80L3.SIFT.tree",

Now update all of the image paths in the MyMESH.mg file. I'm sure there are easier ways to do this but I'll do it by hand here. Navigate to the first image file on your google drive and copy the path. Find your first image reference in your MyMESH.mg file and change it to point to google drive instead of your local drive (like C: or F:). Example from my camera/local drive:
"path": "F:/DCIM/100OLYMP/Photogrammetry/D1/P1070005.JPG",
This needs to be changed to:
"path": "/content/drive/MyDrive/Science/Coral/F1/P1070005.JPG",

So this needs to be done for all of your images in the .mg file or meshroom won't find them. Be careful to copy the file names exactly otherwise you'll get dumped.

Then go down to the Meshing cell and input the following command:
!./meshroom/Meshroom-2019.1.0/meshroom_compute --forceCompute /content/drive/My Drive/Documents/MyMesh.mg
Basically you need to copy the path to your .mg file and then insert it in the right place in the line above; after the forceCompute

Then go ahead and click the Run cell icon under Meshing and things should work!!

Also if you need to rerun for some reason, you can clear all output by navigating to Edit and then Clear all Outputs from the notebook menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants