Skip to content

Commit 10eb389

Browse files
bottlerfacebook-github-bot
authored andcommitted
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
1 parent 68a3554 commit 10eb389

File tree

2 files changed

+58
-10
lines changed

2 files changed

+58
-10
lines changed

docs/tutorials/fit_simple_neural_radiance_field.ipynb

+29-5
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@
106106
" ray_bundle_to_ray_points,\n",
107107
")\n",
108108
"\n",
109-
"# add path for demo utils functions \n",
110-
"sys.path.append(os.path.abspath(''))\n",
111-
"from utils.plot_image_grid import image_grid\n",
112-
"from utils.generate_cow_renders import generate_cow_renders\n",
113-
"\n",
114109
"# obtain the utilized device\n",
115110
"if torch.cuda.is_available():\n",
116111
" device = torch.device(\"cuda:0\")\n",
@@ -125,6 +120,35 @@
125120
" device = torch.device(\"cpu\")"
126121
]
127122
},
123+
{
124+
"cell_type": "code",
125+
"execution_count": null,
126+
"metadata": {},
127+
"outputs": [],
128+
"source": [
129+
"!wget https://raw.githubusercontent.com/facebookresearch/pytorch3d/master/docs/tutorials/utils/plot_image_grid.py\n",
130+
"!wget https://raw.githubusercontent.com/facebookresearch/pytorch3d/master/docs/tutorials/utils/generate_cow_renders.py\n",
131+
"from plot_image_grid import image_grid\n",
132+
"from generate_cow_renders import generate_cow_renders"
133+
]
134+
},
135+
{
136+
"cell_type": "markdown",
137+
"metadata": {},
138+
"source": [
139+
"OR if running locally uncomment and run the following cell:"
140+
]
141+
},
142+
{
143+
"cell_type": "code",
144+
"execution_count": null,
145+
"metadata": {},
146+
"outputs": [],
147+
"source": [
148+
"# from utils.generate_cow_renders import generate_cow_renders\n",
149+
"# from utils import image_grid"
150+
]
151+
},
128152
{
129153
"cell_type": "markdown",
130154
"metadata": {},

docs/tutorials/fit_textured_volume.ipynb

+29-5
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@
9292
")\n",
9393
"from pytorch3d.transforms import so3_exp_map\n",
9494
"\n",
95-
"# add path for demo utils functions \n",
96-
"sys.path.append(os.path.abspath(''))\n",
97-
"from utils.plot_image_grid import image_grid\n",
98-
"from utils.generate_cow_renders import generate_cow_renders\n",
99-
"\n",
10095
"# obtain the utilized device\n",
10196
"if torch.cuda.is_available():\n",
10297
" device = torch.device(\"cuda:0\")\n",
@@ -105,6 +100,35 @@
105100
" device = torch.device(\"cpu\")"
106101
]
107102
},
103+
{
104+
"cell_type": "code",
105+
"execution_count": null,
106+
"metadata": {},
107+
"outputs": [],
108+
"source": [
109+
"!wget https://raw.githubusercontent.com/facebookresearch/pytorch3d/master/docs/tutorials/utils/plot_image_grid.py\n",
110+
"!wget https://raw.githubusercontent.com/facebookresearch/pytorch3d/master/docs/tutorials/utils/generate_cow_renders.py\n",
111+
"from plot_image_grid import image_grid\n",
112+
"from generate_cow_renders import generate_cow_renders"
113+
]
114+
},
115+
{
116+
"cell_type": "markdown",
117+
"metadata": {},
118+
"source": [
119+
"OR if running locally uncomment and run the following cell:"
120+
]
121+
},
122+
{
123+
"cell_type": "code",
124+
"execution_count": null,
125+
"metadata": {},
126+
"outputs": [],
127+
"source": [
128+
"# from utils.generate_cow_renders import generate_cow_renders\n",
129+
"# from utils import image_grid"
130+
]
131+
},
108132
{
109133
"cell_type": "markdown",
110134
"metadata": {},

0 commit comments

Comments
 (0)