Commit 10eb3892 authored by Jeremy Reizenstein's avatar Jeremy Reizenstein Committed by Facebook GitHub Bot
Browse files

Downloads from utils in a couple of tutorials

Summary: Fixes #514, so we don't assume user of the tutorial has access to utils.

Reviewed By: nikhilaravi

Differential Revision: D29557294

fbshipit-source-id: 10ac994be65df0822d3ee4e9d690189ff13074a2
parent 68a35543
...@@ -106,11 +106,6 @@ ...@@ -106,11 +106,6 @@
" ray_bundle_to_ray_points,\n", " ray_bundle_to_ray_points,\n",
")\n", ")\n",
"\n", "\n",
"# add path for demo utils functions \n",
"sys.path.append(os.path.abspath(''))\n",
"from utils.plot_image_grid import image_grid\n",
"from utils.generate_cow_renders import generate_cow_renders\n",
"\n",
"# obtain the utilized device\n", "# obtain the utilized device\n",
"if torch.cuda.is_available():\n", "if torch.cuda.is_available():\n",
" device = torch.device(\"cuda:0\")\n", " device = torch.device(\"cuda:0\")\n",
...@@ -125,6 +120,35 @@ ...@@ -125,6 +120,35 @@
" device = torch.device(\"cpu\")" " device = torch.device(\"cpu\")"
] ]
}, },
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!wget https://raw.githubusercontent.com/facebookresearch/pytorch3d/master/docs/tutorials/utils/plot_image_grid.py\n",
"!wget https://raw.githubusercontent.com/facebookresearch/pytorch3d/master/docs/tutorials/utils/generate_cow_renders.py\n",
"from plot_image_grid import image_grid\n",
"from generate_cow_renders import generate_cow_renders"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"OR if running locally uncomment and run the following cell:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# from utils.generate_cow_renders import generate_cow_renders\n",
"# from utils import image_grid"
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
......
...@@ -92,11 +92,6 @@ ...@@ -92,11 +92,6 @@
")\n", ")\n",
"from pytorch3d.transforms import so3_exp_map\n", "from pytorch3d.transforms import so3_exp_map\n",
"\n", "\n",
"# add path for demo utils functions \n",
"sys.path.append(os.path.abspath(''))\n",
"from utils.plot_image_grid import image_grid\n",
"from utils.generate_cow_renders import generate_cow_renders\n",
"\n",
"# obtain the utilized device\n", "# obtain the utilized device\n",
"if torch.cuda.is_available():\n", "if torch.cuda.is_available():\n",
" device = torch.device(\"cuda:0\")\n", " device = torch.device(\"cuda:0\")\n",
...@@ -105,6 +100,35 @@ ...@@ -105,6 +100,35 @@
" device = torch.device(\"cpu\")" " device = torch.device(\"cpu\")"
] ]
}, },
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!wget https://raw.githubusercontent.com/facebookresearch/pytorch3d/master/docs/tutorials/utils/plot_image_grid.py\n",
"!wget https://raw.githubusercontent.com/facebookresearch/pytorch3d/master/docs/tutorials/utils/generate_cow_renders.py\n",
"from plot_image_grid import image_grid\n",
"from generate_cow_renders import generate_cow_renders"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"OR if running locally uncomment and run the following cell:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# from utils.generate_cow_renders import generate_cow_renders\n",
"# from utils import image_grid"
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment