{"id":48623474,"url":"https://github.com/hi-paris/deepdespeckling","last_synced_at":"2026-04-09T04:12:07.317Z","repository":{"id":39794990,"uuid":"480773713","full_name":"hi-paris/deepdespeckling","owner":"hi-paris","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-14T13:45:19.000Z","size":19184,"stargazers_count":35,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-12-19T07:22:36.682Z","etag":null,"topics":["deep-learning","machine-learning","python-library","pytorch","satellite","satellite-imagery","synthetic-aperture-radar"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hi-paris.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst"}},"created_at":"2022-04-12T11:07:40.000Z","updated_at":"2024-01-18T11:40:31.543Z","dependencies_parsed_at":"2023-12-19T06:16:07.142Z","dependency_job_id":null,"html_url":"https://github.com/hi-paris/deepdespeckling","commit_stats":{"total_commits":62,"total_committers":5,"mean_commits":12.4,"dds":0.4838709677419355,"last_synced_commit":"e689f9a0518badc5cb6997725ac62c1b9c18e836"},"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"purl":"pkg:github/hi-paris/deepdespeckling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-paris%2Fdeepdespeckling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-paris%2Fdeepdespeckling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-paris%2Fdeepdespeckling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-paris%2Fdeepdespeckling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hi-paris","download_url":"https://codeload.github.com/hi-paris/deepdespeckling/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-paris%2Fdeepdespeckling/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31585060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","machine-learning","python-library","pytorch","satellite","satellite-imagery","synthetic-aperture-radar"],"created_at":"2026-04-09T04:12:06.852Z","updated_at":"2026-04-09T04:12:07.310Z","avatar_url":"https://github.com/hi-paris.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deepdespeckling \n\nSpeckle noise seriously limits the interpretability of synthetic aperture radar (SAR) images. This package provides \u003cstrong\u003edeep learning based despeckling methods\u003c/strong\u003e to denoise SAR images. \n\n\u003cstrong\u003edeepdespeckling\u003c/strong\u003e gives access to two different despeckling methods: \n\n* [MERLIN](https://arxiv.org/pdf/2110.13148.pdf) \n* [SAR2SAR](https://arxiv.org/pdf/2006.15037.pdf) \n\n\n[![PyPI version](https://badge.fury.io/py/deepdespeckling.svg)](https://badge.fury.io/py/deepdespeckling)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Inline docs](icons/doc.svg)](https://hi-paris.github.io/deepdespeckling/)\n\n## Installation\n\nBefore installing deepdespeckling, make sure to install gdal dependancies, it can be done using conda with the following command : \n```\nconda install -c conda-forge gdal\n```\n\nThen, deepdespeckling can be installed simply using pip :\n\n```python\npip install deepdespeckling\n```\n\n\n## Inference with MERLIN\n\nTo despeckle SAR images using MERLIN, images need to be in `.cos` or `.npy` format.\n\nIn order to get the right model, the `model_name` has to be specified when building a `MerlinDenoiser`.\n\nThis `model_name` can either be :\n- `\"spotlight\"` for SAR images retrieved with spotlight mode \n- `\"stripmap\"` for SAR images retrieved with stripmap mode\n- `\"Sentinel-TOPS\"` for SAR images retrieved with TOPS mode\n\n\nDuring the preprocessing steps of the noisy image for MERLIN, the real and the imaginary parts are \u003cstrong\u003e\"symetrised\"\u003c/strong\u003e (to match the theoretical assumptions of MERLIN). To skip this step, you can set the `symetrise` parameter to `False`\n\n\n### Despeckle one image with MERLIN\n\n```python\nfrom deepdespeckling.utils.load_cosar import cos2mat\nfrom deepdespeckling.utils.constants import PATCH_SIZE, STRIDE_SIZE\nfrom deepdespeckling.merlin.merlin_denoiser import MerlinDenoiser\n\n# Path to one image (cos or npy file)\nimage_path=\"path/to/image\"\n# Model name, can be \"spotlight\", \"stripmap\" or \"Sentinel-TOPS\"\nmodel_name = \"spotlight\"\nsymetrise = True\n\nimage = cos2mat(image_path).astype(np.float32)\n# As an alternative, you can load your image by being sure to put in the following format:\n# The shape of image is [img_height,img_width,2], where image[:,:,0] contains the real part and image[:,:,1] contains the imaginary part of the SLC SAR image.\n\ndenoiser = MerlinDenoiser(model_name=model_name, symetrise=symetrise)\ndenoised_image = denoiser.denoise_image(image, patch_size=PATCH_SIZE, stride_size=STRIDE_SIZE)\n```\n\n### Despeckle a set of images using MERLIN\n\nFor each of this method, you can choose between 3 different functions to despeckle a set of SAR images contained in a folder : \n\n* `despeckle()` to despeckle full size images\n* `despeckle_from_coordinates()` to despeckle a sub-part of the images defined by some coordinates\n* `despeckle_from_crop()` to despeckle a sub-part of the images defined using a crop tool\n\n#### Despeckle fullsize images\n\n```python\nfrom deepdespeckling.despeckling import despeckle\n\n# Path to a folder of several images (cos or npy files)\nimage_path=\"path/to/image\"\n# Folder where results are stored\ndestination_directory=\"path/where/to/save/results\"\n\ndespeckle(image_path, destination_directory, model_name=\"spotlight\", symetrise=True)\n```\nNoisy image             |  Denoised image\n:----------------------:|:-------------------------:\n![](img/entire/noisy.png)  |  ![](img/entire/denoised.png)\n\n#### Despeckle parts of images using custom coordinates\n\n```python\nfrom deepdespeckling.despeckling import despeckle_from_coordinates\n\n# Path to a folder of several images image (cos or npy files)\nimage_path=\"path/to/cosar/image\"\n# Folder where results are stored\ndestination_directory=\"path/where/to/save/results\"\n# Coordinates of the subparts of the images to be despeckled\ncoordinates_dictionnary = {'x_start':2600,'y_start':1000,'x_end':3000,'y_end':1200}\n\ndespeckle_from_coordinates(image_path, coordinates_dict, destination_directory, model_name=\"spotlight\", symetrise=True)\n```\n\nNoisy image             |  Denoised image\n:----------------------:|:-------------------------:\n![](img/coordinates/noisy_test_image_data.png)  |  ![](img/coordinates/denoised_test_image_data.png)\n\n#### Despeckle parts of images using a crop tool\n\n```python\nfrom deepdespeckling.merlin.inference.despeckling import despeckle_from_crop\n\n# Path to a folder of several images image (cos or npy files)\nimage_path=\"path/to/cosar/image\"\n# Folder where results are stored\ndestination_directory=\"path/where/to/save/results\"\nfixed = True \"(it will crop a 256*256 image from the position of your click)\" or False \"(you will draw free-handly the area of your interest)\"\n\ndespeckle_from_crop(image_path, destination_directory, model_name=\"spotlight\", fixed=False, symetrise=True)\n```\n\n* The cropping tool: Just select an area and press \"q\" when you are satisfied with the crop !\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"img/crop/crop_example.png\" width=\"66%\" class=\"center\"\u003e\n\u003c/p\u003e\n\n* The results:\n\nNoisy cropped image                     |           Denoised cropped image\n:-----------------------------------------------------------:|:------------------------------------------:\n \u003cimg src=\"img/crop/noisy_test_image_data.png\" width=\"100%\"\u003e | \u003cimg src=\"img/crop/denoised_test_image_data.png\" width=\"1000%\"\u003e\n\n## Inference with SAR2SAR for Sentinel-1 Ground Range Detected (GRD) images\n\nTo despeckle Sentinel-1 GRD SAR images using SAR2SAR, images need to be in `.tiff` or `.npy` format.\n\n\n### Despeckle one image with SAR2SAR\n\n```python\nfrom deepdespeckling.utils.load_cosar import cos2mat\nfrom deepdespeckling.utils.constants import PATCH_SIZE, STRIDE_SIZE\nfrom deepdespeckling.sar2sar.sar2sar_denoiser import Sar2SarDenoiser\n\n# Load you image\nimage = ..\n# NB: image must be in AMPLITUDE format and have the following shape: [img_height,img_width]\n\n# Denoise the image with SAR2SAR\ndenoiser = Sar2SarDenoiser()\ndenoised_image = denoiser.denoise_image(\n                image, patch_size=PATCH_SIZE, stride_size=STRIDE_SIZE)\n```\n\n- Example of result with SAR2SAR :\n\n\nNoisy image             |  Denoised image\n:----------------------:|:-------------------------:\n![](img/entire/sar2sar_noisy.png)  |  ![](img/entire/sar2sar_denoised.png)\n\n\n### Despeckle a set of images using SAR2SAR\n\nThe despeckling functions (`despeckle, despeckle_from_coordinates, despeckle_from_crop`) work the same as with MERLIN. To use SAR2SAR, the `model_name` parameter has to be set to `\"sar2sar\"`\n\nFor example, to despeckle a set of fullsize images:\n```python\nfrom deepdespeckling.despeckling import despeckle\n\n# Path to a folder of several images (tiff or npy files)\nimage_path=\"path/to/image\"\n# Folder where results are stored\ndestination_directory=\"path/where/to/save/results\"\n\ndespeckle(image_path, destination_directory, model_name=\"sar2sar\")\n```\n\n## Documentation\n\nThe documentation of the package is [available here](https://hi-paris.github.io/deepdespeckling/)\n\n## Authors\n\n* [Emanuele Dalsasso](https://emanueledalsasso.github.io/) (Researcher at ECEO, EPFL)\n* [Hadrien Mariaccia](https://www.linkedin.com/in/hadrien-mar/) (Hi! PARIS Research Engineer)\n\n## Former contributors \n\n* [Youcef Kemiche](https://www.linkedin.com/in/youcef-kemiche-3095b9174/) (Former Hi! PARIS Research Engineer)\n* [Pierre Blanchard](https://www.linkedin.com/in/pierre-blanchard-28245462/) (Former Hi! PARIS Research Engineer)\n\n\n# References\n\n[1] DALSASSO, Emanuele, DENIS, Loïc, et TUPIN, Florence. [As if by magic: self-supervised training of deep despeckling networks with MERLIN](https://arxiv.org/pdf/2110.13148.pdf). IEEE Transactions on Geoscience and Remote Sensing, 2021, vol. 60, p. 1-13.\n\n[2] DALSASSO, Emanuele, DENIS, Loïc, et TUPIN, Florence. [SAR2SAR: a semi-supervised despeckling algorithm for SAR images](https://arxiv.org/pdf/2006.15037.pdf). IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing (Early Access), 2020\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhi-paris%2Fdeepdespeckling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhi-paris%2Fdeepdespeckling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhi-paris%2Fdeepdespeckling/lists"}