Add files using upload-large-folder tool
Browse files- README.md +76 -0
- SEN12 /config.json +32 -0
- SEN12 /diffusion_pytorch_model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: image-to-image
|
| 6 |
+
library_name: pytorch
|
| 7 |
+
tags:
|
| 8 |
+
- e3diff
|
| 9 |
+
- diffusion
|
| 10 |
+
- sar-to-optical
|
| 11 |
+
- image-translation
|
| 12 |
+
- checkpoint
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
> [!WARNING] we do not have a full checkpoint conversion validation, if you encounter pipeline loading failure and unsidered output, please contact me via bili_sakura@zju.edu.cn
|
| 16 |
+
|
| 17 |
+
# BiliSakura/E3Diff-ckpt
|
| 18 |
+
|
| 19 |
+
Packaged E3Diff checkpoint for use with `examples/community/e3diff` in `pytorch-image-translation-models`.
|
| 20 |
+
|
| 21 |
+
## Source repository
|
| 22 |
+
|
| 23 |
+
- E3Diff (official): [DeepSARRS/E3Diff](https://github.com/DeepSARRS/E3Diff)
|
| 24 |
+
- Community implementation used here: [Bili-Sakura/pytorch-image-translation-models](https://github.com/Bili-Sakura/pytorch-image-translation-models)
|
| 25 |
+
|
| 26 |
+
## Variants
|
| 27 |
+
|
| 28 |
+
| Variant directory | Notes |
|
| 29 |
+
| --- | --- |
|
| 30 |
+
| `SEN12 ` | Flat diffusion checkpoint export (`config.json` + `diffusion_pytorch_model.safetensors`) |
|
| 31 |
+
|
| 32 |
+
## Repository layout
|
| 33 |
+
|
| 34 |
+
```text
|
| 35 |
+
E3Diff-ckpt/
|
| 36 |
+
SEN12 /
|
| 37 |
+
config.json
|
| 38 |
+
diffusion_pytorch_model.safetensors
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## Usage
|
| 42 |
+
|
| 43 |
+
Load config and weights from the variant directory directly:
|
| 44 |
+
|
| 45 |
+
- `config`: `SEN12 /config.json`
|
| 46 |
+
- `weights`: `SEN12 /diffusion_pytorch_model.safetensors`
|
| 47 |
+
|
| 48 |
+
### Inference demo (pipeline)
|
| 49 |
+
|
| 50 |
+
```python
|
| 51 |
+
from PIL import Image
|
| 52 |
+
|
| 53 |
+
from examples.community.e3diff import E3DiffPipeline
|
| 54 |
+
|
| 55 |
+
pipe = E3DiffPipeline.from_pretrained(
|
| 56 |
+
"/path/to/E3Diff-ckpt/SEN12 ",
|
| 57 |
+
device="cuda",
|
| 58 |
+
)
|
| 59 |
+
|
| 60 |
+
sar = Image.open("/path/to/sar_input.png").convert("RGB")
|
| 61 |
+
out = pipe(source_image=sar, num_inference_steps=50, eta=0.8, output_type="pil")
|
| 62 |
+
out.images[0].save("e3diff_output.png")
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
## Citation
|
| 66 |
+
|
| 67 |
+
```bibtex
|
| 68 |
+
@ARTICLE{10767752,
|
| 69 |
+
author={Qin, Jiang and Zou, Bin and Li, Haolin and Zhang, Lamei},
|
| 70 |
+
journal={IEEE Geoscience and Remote Sensing Letters},
|
| 71 |
+
title={Efficient End-to-End Diffusion Model for One-step SAR-to-Optical Translation},
|
| 72 |
+
year={2024},
|
| 73 |
+
pages={1-1},
|
| 74 |
+
doi={10.1109/LGRS.2024.3506566}
|
| 75 |
+
}
|
| 76 |
+
```
|
SEN12 /config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"format_version": 1,
|
| 3 |
+
"source_checkpoint": "/root/worksapce/models/raw/E3Diff/I700000_E719_gen.pth",
|
| 4 |
+
"pipeline": "examples.community.e3diff",
|
| 5 |
+
"artifact": "diffusion",
|
| 6 |
+
"unet_config": {
|
| 7 |
+
"out_channel": 3,
|
| 8 |
+
"inner_channel": 64,
|
| 9 |
+
"norm_groups": 32,
|
| 10 |
+
"channel_mults": [
|
| 11 |
+
1,
|
| 12 |
+
2,
|
| 13 |
+
4,
|
| 14 |
+
8,
|
| 15 |
+
16
|
| 16 |
+
],
|
| 17 |
+
"attn_res": [],
|
| 18 |
+
"res_blocks": 1,
|
| 19 |
+
"dropout": 0.0,
|
| 20 |
+
"image_size": 256,
|
| 21 |
+
"condition_ch": 3
|
| 22 |
+
},
|
| 23 |
+
"diffusion_config": {
|
| 24 |
+
"image_size": 256,
|
| 25 |
+
"channels": 3,
|
| 26 |
+
"loss_type": "l1",
|
| 27 |
+
"conditional": true,
|
| 28 |
+
"xT_noise_r": 0.1,
|
| 29 |
+
"n_timestep": 1000,
|
| 30 |
+
"schedule": "linear"
|
| 31 |
+
}
|
| 32 |
+
}
|
SEN12 /diffusion_pytorch_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9d01828c8071a07fc4ac3817e3ec9dbba3d7fe1f404c548b55c0c92e3143f9e1
|
| 3 |
+
size 768318660
|