Update README.md
Browse files
README.md
CHANGED
|
@@ -1,45 +1,64 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
tags:
|
| 4 |
-
-
|
| 5 |
-
-
|
| 6 |
-
-
|
| 7 |
-
- wind
|
|
|
|
|
|
|
| 8 |
library_name: diffusers
|
| 9 |
model_type: ddim
|
| 10 |
datasets:
|
| 11 |
- your-dataset-name
|
| 12 |
---
|
| 13 |
-
# DDIM-DSC (4× Super-Resolution for Wind Data)
|
| 14 |
-
---
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
- **Base**: DDIM
|
| 19 |
-
- **Input channels**: 10
|
| 20 |
-
- **Output channels**: 10
|
| 21 |
-
- **Scale factor**: 4×
|
| 22 |
---
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
---
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
```python
|
| 27 |
import torch
|
| 28 |
-
from diffusers import DiffusionPipeline
|
| 29 |
-
from diffusers import DDIMScheduler
|
| 30 |
|
| 31 |
-
#
|
| 32 |
pipe = DiffusionPipeline.from_pretrained(
|
| 33 |
"lschmidt/ddim-dsc",
|
| 34 |
-
custom_pipeline="cond_ddim_pipeline",
|
| 35 |
trust_remote_code=True
|
| 36 |
)
|
| 37 |
|
| 38 |
-
#
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
|
|
|
| 42 |
|
| 43 |
-
#
|
| 44 |
-
|
| 45 |
-
pipe(image=lres_image)
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
tags:
|
| 4 |
+
- downscaling
|
| 5 |
+
- ERA5 - COSMO-REA6
|
| 6 |
+
- reanalysis data
|
| 7 |
+
- wind velocities
|
| 8 |
+
- diffusion
|
| 9 |
+
- superresolution
|
| 10 |
library_name: diffusers
|
| 11 |
model_type: ddim
|
| 12 |
datasets:
|
| 13 |
- your-dataset-name
|
| 14 |
---
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
# DDIM-DSC: 4× Downscaling of Wind Velocities
|
| 17 |
+
|
| 18 |
+
**DDIM-DSC** is a custom-trained [Denoising Diffusion Implicit Model (DDIM)](https://github.com/huggingface/diffusers) designed for the **superresolution of wind velocity fields** from coarse- to high-resolution using reanalysis data.
|
| 19 |
+
|
| 20 |
+
It performs **4× spatial downscaling** on 2-channel wind fields (u and v components), using **ERA5** as low-resolution input and **COSMO-REA6** as the high-resolution target.
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
---
|
| 23 |
|
| 24 |
+
## 📊 Data
|
| 25 |
+
|
| 26 |
+
- **Input**: ERA5 100 m wind components (u, v), 2 channels
|
| 27 |
+
- **Target**: COSMO-REA6 100 m wind components (u, v), 2 channels
|
| 28 |
+
- **Sequence length**: 3 (with temporal context across 3 timesteps)
|
| 29 |
+
- **Total input channels**: 8 (2 channels × 3 timesteps + 2 static channels)
|
| 30 |
+
|
| 31 |
---
|
| 32 |
+
|
| 33 |
+
## 🧠Model Architecture
|
| 34 |
+
|
| 35 |
+
- **Model type**: DDIM (using `diffusers`)
|
| 36 |
+
- **Scheduler**: DDIMScheduler
|
| 37 |
+
- **Conditioning**: Concatenated temporal sequences
|
| 38 |
+
- **Latent noise sampling**: 10 per input
|
| 39 |
+
- **Scale factor**: 4×
|
| 40 |
+
- **Input channels**: 8
|
| 41 |
+
- **Output channels**: 2
|
| 42 |
+
- **Note**: The low-resolution input must be **resized to high-resolution shape using bilinear interpolation** before being passed into the model.
|
| 43 |
+
|
| 44 |
+
## 🚀 Usage
|
| 45 |
+
|
| 46 |
```python
|
| 47 |
import torch
|
| 48 |
+
from diffusers import DiffusionPipeline
|
|
|
|
| 49 |
|
| 50 |
+
# load the custom DDIM pipeline
|
| 51 |
pipe = DiffusionPipeline.from_pretrained(
|
| 52 |
"lschmidt/ddim-dsc",
|
| 53 |
+
custom_pipeline="cond_ddim_pipeline",
|
| 54 |
trust_remote_code=True
|
| 55 |
)
|
| 56 |
|
| 57 |
+
# create a sample low-resolution input --> shape: (sequence_length, channels, height, width)
|
| 58 |
+
lres_image = torch.randn((3, 2, 32, 32)).to(pipe.device)
|
| 59 |
+
|
| 60 |
+
# interpolate to match high-resolution
|
| 61 |
+
|
| 62 |
|
| 63 |
+
# run inference
|
| 64 |
+
outputs = pipe(image=lres_image)
|
|
|