Add files using upload-large-folder tool
Browse files- README.md +105 -0
- opt2sar/generator/config.json +11 -0
- opt2sar/generator/diffusion_pytorch_model.safetensors +3 -0
- sar2opt/generator/config.json +11 -0
- sar2opt/generator/diffusion_pytorch_model.safetensors +3 -0
- seman2opt/generator/config.json +11 -0
- seman2opt/generator/diffusion_pytorch_model.safetensors +3 -0
- seman2opt_pesudo/generator/config.json +11 -0
- seman2opt_pesudo/generator/diffusion_pytorch_model.safetensors +3 -0
- seman2sar/generator/config.json +11 -0
- seman2sar/generator/diffusion_pytorch_model.safetensors +3 -0
- seman2sar_pesudo/generator/config.json +11 -0
- seman2sar_pesudo/generator/diffusion_pytorch_model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- doem1997/openearthmap-sar
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
pipeline_tag: image-to-image
|
| 8 |
+
library_name: diffusers
|
| 9 |
+
tags:
|
| 10 |
+
- remote-sensing
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# CUT-OpenEarthMap-SAR
|
| 14 |
+
|
| 15 |
+
CUT (Contrastive Unpaired Translation) models for SAR ↔ optical image translation. Trained on OpenEarthMap data with anti-aliased ResNet generators.
|
| 16 |
+
|
| 17 |
+
## Model variants
|
| 18 |
+
|
| 19 |
+
| Model | Direction | Epoch |
|
| 20 |
+
|-------|-----------|-------|
|
| 21 |
+
| `opt2sar` | Optical → SAR | 20 |
|
| 22 |
+
| `sar2opt` | SAR → Optical | 15 |
|
| 23 |
+
| `seman2opt` | Semantic → Optical | 25 |
|
| 24 |
+
| `seman2opt_pesudo` | Semantic (pseudo) → Optical | 195 |
|
| 25 |
+
| `seman2sar` | Semantic → SAR | 25 |
|
| 26 |
+
| `seman2sar_pesudo` | Semantic (pseudo) → SAR | 200 |
|
| 27 |
+
|
| 28 |
+
## Usage
|
| 29 |
+
|
| 30 |
+
Use with [pytorch-image-translation-models](https://github.com/Bili-Sakura/pytorch-image-translation-models):
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
from examples.community.openearthmap_sar import load_openearthmap_sar_pipeline
|
| 34 |
+
|
| 35 |
+
pipeline = load_openearthmap_sar_pipeline(
|
| 36 |
+
checkpoint_dir="BiliSakura/CUT-OpenEarthMap-SAR", # or local path
|
| 37 |
+
model_name="sar2opt",
|
| 38 |
+
device="cuda",
|
| 39 |
+
)
|
| 40 |
+
output = pipeline(source_image=pil_image, output_type="pil")
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
**CLI:**
|
| 44 |
+
|
| 45 |
+
```bash
|
| 46 |
+
python -m examples.community.openearthmap_sar \
|
| 47 |
+
--checkpoint-dir BiliSakura/CUT-OpenEarthMap-SAR \
|
| 48 |
+
--model sar2opt \
|
| 49 |
+
--input sar.png \
|
| 50 |
+
--output out.png
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
> Pass `source_image` as `PIL.Image`. The generator uses anti-aliased down/upsampling to match the original CUT training.
|
| 54 |
+
|
| 55 |
+
## Repository layout
|
| 56 |
+
|
| 57 |
+
```
|
| 58 |
+
{model_name}/
|
| 59 |
+
generator/
|
| 60 |
+
config.json
|
| 61 |
+
diffusion_pytorch_model.safetensors
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## Architecture
|
| 65 |
+
|
| 66 |
+
| Parameter | Value |
|
| 67 |
+
|-----------|-------|
|
| 68 |
+
| `in_channels` | 3 |
|
| 69 |
+
| `out_channels` | 3 |
|
| 70 |
+
| `base_filters` | 64 |
|
| 71 |
+
| `n_blocks` | 9 |
|
| 72 |
+
| `norm` | InstanceNorm |
|
| 73 |
+
|
| 74 |
+
## Citation
|
| 75 |
+
|
| 76 |
+
**CUT (architecture):**
|
| 77 |
+
|
| 78 |
+
```bibtex
|
| 79 |
+
@inproceedings{park2020cut,
|
| 80 |
+
title={Contrastive Learning for Unpaired Image-to-Image Translation},
|
| 81 |
+
author={Park, Taesung and Efros, Alexei A and Zhang, Richard and Zhu, Jun-Yan},
|
| 82 |
+
booktitle={ECCV},
|
| 83 |
+
year={2020}
|
| 84 |
+
}
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
**OpenEarthMap-SAR (dataset & baseline):**
|
| 88 |
+
|
| 89 |
+
```bibtex
|
| 90 |
+
@ARTICLE{11303033,
|
| 91 |
+
author={Xia, Junshi and Chen, Hongruixuan and Broni-Bediako, Clifford and Wei, Yimin and Song, Jian and Yokoya, Naoto},
|
| 92 |
+
journal={IEEE Geoscience and Remote Sensing Magazine},
|
| 93 |
+
title={OpenEarthMap-SAR: A benchmark synthetic aperture radar dataset for global high-resolution land cover mapping [Software and Data Sets]},
|
| 94 |
+
year={2025},
|
| 95 |
+
volume={13},
|
| 96 |
+
number={4},
|
| 97 |
+
pages={476-487},
|
| 98 |
+
keywords={Translation;Semantic segmentation;Source coding;Urban planning;Land surface;Geoscience and remote sensing;Benchmark testing;Software;Sustainable development;Synthetic aperture radar},
|
| 99 |
+
doi={10.1109/MGRS.2025.3599512}
|
| 100 |
+
}
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
## Credits
|
| 104 |
+
|
| 105 |
+
Models trained on the [OpenEarthMap-SAR](https://github.com/cliffbb/OpenEarthMap-SAR) benchmark dataset. Thanks to the authors for the dataset and CUT baseline.
|
opt2sar/generator/config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "OpenEarthMapSARGenerator",
|
| 3 |
+
"in_channels": 3,
|
| 4 |
+
"out_channels": 3,
|
| 5 |
+
"base_filters": 64,
|
| 6 |
+
"n_blocks": 9,
|
| 7 |
+
"use_dropout": false,
|
| 8 |
+
"padding_type": "reflect",
|
| 9 |
+
"no_antialias": false,
|
| 10 |
+
"no_antialias_up": false
|
| 11 |
+
}
|
opt2sar/generator/diffusion_pytorch_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d7ad822919d35628b189ca7e91544a64b9ba03f9196b1a6ff44bb2320dca0f49
|
| 3 |
+
size 45556004
|
sar2opt/generator/config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "OpenEarthMapSARGenerator",
|
| 3 |
+
"in_channels": 3,
|
| 4 |
+
"out_channels": 3,
|
| 5 |
+
"base_filters": 64,
|
| 6 |
+
"n_blocks": 9,
|
| 7 |
+
"use_dropout": false,
|
| 8 |
+
"padding_type": "reflect",
|
| 9 |
+
"no_antialias": false,
|
| 10 |
+
"no_antialias_up": false
|
| 11 |
+
}
|
sar2opt/generator/diffusion_pytorch_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0026253038d8fd1d405028fbfcb351cc26046db4640fe495cee147f3455341c5
|
| 3 |
+
size 45556004
|
seman2opt/generator/config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "OpenEarthMapSARGenerator",
|
| 3 |
+
"in_channels": 3,
|
| 4 |
+
"out_channels": 3,
|
| 5 |
+
"base_filters": 64,
|
| 6 |
+
"n_blocks": 9,
|
| 7 |
+
"use_dropout": false,
|
| 8 |
+
"padding_type": "reflect",
|
| 9 |
+
"no_antialias": false,
|
| 10 |
+
"no_antialias_up": false
|
| 11 |
+
}
|
seman2opt/generator/diffusion_pytorch_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:348a174d37892ca52a8a0767d320f0761ee3830329b5e156587e6704f3b6fbea
|
| 3 |
+
size 45556004
|
seman2opt_pesudo/generator/config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "OpenEarthMapSARGenerator",
|
| 3 |
+
"in_channels": 3,
|
| 4 |
+
"out_channels": 3,
|
| 5 |
+
"base_filters": 64,
|
| 6 |
+
"n_blocks": 9,
|
| 7 |
+
"use_dropout": false,
|
| 8 |
+
"padding_type": "reflect",
|
| 9 |
+
"no_antialias": false,
|
| 10 |
+
"no_antialias_up": false
|
| 11 |
+
}
|
seman2opt_pesudo/generator/diffusion_pytorch_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7c59c4f6564bdba5fe5613c6d28b39fd76d0f4d102db618b8c26f6f89766a29b
|
| 3 |
+
size 45556004
|
seman2sar/generator/config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "OpenEarthMapSARGenerator",
|
| 3 |
+
"in_channels": 3,
|
| 4 |
+
"out_channels": 3,
|
| 5 |
+
"base_filters": 64,
|
| 6 |
+
"n_blocks": 9,
|
| 7 |
+
"use_dropout": false,
|
| 8 |
+
"padding_type": "reflect",
|
| 9 |
+
"no_antialias": false,
|
| 10 |
+
"no_antialias_up": false
|
| 11 |
+
}
|
seman2sar/generator/diffusion_pytorch_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:29d90e04c62d40c2ac1ea7a68a049dd8e56754f73130836f0a5f85bebddc761a
|
| 3 |
+
size 45556004
|
seman2sar_pesudo/generator/config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_class_name": "OpenEarthMapSARGenerator",
|
| 3 |
+
"in_channels": 3,
|
| 4 |
+
"out_channels": 3,
|
| 5 |
+
"base_filters": 64,
|
| 6 |
+
"n_blocks": 9,
|
| 7 |
+
"use_dropout": false,
|
| 8 |
+
"padding_type": "reflect",
|
| 9 |
+
"no_antialias": false,
|
| 10 |
+
"no_antialias_up": false
|
| 11 |
+
}
|
seman2sar_pesudo/generator/diffusion_pytorch_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f9179d55366bca99125570b52279a3cea93da2d32eed0e98df283c68cc59360
|
| 3 |
+
size 45556004
|