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
This commit is contained in:
Jeremy Reizenstein 2021-07-06 15:31:16 -07:00 committed by Facebook GitHub Bot
parent 68a35543d5
commit 10eb3892da
2 changed files with 58 additions and 10 deletions

View File

@ -106,11 +106,6 @@
" ray_bundle_to_ray_points,\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",
"if torch.cuda.is_available():\n",
" device = torch.device(\"cuda:0\")\n",
@ -125,6 +120,35 @@
" 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",
"metadata": {},

View File

@ -92,11 +92,6 @@
")\n",
"from pytorch3d.transforms import so3_exp_map\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",
"if torch.cuda.is_available():\n",
" device = torch.device(\"cuda:0\")\n",
@ -105,6 +100,35 @@
" 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",
"metadata": {},