Image-to-Image
Diffusers
Safetensors
SeismicImpInvCLDMPipeline
seismic-inversion
impedance-inversion
diffusion
ddpm
cldm
overthrust
synthetic-data
Instructions to use mally-2000/saii-cldm-synthetic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use mally-2000/saii-cldm-synthetic with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("mally-2000/saii-cldm-synthetic", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Focus README on model loading
Browse filesPrioritize from_pretrained usage, keep the clone demo secondary, and link to the full project code and paper.
README.md
CHANGED
|
@@ -12,71 +12,14 @@ tags:
|
|
| 12 |
|
| 13 |
# Seismic-LDDPM
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
vq_model/
|
| 20 |
-
unet/
|
| 21 |
-
scheduler/
|
| 22 |
-
condition_encoder/
|
| 23 |
-
```
|
| 24 |
-
|
| 25 |
-
The repository also includes a minimal Overthrust inference script. Training
|
| 26 |
-
code and experiment configs are not included here.
|
| 27 |
-
|
| 28 |
-
## Quick Start
|
| 29 |
-
|
| 30 |
-
```bash
|
| 31 |
-
git clone https://huggingface.co/mally-2000/seismic-lddpm
|
| 32 |
-
cd seismic-lddpm
|
| 33 |
-
pip install -r requirements.txt
|
| 34 |
-
```
|
| 35 |
-
|
| 36 |
-
Run SAII-LDDPM:
|
| 37 |
-
|
| 38 |
-
```bash
|
| 39 |
-
python infer.py
|
| 40 |
-
```
|
| 41 |
-
|
| 42 |
-
Run SAII-CLDM:
|
| 43 |
-
|
| 44 |
-
```bash
|
| 45 |
-
python infer.py CLDM
|
| 46 |
-
```
|
| 47 |
-
|
| 48 |
-
`infer.py` builds the bundled Overthrust test sample, runs inference, and also
|
| 49 |
-
runs the fixed Overthrust evaluation by default. Outputs are written under:
|
| 50 |
-
|
| 51 |
-
```text
|
| 52 |
-
outputs/infer_LDDPM/
|
| 53 |
-
outputs/infer_CLDM/
|
| 54 |
-
```
|
| 55 |
-
|
| 56 |
-
## Results
|
| 57 |
-
|
| 58 |
-
Local Overthrust impedance-domain results:
|
| 59 |
-
|
| 60 |
-
| Method | Steps | PSNR | SSIM | PCC | RRE |
|
| 61 |
-
|---|---:|---:|---:|---:|---:|
|
| 62 |
-
| SAII-LDDPM | 1000 | 33.4413 | 0.9554 | 0.9957 | 0.0324 |
|
| 63 |
-
| SAII-CLDM | 30 | 33.1312 | 0.9494 | 0.9950 | 0.0342 |
|
| 64 |
|
| 65 |
-
##
|
| 66 |
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
```python
|
| 70 |
-
import torch
|
| 71 |
-
from codes.pipeline import SeismicImpInvLDDPMPipeline
|
| 72 |
-
|
| 73 |
-
pipe = SeismicImpInvLDDPMPipeline.from_pretrained(
|
| 74 |
-
".",
|
| 75 |
-
torch_dtype=torch.float32,
|
| 76 |
-
).to("cuda")
|
| 77 |
-
```
|
| 78 |
-
|
| 79 |
-
Or let Diffusers download the model weights and custom pipeline code:
|
| 80 |
|
| 81 |
```python
|
| 82 |
import torch
|
|
@@ -90,7 +33,7 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
| 90 |
).to("cuda")
|
| 91 |
```
|
| 92 |
|
| 93 |
-
|
| 94 |
|
| 95 |
```python
|
| 96 |
pipe = DiffusionPipeline.from_pretrained(
|
|
@@ -100,3 +43,30 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
| 100 |
trust_remote_code=True,
|
| 101 |
).to("cuda")
|
| 102 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# Seismic-LDDPM
|
| 14 |
|
| 15 |
+
Open model weights for seismic impedance inversion in Diffusers format. This
|
| 16 |
+
repository is for inference and model loading; the full project code is at
|
| 17 |
+
[GeoAI-INV/SAII-CLDM](https://github.com/GeoAI-INV/SAII-CLDM), and the paper is
|
| 18 |
+
available on [arXiv](https://arxiv.org/html/2506.13529v1).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
+
## Load From Hugging Face
|
| 21 |
|
| 22 |
+
SAII-LDDPM:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
```python
|
| 25 |
import torch
|
|
|
|
| 33 |
).to("cuda")
|
| 34 |
```
|
| 35 |
|
| 36 |
+
SAII-CLDM:
|
| 37 |
|
| 38 |
```python
|
| 39 |
pipe = DiffusionPipeline.from_pretrained(
|
|
|
|
| 43 |
trust_remote_code=True,
|
| 44 |
).to("cuda")
|
| 45 |
```
|
| 46 |
+
|
| 47 |
+
The inference algorithms are implemented in `codes/pipeline.py`. The root
|
| 48 |
+
`pipeline.py` and `pipeline_cldm.py` files are thin entry points used by
|
| 49 |
+
Diffusers remote loading.
|
| 50 |
+
|
| 51 |
+
## Run The Bundled Demo
|
| 52 |
+
|
| 53 |
+
```bash
|
| 54 |
+
git clone https://huggingface.co/mally-2000/seismic-lddpm
|
| 55 |
+
cd seismic-lddpm
|
| 56 |
+
pip install -r requirements.txt
|
| 57 |
+
|
| 58 |
+
python infer.py # SAII-LDDPM
|
| 59 |
+
python infer.py CLDM # SAII-CLDM
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
`infer.py` uses the bundled Overthrust sample and writes outputs under
|
| 63 |
+
`outputs/infer_LDDPM/` or `outputs/infer_CLDM/`.
|
| 64 |
+
|
| 65 |
+
## Overthrust Results
|
| 66 |
+
|
| 67 |
+
Impedance-domain metrics on the bundled Overthrust setting:
|
| 68 |
+
|
| 69 |
+
| Method | Steps | PSNR | SSIM | PCC | RRE |
|
| 70 |
+
|---|---:|---:|---:|---:|---:|
|
| 71 |
+
| SAII-LDDPM | 1000 | 33.4413 | 0.9554 | 0.9957 | 0.0324 |
|
| 72 |
+
| SAII-CLDM | 30 | 33.1312 | 0.9494 | 0.9950 | 0.0342 |
|