Skip to content

Commit

Permalink
Merge pull request #28 from hi-paris/some_minor_fixes
Browse files Browse the repository at this point in the history
Some minor fixes
  • Loading branch information
brash6 authored Apr 19, 2024
2 parents b1e1003 + f43584c commit 4d37960
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Speckle noise seriously limits the interpretability of synthetic aperture radar

[![PyPI version](https://badge.fury.io/py/deepdespeckling.svg)](https://badge.fury.io/py/deepdespeckling)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Inline docs](icons/doc.svg)](https://inch-ci.org/github/dwyl/hapi-auth-jwt2)

## Installation

Expand Down Expand Up @@ -149,7 +150,7 @@ image = cos2mat(image_path).astype(np.float32)
# Denoise the image with SAR2SAR
denoiser = Sar2SarDenoiser()
denoised_image = denoiser.denoise_image(
image, model_weights_path, patch_size=PATCH_SIZE, stride_size=STRIDE_SIZE)
image, patch_size=PATCH_SIZE, stride_size=STRIDE_SIZE)
```

- Example of result with SAR2SAR :
Expand Down
4 changes: 2 additions & 2 deletions deepdespeckling/merlin/merlin_denoiser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, model_name, symetrise, **params):
"""Initialize MerlinDenoiser class
Args:
model_name (str): name to be used, can be "spotlight", "stripmap" or "Sentinel_TOPS"
model_name (str): name to be used, can be "spotlight", "stripmap" or "Sentinel-TOPS"
"""
super().__init__(**params)
self.model_name = model_name
Expand All @@ -42,7 +42,7 @@ def init_model_weights_path(self) -> str:
elif self.model_name == "stripmap":
model_weights_path = os.path.join(
current_dir, "saved_models/stripmap.pth")
elif self.model_name == "Sentinel_TOPS":
elif self.model_name == "Sentinel-TOPS":
model_weights_path = os.path.join(
current_dir, "saved_models/sentinel_tops.pth")
else:
Expand Down
4 changes: 2 additions & 2 deletions deepdespeckling/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def symetrise_real_and_imaginary_parts(real_part: np.array, imag_part: np.array)
shift_az_2 = int(
round(-(d1 - 1 - p.shape[0]) / 2)) % p.shape[0] + int(p.shape[0] / 2)
p2_2 = np.roll(p, shift_az_2)
window = signal.gaussian(p.shape[0], std=0.2 * p.shape[0])
window = signal.windows.gaussian(p.shape[0], std=0.2 * p.shape[0])
test_1 = np.sum(window * p2_1)
test_2 = np.sum(window * p2_2)
# make sure the spectrum is symetrized and zeo-Doppler centered
Expand All @@ -260,7 +260,7 @@ def symetrise_real_and_imaginary_parts(real_part: np.array, imag_part: np.array)
shift_range_2 = int(
round(-(d2 - 1 - q.shape[0]) / 2)) % q.shape[0] + int(q.shape[0] / 2)
q2_2 = np.roll(q, shift_range_2)
window_r = signal.gaussian(q.shape[0], std=0.2 * q.shape[0])
window_r = signal.windows.gaussian(q.shape[0], std=0.2 * q.shape[0])
test_1 = np.sum(window_r * q2_1)
test_2 = np.sum(window_r * q2_2)
if test_1 >= test_2:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
name='deepdespeckling',
packages=find_packages(include=['deepdespeckling', 'deepdespeckling.*']),
url='https://github.com/hi-paris/deepdespeckling',
version='0.5',
version='0.6',
zip_safe=False,
)

0 comments on commit 4d37960

Please sign in to comment.