Revisions
-
natowi renamed this gist
Mar 28, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
natowi revised this gist
Dec 3, 2019 . 1 changed file with 116 additions and 8 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,114 @@ "**Meshroom for GoogleColab**\n", "\n", "This is an example on how to use Meshroom in GoogleColab with uploaded images to generate a textured mesh (OBJ) that can be downloaded.\n", "\n" ] }, { "cell_type": "markdown", "metadata": { "id": "3wBFjbjIz9ZX", "colab_type": "text" }, "source": [ "**0. Connect to Google Drive (optional)**\n", "\n", "Paste your authorisation code and resume with Enter\n" ] }, { "cell_type": "code", "metadata": { "id": "NB2T3gnb1GY4", "colab_type": "code", "colab": {} }, "source": [ "from google.colab import drive\n", "drive.mount('/content/drive')" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "Ubwkqcdb5NG_", "colab_type": "text" }, "source": [ "Navigate to the root folder of your Google Drive" ] }, { "cell_type": "code", "metadata": { "id": "HIsZd9i70xVT", "colab_type": "code", "colab": {} }, "source": [ "%cd drive/My Drive" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "ps9PVfiK5WDl", "colab_type": "text" }, "source": [ "Now you can open an existing project folder **or** create a new one" ] }, { "cell_type": "code", "metadata": { "id": "h19HySRO4fC3", "colab_type": "code", "colab": {} }, "source": [ "# open existing\n", "%cd YOUR/PROJECT/FOLDER" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "o0sl70x46PdQ", "colab_type": "text" }, "source": [ "**or**" ] }, { "cell_type": "code", "metadata": { "id": "WIQjlbAP4ncy", "colab_type": "code", "colab": {} }, "source": [ "# create new (replace test with your new folder name)\n", "!mkdir test\n", "%cd test" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "7kShJYbj6GS6", "colab_type": "text" }, "source": [ "**1. Download Meshroom 2019.2**" ] }, @@ -51,8 +158,7 @@ "colab_type": "text" }, "source": [ "Create folder for image upload (§ can be skipped when using Google Drive)\n" ] }, { @@ -75,7 +181,7 @@ "colab_type": "text" }, "source": [ "Change dir before upload (§)" ] }, { @@ -98,7 +204,7 @@ "colab_type": "text" }, "source": [ "Test directory (§)" ] }, { @@ -121,7 +227,7 @@ "colab_type": "text" }, "source": [ "**2. Upload images** (§)\n", "\n", "(It is possible to link to a GoogleDrive folder instead. Might be added in the future to this notepad)" ] @@ -153,7 +259,7 @@ "colab_type": "text" }, "source": [ "List uploaded images (§)" ] }, { @@ -176,7 +282,7 @@ "colab_type": "text" }, "source": [ "Navigate back to content folder (§)" ] }, { @@ -205,7 +311,9 @@ "\n", "The node temp files are stored in the **temp** folder, the **out** is only for the final result.\n", "\n", "(It is possible to use a Meshroom graph file (.mg) with costumized parameters and nodes instead of the following default pipeline. Might be added to this notepad in the future)\n", "\n", "When using Google Drive, provide the path to your image folder: --input YOUR/IMAGEs/FOLDER/PATH (the easiest solution is to create a input folder in ./yourprojectfolder/meshroom/Meshroom-2019.2.0/meshroom_photogrammetry with all your images)" ] }, { -
natowi revised this gist
Nov 26, 2019 . 1 changed file with 142 additions and 24 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,9 +22,11 @@ }, "source": [ "\n", "**Meshroom for GoogleColab**\n", "\n", "This is an example on how to use Meshroom in GoogleColab with uploaded images to generate a textured mesh (OBJ) that can be downloaded.\n", "\n", "**1. Download Meshroom 2019.2**" ] }, { @@ -35,9 +37,9 @@ "colab": {} }, "source": [ "!wget -N https://github.com/alicevision/meshroom/releases/download/v2019.2.0/Meshroom-2019.2.0-linux.tar.gz\n", "!mkdir meshroom\n", "!tar xzf Meshroom-2019.2.0-linux.tar.gz -C ./meshroom" ], "execution_count": 0, "outputs": [] @@ -50,9 +52,7 @@ }, "source": [ "\n", "Create folder for image upload\n" ] }, { @@ -114,6 +114,18 @@ "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "zUd42W__QE2p", "colab_type": "text" }, "source": [ "**2. Upload images**\n", "\n", "(It is possible to link to a GoogleDrive folder instead. Might be added in the future to this notepad)" ] }, { "cell_type": "code", "metadata": { @@ -141,7 +153,7 @@ "colab_type": "text" }, "source": [ "List uploaded images" ] }, { @@ -189,10 +201,11 @@ }, "source": [ "\n", "**3. Run Meshroom**\n", "\n", "The node temp files are stored in the **temp** folder, the **out** is only for the final result.\n", "\n", "(It is possible to use a Meshroom graph file (.mg) with costumized parameters and nodes instead of the following default pipeline. Might be added to this notepad in the future)" ] }, { @@ -204,7 +217,122 @@ }, "source": [ "!mkdir ./out\n", "!./meshroom/Meshroom-2019.2.0/meshroom_photogrammetry --input ./input --output ./out\n" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "49aKN-I0Oddu", "colab_type": "text" }, "source": [ "**4. Preview Mesh using Trimesh (optional)** \n", "\n", "This is experimental and not optimized" ] }, { "cell_type": "code", "metadata": { "id": "uY7p1hKj81Uq", "colab_type": "code", "colab": {} }, "source": [ "!pip install numpy" ], "execution_count": 0, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "JjZ84tdLRi9b", "colab_type": "code", "colab": {} }, "source": [ "!pip install trimesh" ], "execution_count": 0, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "exhdh1bu_8VY", "colab_type": "code", "colab": {} }, "source": [ "!ls" ], "execution_count": 0, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "9SwOo0WCRtmw", "colab_type": "code", "colab": {} }, "source": [ "%cd out" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "kTYgiJauVF26", "colab_type": "text" }, "source": [ "Start preview" ] }, { "cell_type": "code", "metadata": { "id": "fWi3nrpn8_ZT", "colab_type": "code", "colab": {} }, "source": [ "import numpy as np\n", "import trimesh\n", "mesh = trimesh.load_mesh('texturedMesh.obj')\n", "mesh.show()" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "dV3uF6ZmCX-x", "colab_type": "text" }, "source": [ "Read https://trimsh.org/examples/quick_start.html for details\n", "\n", "**Before downloading, change back to the contents folder:**" ] }, { "cell_type": "code", "metadata": { "id": "-6dc2xQ8SJYT", "colab_type": "code", "colab": {} }, "source": [ "%cd ../" ], "execution_count": 0, "outputs": [] @@ -217,9 +345,9 @@ }, "source": [ "\n", "**5. Download**\n", "\n", "Use the prefered download format (tar.gz or zip)\n" ] }, { @@ -252,16 +380,6 @@ ], "execution_count": 0, "outputs": [] } ] } -
natowi revised this gist
Nov 6, 2019 . 1 changed file with 153 additions and 44 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,9 +3,9 @@ "nbformat_minor": 0, "metadata": { "colab": { "name": "MR2.ipynb", "provenance": [], "collapsed_sections": [] }, "kernelspec": { "name": "python3", @@ -17,23 +17,24 @@ { "cell_type": "markdown", "metadata": { "id": "TZh8CZsjwfD1", "colab_type": "text" }, "source": [ "\n", "Setup\n", "\n", "Download Meshroom\n" ] }, { "cell_type": "code", "metadata": { "id": "b4HH_r8CwZXa", "colab_type": "code", "colab": {} }, "source": [ "!wget -N https://github.com/alicevision/meshroom/releases/download/v2019.1.0/Meshroom-2019.1.0-linux.tar.gz\n", "!mkdir meshroom\n", "!tar xzf Meshroom-2019.1.0-linux.tar.gz -C ./meshroom" @@ -44,114 +45,222 @@ { "cell_type": "markdown", "metadata": { "id": "mmSZ5le1wl1r", "colab_type": "text" }, "source": [ "\n", "Upload data\n", "\n", "Optional upload of pipline file and image source files\n" ] }, { "cell_type": "code", "metadata": { "id": "BP3p_lGEq69X", "colab_type": "code", "colab": {} }, "source": [ "!mkdir input" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "bnYMYBQlrL0u", "colab_type": "text" }, "source": [ "Change dir before upload" ] }, { "cell_type": "code", "metadata": { "id": "d9NW_koxq-wj", "colab_type": "code", "colab": {} }, "source": [ "%cd input" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "GqxXyUJYrdV5", "colab_type": "text" }, "source": [ "Test directory" ] }, { "cell_type": "code", "metadata": { "id": "KI9G_jvtrgOm", "colab_type": "code", "colab": {} }, "source": [ "!ls" ], "execution_count": 0, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "MpXT0L6ywoSa", "colab_type": "code", "colab": {} }, "source": [ "from google.colab import files\n", "\n", "# optional upload for the images\n", "\n", "uploaded = files.upload()\n", "\n", "for fn in uploaded.keys():\n", " print('User uploaded file \"{name}\" with length {length} bytes'.format( name=fn, length=len(uploaded[fn])))" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "Pc_52Wh9ruQF", "colab_type": "text" }, "source": [ "List Input contents" ] }, { "cell_type": "code", "metadata": { "id": "RcIHvaherrAb", "colab_type": "code", "colab": {} }, "source": [ "!ls" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "QMspCFLAs_K7", "colab_type": "text" }, "source": [ "Navigate back to content folder" ] }, { "cell_type": "code", "metadata": { "id": "2TywJh4lsNDK", "colab_type": "code", "colab": {} }, "source": [ "%cd ../\n", "!ls" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "4E_kAx-2wq3O", "colab_type": "text" }, "source": [ "\n", "Meshing\n", "\n", "use the --pipeline argument to provide a path to the meshfile you created/uploaded\n", "Note: the node temp files are stored in the temp folder out is only for the final result" ] }, { "cell_type": "code", "metadata": { "id": "3GimHqrGwsmu", "colab_type": "code", "colab": {} }, "source": [ "!mkdir ./out\n", "!./meshroom/Meshroom-2019.1.0/meshroom_photogrammetry --input ./input --output ./out\n" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "_EZJtblswuZy", "colab_type": "text" }, "source": [ "\n", "Download\n", "\n", "Use the prefered download format\n" ] }, { "cell_type": "code", "metadata": { "id": "IirusdKJwz-6", "colab_type": "code", "colab": {} }, "source": [ "!tar -czvf out.tar.gz ./out\n", "from google.colab import files\n", "\n", "\n", "files.download('out.tar.gz')" ], "execution_count": 0, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "VQ8F_rxPw4dK", "colab_type": "code", "colab": {} }, "source": [ "!zip -r out.zip ./out\n", "files.download('out.zip')" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "NNzXTKPYwwl3", "colab_type": "text" }, "source": [ "" ] } ] -
donmahallem revised this gist
Jul 8, 2019 . 1 changed file with 69 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,17 @@ "accelerator": "GPU" }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "RD3eZSm6d6NZ", "colab_type": "text" }, "source": [ "#Setup\n", "Download Meshroom and Data\n" ] }, { "cell_type": "code", "metadata": { @@ -30,6 +41,48 @@ "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "zTI6AlUXd-_M", "colab_type": "text" }, "source": [ "#Upload data\n", "Optional upload of pipline file and image source files\n" ] }, { "cell_type": "code", "metadata": { "id": "9_BfARNUdd_a", "colab_type": "code", "colab": {} }, "source": [ "from google.colab import files\n", "\n", "# optional upload for the meshfile\n", "\n", "uploaded = files.upload()\n", "\n", "for fn in uploaded.keys():\n", " print('User uploaded file \"{name}\" with length {length} bytes'.format( name=fn, length=len(uploaded[fn])))\n" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "xA_XKpKqdoqb", "colab_type": "text" }, "source": [ "#Meshing\n", "use the --pipeline argument to provide a path to the meshfile you created/uploaded" ] }, { "cell_type": "code", "metadata": { @@ -39,11 +92,22 @@ }, "source": [ "!mkdir ./buddha_out\n", "!./meshroom/Meshroom-2019.1.0/meshroom_photogrammetry --input ./dataset_buddha/buddha --output ./buddha_out\n" ], "execution_count": 0, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "7wwo3nPyd0-w", "colab_type": "text" }, "source": [ "#Download\n", "Use the prefered download format\n" ] }, { "cell_type": "code", "metadata": { @@ -81,7 +145,10 @@ { "output_type": "stream", "text": [ " adding: buddha_out/ (stored 0%)\n", " adding: buddha_out/texture_0.png (deflated 0%)\n", " adding: buddha_out/texturedMesh.obj (deflated 72%)\n", " adding: buddha_out/texturedMesh.mtl (deflated 28%)\n" ], "name": "stdout" } -
donmahallem revised this gist
Jul 8, 2019 . 1 changed file with 91 additions and 21 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,21 +1,91 @@ { "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "meshroom_test.ipynb", "version": "0.3.2", "provenance": [] }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "accelerator": "GPU" }, "cells": [ { "cell_type": "code", "metadata": { "id": "cQgXdvk-qUvi", "colab_type": "code", "colab": {} }, "source": [ "!git clone https://github.com/alicevision/dataset_buddha\n", "!wget -N https://github.com/alicevision/meshroom/releases/download/v2019.1.0/Meshroom-2019.1.0-linux.tar.gz\n", "!mkdir meshroom\n", "!tar xzf Meshroom-2019.1.0-linux.tar.gz -C ./meshroom" ], "execution_count": 0, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "AZWyk461sxGI", "colab_type": "code", "colab": {} }, "source": [ "!mkdir ./buddha_out\n", "!./meshroom/Meshroom-2019.1.0/meshroom_photogrammetry --input ./dataset_buddha/buddha --output ./buddha_out --scale 2" ], "execution_count": 0, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "SPEdzNMo5fV6", "colab_type": "code", "colab": {} }, "source": [ "!tar -czvf meshbuddha.tar.gz ./buddha_out\n", "from google.colab import files\n", "\n", "\n", "files.download('meshbuddha.tar.gz')" ], "execution_count": 0, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "rAXWX6SX8J_q", "colab_type": "code", "colab": { "base_uri": "https://localhost:8080/", "height": 85 }, "outputId": "168b3acd-bd30-47c7-ca77-b6870306dd78" }, "source": [ "!zip -r meshbuddha.zip ./buddha_out\n", "files.download('meshbuddha.zip')" ], "execution_count": 19, "outputs": [ { "output_type": "stream", "text": [ "" ], "name": "stdout" } ] } ] } -
donmahallem created this gist
Jul 8, 2019 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ !git clone https://github.com/alicevision/dataset_buddha !wget -N https://github.com/alicevision/meshroom/releases/download/v2019.1.0/Meshroom-2019.1.0-linux.tar.gz !mkdir meshroom !tar xzf Meshroom-2019.1.0-linux.tar.gz -C ./meshroom from google.colab import files # optional upload for the meshfile uploaded = files.upload() for fn in uploaded.keys(): print('User uploaded file "{name}" with length {length} bytes'.format( name=fn, length=len(uploaded[fn]))) for fn in uploaded.keys(): print('User uploaded file "{name}" with length {length} bytes'.format( name=fn, length=len(uploaded[fn]))) !mkdir ./buddha_out # use the --pipeline argument to provide a path to the meshfile you created !./meshroom/Meshroom-2019.1.0/meshroom_photogrammetry --input ./dataset_buddha/buddha --output ./buddha_out !tar -czvf meshbuddha.tar.gz ./buddha_out files.download('meshbuddha.tar.gz')