Skip to content

Commit

Permalink
feat: refactor tal.render module (see curldivergence PR) and minor im…
Browse files Browse the repository at this point in the history
…provements

- yaml CLoader/CDumper for more performance
- add mini test suite (can be run with pytest command, renders
  a single/confocal/exhaustive scene)
- fix minor stuff in the examples
  • Loading branch information
diegoroyo committed Jul 15, 2024
1 parent 2ce15b0 commit e20b4be
Show file tree
Hide file tree
Showing 19 changed files with 797 additions and 1,403 deletions.
117 changes: 62 additions & 55 deletions examples/render-reconstruct-confocal/fbp.ipynb

Large diffs are not rendered by default.

736 changes: 0 additions & 736 deletions examples/render-reconstruct-confocal/pf_dev.ipynb

This file was deleted.

78 changes: 39 additions & 39 deletions examples/render-reconstruct-exhaustive/fbp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"source": [
"import tal\n",
"\n",
"data = tal.io.read_capture('/media/pleiades/vault/projects/202206-tal/code/examples/render-reconstruct-exhaustive/exhaustive-scene/20240621-193320/exhaustive-scene.hdf5') # you'll need to generate this file using \"tal render exhaustive-scene\"\n",
"data = tal.io.read_capture('exhaustive-scene.hdf5') # you'll need to generate this file using \"tal render exhaustive-scene\"\n",
"tal.reconstruct.compensate_laser_cos_dsqr(data)"
]
},
Expand Down Expand Up @@ -37,7 +37,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:29<00:00, 9.92s/it]\n"
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:23<00:00, 7.91s/it]\n"
]
},
{
Expand Down Expand Up @@ -89,9 +89,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:15<00:00, 5.00s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:15<00:00, 5.00s/it]\n",
"tal.resources progress: 100%|██████████| 2/2 [00:04<00:00, 2.15s/it]\n"
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:12<00:00, 4.05s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:12<00:00, 4.05s/it]\n",
"tal.resources progress: 100%|██████████| 2/2 [00:01<00:00, 1.01it/s]\n"
]
},
{
Expand All @@ -106,7 +106,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.resources progress: 100%|██████████| 2/2 [00:00<00:00, 15033.35it/s]\n"
"tal.resources progress: 100%|██████████| 2/2 [00:00<00:00, 16513.01it/s]\n"
]
}
],
Expand Down Expand Up @@ -152,11 +152,11 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:05<00:00, 1.98s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:06<00:00, 2.10s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:05<00:00, 1.98s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:06<00:00, 2.01s/it]\n",
"tal.resources progress: 100%|██████████| 4/4 [00:01<00:00, 2.20it/s]\n"
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:06<00:00, 2.31s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:07<00:00, 2.47s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:05<00:00, 1.91s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:05<00:00, 1.83s/it]\n",
"tal.resources progress: 100%|██████████| 4/4 [00:02<00:00, 1.80it/s]\n"
]
},
{
Expand All @@ -171,7 +171,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.resources progress: 100%|██████████| 4/4 [00:00<00:00, 41020.09it/s]\n"
"tal.resources progress: 100%|██████████| 4/4 [00:00<00:00, 25970.92it/s]\n"
]
}
],
Expand Down Expand Up @@ -217,9 +217,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:13<00:00, 4.60s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:13<00:00, 4.60s/it]\n",
"tal.resources progress: 100%|██████████| 2/2 [00:02<00:00, 1.31s/it]\n"
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:12<00:00, 4.10s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:12<00:00, 4.12s/it]\n",
"tal.resources progress: 100%|██████████| 2/2 [00:01<00:00, 1.00it/s]\n"
]
},
{
Expand All @@ -234,7 +234,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.resources progress: 100%|██████████| 2/2 [00:00<00:00, 26546.23it/s]\n"
"tal.resources progress: 100%|██████████| 2/2 [00:00<00:00, 14004.35it/s]\n"
]
}
],
Expand Down Expand Up @@ -282,9 +282,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:17<00:00, 5.73s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:18<00:00, 6.12s/it]\n",
"tal.resources progress: 100%|██████████| 2/2 [00:04<00:00, 2.26s/it]\n"
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:11<00:00, 3.93s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:12<00:00, 4.26s/it]\n",
"tal.resources progress: 100%|██████████| 2/2 [00:03<00:00, 1.60s/it]\n"
]
},
{
Expand All @@ -299,7 +299,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.resources progress: 100%|██████████| 2/2 [00:00<00:00, 19195.90it/s]\n"
"tal.resources progress: 100%|██████████| 2/2 [00:00<00:00, 12671.61it/s]\n"
]
}
],
Expand Down Expand Up @@ -347,9 +347,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:16<00:00, 5.42s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:16<00:00, 5.42s/it]\n",
"tal.resources progress: 100%|██████████| 2/2 [00:04<00:00, 2.25s/it]\n"
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:14<00:00, 4.72s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:14<00:00, 4.83s/it]\n",
"tal.resources progress: 100%|██████████| 2/2 [00:02<00:00, 1.20s/it]\n"
]
},
{
Expand All @@ -364,7 +364,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.resources progress: 100%|██████████| 2/2 [00:00<00:00, 27503.63it/s]\n"
"tal.resources progress: 100%|██████████| 2/2 [00:00<00:00, 23497.50it/s]\n"
]
}
],
Expand Down Expand Up @@ -412,9 +412,9 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:14<00:00, 4.79s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:14<00:00, 4.82s/it]\n",
"tal.resources progress: 100%|██████████| 2/2 [00:05<00:00, 2.78s/it]\n"
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:13<00:00, 4.61s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:13<00:00, 4.63s/it]\n",
"tal.resources progress: 100%|██████████| 2/2 [00:03<00:00, 1.68s/it]\n"
]
},
{
Expand All @@ -429,7 +429,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.resources progress: 100%|██████████| 2/2 [00:00<00:00, 11831.61it/s]\n"
"tal.resources progress: 100%|██████████| 2/2 [00:00<00:00, 27776.85it/s]\n"
]
}
],
Expand Down Expand Up @@ -462,18 +462,18 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"import tal\n",
"\n",
"data = tal.io.read_capture('/media/pleiades/vault/projects/202206-tal/code/examples/render-reconstruct-exhaustive/exhaustive-scene/20240621-193320/exhaustive-scene.hdf5')"
"data = tal.io.read_capture('exhaustive-scene.hdf5')"
]
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": 18,
"metadata": {},
"outputs": [
{
Expand All @@ -488,11 +488,11 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:06<00:00, 2.07s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:06<00:00, 2.08s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:06<00:00, 2.31s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:06<00:00, 2.31s/it]\n",
"tal.resources progress: 100%|██████████| 4/4 [00:02<00:00, 1.73it/s]\n"
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:06<00:00, 2.02s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:06<00:00, 2.24s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:05<00:00, 1.96s/it]\n",
"tal.reconstruct.filter_H (pf, 3/3): 100%|██████████| 3/3 [00:05<00:00, 1.96s/it]\n",
"tal.resources progress: 100%|██████████| 4/4 [00:01<00:00, 2.19it/s]\n"
]
},
{
Expand All @@ -507,7 +507,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"tal.resources progress: 100%|██████████| 4/4 [00:00<00:00, 48349.33it/s]\n"
"tal.resources progress: 100%|██████████| 4/4 [00:00<00:00, 37449.14it/s]\n"
]
}
],
Expand All @@ -518,7 +518,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": 19,
"metadata": {},
"outputs": [
{
Expand All @@ -538,7 +538,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": 20,
"metadata": {},
"outputs": [
{
Expand Down
Loading

0 comments on commit e20b4be

Please sign in to comment.