Skip to content

Instantly share code, notes, and snippets.

@donmahallem
Last active March 23, 2024 11:27
Show Gist options
  • Star 24 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save donmahallem/22134574382b7bd8a67c1550734fcfc4 to your computer and use it in GitHub Desktop.
Save donmahallem/22134574382b7bd8a67c1550734fcfc4 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shanji97
Copy link

Hi!
Due to 2021.1.0 not being available I modified the file, to be more "actually", although there is still something to be done about few things. Some things could be resolved to give Meshroom some new features like file/folder remapings for different environments.
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"Kopija beležnice RunMeshroom.ipynb","provenance":[{"file_id":"1qiHD3s4l_WCao0yIL6TIjvntY-Bgt32W","timestamp":1622313897316}],"collapsed_sections":[],"toc_visible":true},"kernelspec":{"name":"python3","display_name":"Python 3"},"accelerator":"GPU"},"cells":[{"cell_type":"markdown","metadata":{"id":"tJUlZN4TRnCH"},"source":["This notebook is based off of donmahallem's MeshroomColab notebook modified by shanji97.\n","\n","If you need help, check out his YouTube and his GitHub."]},{"cell_type":"markdown","metadata":{"id":"RD3eZSm6d6NZ"},"source":["#Setup (2021.1.0 version)\n","Download the meshroom tar file from Fosshub and upload it to a download service of you choice. Download the file and copy the direct download link (not the link the site is hosted on - It is usually formated as download.website.domain/someRandomIdString, here's an example: https://download.wetransfer.com//eugv/427e33c9565913f74fb2012ba98c895020210518183951/e837b9ffcec53fe59d42ac89c665f0134e3784bd/Meshroom-2021.1.0-linux-cuda10.tar.gz?cf.....). \n","\n","1) Set the download to the first input field. (TODO: Let the user choose between custom link and drive link.\n","\n","2) Set the path of your meshroom file\n","\n","3) Set the path of the (most recent) camera sensors database file (TODO: git clone and git pull the camerasensors.db file to Google Drive folder, manipulate the camera sensor location in the .mg file.\n","\n","4)(TODO): Remap the locations of the images using sed\n","\n"]},{"cell_type":"markdown","metadata":{"id":"PvIwyegUobtF"},"source":[""]},{"cell_type":"code","metadata":{"id":"Ol5uQcZkLvA3"},"source":["link_to_direct_download = 'https://download.wetransfer.com//eugv/427e33c9565913f74fb2012ba98c895020210518183951/e837b9ffcec53fe59d42ac89c665f0134e3784bd/Meshroom-2021.1.0-linux-cuda10.tar.gz?cf=y&token=eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MjE0MTg1OTAsInVuaXF1ZSI6IjQyN2UzM2M5NTY1OTEzZjc0ZmIyMDEyYmE5OGM4OTUwMjAyMTA1MTgxODM5NTEiLCJmaWxlbmFtZSI6Ik1lc2hyb29tLTIwMjEuMS4wLWxpbnV4LWN1ZGExMC50YXIuZ3oiLCJ3YXliaWxsX3VybCI6Imh0dHA6Ly9wcm9kdWN0aW9uLmJhY2tlbmQuc2VydmljZS5ldS13ZXN0LTEud3Q6OTI5Mi93YXliaWxsL3YxL3Nhcmthci84MGUzMGVlMjZiNGEzNmE0MTlmZmJmMTg3ZWM5YjE3MmRmOWRlODQ3MWRjN2NhNGIwMmM3NTM3NDJjMjEyYTNmYWVhMzU2YzMzYWM2NjdmODI2ZjU3NiIsImZpbmdlcnByaW50IjoiZTgzN2I5ZmZjZWM1M2ZlNTlkNDJhYzg5YzY2NWYwMTM0ZTM3ODRiZCIsImNhbGxiYWNrIjoie1wiZm9ybWRhdGFcIjp7XCJhY3Rpb25cIjpcImh0dHA6Ly9wcm9kdWN0aW9uLmZyb250ZW5kLnNlcnZpY2UuZXUtd2VzdC0xLnd0OjMwMDAvd2ViaG9va3MvYmFja2VuZFwifSxcImZvcm1cIjp7XCJ0cmFuc2Zlcl9pZFwiOlwiNDI3ZTMzYzk1NjU5MTNmNzRmYjIwMTJiYTk4Yzg5NTAyMDIxMDUxODE4Mzk1MVwiLFwiZG93bmxvYWRfaWRcIjoxMjE0MDc4MTA0OX19In0.6iHqkKICcqXxZpMcWL_aHQ7BT6WfxJ_r9zVEjqvmHzo'#@param {type:"string"}\n","\n","meshroom_file_path = "/content/drive/MyDrive/Osnove_oblikovanja_2021/Projekt_1/MeshroomCaches/shanji/D2/BB.mg" #@param {type:"string"}\n","\n","sensorDB="/content/drive/MyDrive/Osnove_oblikovanja_2021/Projekt_1/MeshroomCaches/shanji/D2/cameraSensors.db" #@param {type:"string"}\n","\n","output_path="/content/drive/MyDrive/Osnove_oblikovanja_2021/Projekt_1/MeshroomCaches/shanji/D2/Cache" #@param {type:"string"}\n"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"kKyatDmQQsWA"},"source":[""],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"RsxzdzwtPVCA"},"source":["Create a directory to store the meshroom bins in and extract the meshroom bins there."]},{"cell_type":"code","metadata":{"id":"cQgXdvk-qUvi"},"source":["\n","\n","!mkdir ~/meshroom\n","!wget -N --user-agent Mozilla/4.0 -O ~/meshroom/MRoom.tar.gz '{link_to_direct_download}'\n","!tar -xvf ~/meshroom/MRoom.tar.gz\n"],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"zTI6AlUXd-_M"},"source":["#Google Drive\n","Connect to Google Drive, so that you can import and export files from there.\n"]},{"cell_type":"code","metadata":{"id":"2wodsIcpYbDR","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1621417172047,"user_tz":-120,"elapsed":9195,"user":{"displayName":"ALEKSANDER KOVA","photoUrl":"","userId":"13312320104478609314"}},"outputId":"6542250a-97ea-4b16-e024-51dc4981b05c"},"source":["from google.colab import drive\n","drive.mount('/content/drive')"],"execution_count":null,"outputs":[{"output_type":"stream","text":["Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount("/content/drive", force_remount=True).\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"xA_XKpKqdoqb"},"source":["#Meshing\n","Use the form in setup to specify an input and output path, or check sample data to try it out."]},{"cell_type":"code","metadata":{"id":"AZWyk461sxGI"},"source":["!cd ~/meshroom\n","!Meshroom-2021.1.0-av2.4.0-centos7-cuda10.2/meshroom_compute --forceCompute '{meshroom_file_path}'"],"execution_count":null,"outputs":[]}]}

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