Skip to content

Instantly share code, notes, and snippets.

@alex4men
Forked from donmahallem/MeshroomCollab.ipynb
Created August 21, 2019 11:41
Show Gist options
  • Save alex4men/8570226a26833ec1bda1a50f047d2170 to your computer and use it in GitHub Desktop.
Save alex4men/8570226a26833ec1bda1a50f047d2170 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"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": "markdown",
"metadata": {
"id": "RD3eZSm6d6NZ",
"colab_type": "text"
},
"source": [
"#Setup\n",
"Download Meshroom and Data\n"
]
},
{
"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": "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": {
"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\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": {
"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": [
" 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"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment