Skip to content

Commit

Permalink
Add notebook with modular reconstruction results.
Browse files Browse the repository at this point in the history
  • Loading branch information
ebezzam committed Jan 16, 2024
1 parent af4942f commit 434ad89
Show file tree
Hide file tree
Showing 2 changed files with 804 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lensless/recon/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def load_drunet(model_path=None, n_channels=3, requires_grad=False):
"""

if model_path is None:
model_path = os.path.join(get_original_cwd(), "models", "drunet_color.pth")
this_file_path = os.path.dirname(os.path.realpath(__file__))
model_path = os.path.join(this_file_path, "..", "..", "models", "drunet_color.pth")
if not os.path.exists(model_path):
try:
from torchvision.datasets.utils import download_url
Expand Down Expand Up @@ -829,7 +830,7 @@ def train(self, n_epoch=1, save_pt=None, disp=None):
self.on_epoch_end(mean_loss, save_pt, epoch + 1, disp=disp)
self.scheduler.step()

self.print(f"Train time : {time.time() - start_time} s")
self.print(f"Train time [hour] : {(time.time() - start_time) / 3600} h")

def save(self, epoch, path="recon", include_optimizer=False):
# create directory if it does not exist
Expand Down
801 changes: 801 additions & 0 deletions notebooks/modular_physics_based.ipynb

Large diffs are not rendered by default.

0 comments on commit 434ad89

Please sign in to comment.