Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/aind_exaspim_image_compression/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def predict(
model,
batch_size=32,
normalization_percentiles=(0.5, 99.9),
normalized_brightness_clip=7,
patch_size=64,
overlap=12,
trim=5,
Expand All @@ -45,6 +46,9 @@ def predict(
normalization_percentiles : Tuple[int], optional
Lower and upper percentiles used for normalization. Default is
(0.5, 99.9).
normalized_brightness_clip : float, optional
Brightness value used as an upper limit that normalized intensities
are clipped to. Default is 10.
patch_size : int, optional
Size of the cubic patch extracted from the image. Default is 64.
overlap : int, optional
Expand Down Expand Up @@ -262,6 +266,7 @@ def load_model(path, device="cuda"):
"""
model = UNet()
model.load_state_dict(torch.load(path, map_location=device))
model.to(device)
model.eval()
return model

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ def __init__(
normalization_percentiles : Tuple[float], optional
Upper and lower percentiles used to normalize the input image.
Default is (0.5, 99.5).
normalized_brightness_clip : float, optional
Brightness value used as an upper limit that normalized intensities
are clipped to. Default is 10.
sigma_bm4d : float, optional
Smoothing parameter used in the BM4D denoising algorithm. Default
is 16.
Expand Down
Loading