{"id":28505094,"url":"https://github.com/prs-eth/ukraine-damage-mapping-tool","last_synced_at":"2025-07-06T12:32:14.431Z","repository":{"id":263790031,"uuid":"888491737","full_name":"prs-eth/ukraine-damage-mapping-tool","owner":"prs-eth","description":"An Open-Source Tool for Mapping War Destruction at Scale in Ukraine using Sentinel-1 Time Series","archived":false,"fork":false,"pushed_at":"2025-03-26T09:40:33.000Z","size":4162,"stargazers_count":21,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T19:06:55.447Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/prs-eth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-14T13:46:57.000Z","updated_at":"2025-06-01T16:09:34.000Z","dependencies_parsed_at":"2025-03-20T11:22:39.513Z","dependency_job_id":"f1b40b1e-030c-4209-9290-e575f73eaa97","html_url":"https://github.com/prs-eth/ukraine-damage-mapping-tool","commit_stats":null,"previous_names":["olidietrich/ukraine-damage-mapping-tool"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prs-eth/ukraine-damage-mapping-tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2Fukraine-damage-mapping-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2Fukraine-damage-mapping-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2Fukraine-damage-mapping-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2Fukraine-damage-mapping-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prs-eth","download_url":"https://codeload.github.com/prs-eth/ukraine-damage-mapping-tool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prs-eth%2Fukraine-damage-mapping-tool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263900815,"owners_count":23527321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-06-08T19:06:38.195Z","updated_at":"2025-07-06T12:32:14.422Z","avatar_url":"https://github.com/prs-eth.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# An Open-Source Tool for Mapping War Destruction at Scale in Ukraine using Sentinel-1 Time Series\n\n\u003cdiv align=\"center\"\u003e\n\n**Olivier Dietrich\u003csup\u003e*,1\u003c/sup\u003e**, **Torben Peters\u003csup\u003e1\u003c/sup\u003e**, **Vivien Sainte Fare Garnot\u003csup\u003e2\u003c/sup\u003e**, **Valerie Sticher\u003csup\u003e2\u003c/sup\u003e**, **Thao Ton-That Whelan\u003csup\u003e3\u003c/sup\u003e**, **Konrad Schindler\u003csup\u003e1\u003c/sup\u003e**, **Jan Dirk Wegner\u003csup\u003e2\u003c/sup\u003e**\n\n\u003csup\u003e1\u003c/sup\u003e ETH Zurich\n\u003csup\u003e2\u003c/sup\u003e University of Zurich\n\u003csup\u003e3\u003c/sup\u003e International Committee of the Red Cross\n\n\u003csup\u003e*\u003c/sup\u003eCorresponding author: [Olivier Dietrich](mailto:odietrich@ethz.ch)\n\n[![Paper](https://img.shields.io/badge/arXiv-PDF-b31b1b)](https://arxiv.org/abs/2406.02506)\n[![Dashboard 1](https://img.shields.io/badge/Damage_Mapping_Tool-link-blue)](https://olidietrich.users.earthengine.app/view/rapid-damage-assessment-sentinel1)\n[![Dashboard 2](https://img.shields.io/badge/Ukraine_Damage_Explorer-link-gold)](https://olidietrich.users.earthengine.app/view/ukraine-damage-explorer)\n[![Zenodo](https://img.shields.io/badge/Zenodo-link-green)](https://zenodo.org/records/15088349)\n![MIT License](https://img.shields.io/badge/License-MIT-929292.svg)\n\n![Ukraine Damage Map](doc/ukraine_damage_adm3_agg.png)\n\n\u003c/div\u003e\n\n\n\n\n\n## 🇺🇦 Results\nThe results, including heatmaps and building footprints, can be found [here](https://zenodo.org/records/14811504).\n\n## 🎮 Dashboards\nWe provide two Google Earth Engine dashboards:\n\n|[![Screenshot Damage Mapping Tool](doc/webapp_damage_mapping_tool.jpg)](https://olidietrich.users.earthengine.app/view/rapid-damage-assessment-sentinel1)\u003cbr\u003e[Damage Mapping Tool](https://olidietrich.users.earthengine.app/view/rapid-damage-assessment-sentinel1)|[![Screenshot Results Explorer](doc/webapp_results_explorer.jpg)](https://olidietrich.users.earthengine.app/view/ukraine-damage-explorer)\u003cbr\u003e[Ukraine Damage Explorer](https://olidietrich.users.earthengine.app/view/ukraine-damage-explorer)|\n|:-:|:-:|\n\n\n\n\n\n## 🌲 Repository Structure\n\n```\nnotebooks/                     # Jupyter notebooks to reproduce results\n  ├── classification.ipynb\n  ├── country_stats.ipynb\n  └── evaluation.ipynb\n\nsrc/                            # Source code for data processing, model training, and inference\n  ├── classification/           # Classification script to train and evaluate models\n  │     ├── dataset.py\n  │     ├── main.py\n  │     ├── metrics.py\n  │     ├── models.py\n  │     ├── reducers.py\n  │     └── utils.py\n  │\n  ├── data/                     # Scripts for data processing and handling\n  │     ├── overture/\n  │     ├── sentinel1/\n  │     ├── sentinel2/\n  │     ├── quadkeys.py\n  │     ├── unosat.py\n  │     └── utils.py\n  │\n  ├── inference/                # Script for inference over entire country\n  │     ├── dense_inference.py\n  │     └── full_ukraine.py\n  │\n  ├── postprocessing/           # Download from drive and postprocess results\n  │     ├── drive_to_results.py\n  │     └── utils.py\n  │\n  ├── utils/                    # Utils functions\n  |     ├── gdrive.py\n  |     ├── gee.py\n  |     ├── geo.py\n  |     └── time.py\n  │\n  ├── constants.py\n  └── __init__.py\n```\n\n## 🛠️ Setup\n\n*This was tested on Ubuntu 22.04 LTS with Python 3.12.7 and 64GB RAM*\n\n### 🐑 Clone the repository\n```bash\ngit clone https://github.com/odietric/ukraine-mapping-tool.git\ncd ukraine-mapping-tool\n```\n\n### 🐍 Python Environment\nTo create the environment, run the following command:\n\n```bash\nconda create -p ./ukraine_env python=3.12 geopandas gdal -c conda-forge --strict-channel-priority --yes\nconda activate ./ukraine_env\npython -m pip install uv\npython -m uv pip install -r requirements.txt\n```\nor simply:\n\n```bash\nmake env\n```\n\n### 💾 Data\nAll project data is publicly available:\n\n- [UNOSAT](https://unosat.org/products/)\n\n  Preprocessed UNOSAT labels and AOIs are stored in `data/unosat_labels.geojson` and `data/unosat_aois.geojson`, respectively.\n- [Sentinel-1](https://scihub.copernicus.eu/)\n\n  Sentinel-1 images are processed in the cloud via Google Earth Engine.\n- [Overture Maps Building Footprints](https://docs.overturemaps.org/guides/buildings/#14/32.58453/-117.05154/0/60)\n\n  To obtain the preprocessed Overture Maps Building Footprints in Ukraine, you can either download the file `ukraine_buildings.parquet` from the link above and place it in the `data/overture_buildings` folder, or compute it yourself by running the following command:\n\n  ```bash\n  bash src/data/overture/download_and_preprocess.sh\n  ```\n\n### 💽 Google Drive Access Configuration\n\nTo download the results from Google Drive, you need to configure the Google Drive API and add the files `pydrive_settings.yaml` and `pydrive_credentials.json` to the `secrets` folder.\n\n1. **Create Google API Credentials:**\n\n    * Go to Google Cloud Console: API \u0026 Services \u003e Credentials \u003e Create Credentials \u003e OAuth client ID \u003e Desktop app.\n\n2. **Download and Configure Credentials:**\n\n    * Download the .json credentials file.\n\n    * Store the `client_id` and `client_secret` values from this file in pydrive_settings.yaml as follows:\n\n      ```yaml\n      client_config_backend: 'settings'\n\n      client_config:\n        client_id: \u003cyour_client_id\u003e\n        client_secret: \u003cyour_client_secret\u003e\n\n      save_credentials: True\n      save_credentials_backend: 'file'\n      save_credentials_file: \u003c/path/to/project/\u003esecrets/pydrive_credentials.json\n\n      get_refresh_token: True\n      oauth_scope:\n        - \"https://www.googleapis.com/auth/drive\"\n      ```\n\n    * Replace `\u003cyour_client_id\u003e` and `\u003cyour_client_secret\u003e` with values from your credentials JSON file.\n\n    * Replace `/path/to/project/secrets/pydrive_credentials.json` with the full path to the `pydrive_credentials.json` file within your project.\\\n    * The pydrive_credentials.json file will be automatically created upon the first authentication attempt.\n\n3. **Example usage in code:**\n\n      ```python\n      from pydrive2.auth import GoogleAuth\n      from pydrive2.drive import GoogleDrive\n      from src.constants import SECRETS_PATH\n\n      # Initialize authentication\n      GoogleAuth.DEFAULT_SETTINGS[\"client_config_file\"] = SECRETS_PATH / \"pydrive_credentials.json\"\n      gauth = GoogleAuth(settings_file=SECRETS_PATH / \"pydrive_settings.yaml\")\n      drive = GoogleDrive(gauth)\n      ```\n\n## Citation\n```bibtex\n@article{Dietrich2025,\n  author={Dietrich, Olivier and Peters, Torben and Sainte Fare Garnot, Vivien and Sticher, Valerie and Ton-That Whelan, Thao and Schindler, Konrad and Wegner, Jan Dirk},\n  title={An open-source tool for mapping war destruction at scale in Ukraine using Sentinel-1 time series},\n  journal={Communications Earth {\\\u0026} Environment},\n  year={2025},\n  doi={10.1038/s43247-025-02183-7},\n  url={https://doi.org/10.1038/s43247-025-02183-7}\n}\n```\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprs-eth%2Fukraine-damage-mapping-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprs-eth%2Fukraine-damage-mapping-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprs-eth%2Fukraine-damage-mapping-tool/lists"}