Skip to content

Commit

Permalink
Remove redundant data (#103)
Browse files Browse the repository at this point in the history
RaySamples contained fields for bin_starts and bin_ends. These are also stored in the frustums. This PR removes them from the RaySamples.
  • Loading branch information
tancik authored Jul 8, 2022
1 parent be45d5c commit 7428011
Show file tree
Hide file tree
Showing 12 changed files with 144,414 additions and 144,425 deletions.
23 changes: 8 additions & 15 deletions docs/notebooks/visualize_samplers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"import torch\n",
"from pyrad.cameras.rays import RayBundle\n",
"from pyrad.graphs.modules import ray_sampler\n",
"from matplotlib import pyplot as plt"
"from matplotlib import pyplot as plt\n"
]
},
{
Expand All @@ -30,7 +30,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -102,26 +102,19 @@
" origins=torch.ones([1, 3]),\n",
" directions=torch.ones([1, 3]),\n",
" pixel_area=torch.ones([1, 1]),\n",
" nears=torch.ones([1]) * near,\n",
" fars=torch.ones([1]) * far,\n",
" nears=torch.ones([1, 1]) * near,\n",
" fars=torch.ones([1, 1]) * far,\n",
" )\n",
"\n",
" samples = sampler.generate_ray_samples(ray_bundle)\n",
" samples.bin_starts.shape\n",
" samples.frustums.starts.shape\n",
"\n",
" plt.hist(samples.bin_starts, alpha=0.5, bins=100)\n",
" plt.hist(samples.frustums.starts[0,:,0], alpha=0.5, bins=100)\n",
" plt.xlabel(\"Distance\")\n",
" plt.ylabel(\"# Samples\")\n",
" plt.title(name)\n",
" plt.show()"
" plt.show()\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit 7428011

Please sign in to comment.