File size: 1,765 Bytes
04c42c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
pipeline_tag: image-to-image
tags:
- pytorch
- hirise
- mars
- remote-sensing
- flow-matching
---

# HiPredict Diffusion

Bidirectional conditional flow-matching checkpoints for reconstructing HiRISE RED4 from IR10, or IR10 from RED4. Use these checkpoints with the [HiPredict Python package](https://github.com/EricKing22/HiPredict).

## Checkpoints

| File | Model | Training steps | Gradient-loss weight |
| --- | --- | --- | --- |
| `FM_Condition/latest.pt` | BidirectionalFM, Condition mode | 100,000 | 0.0 |
| `FM_Condition_gradient/latest.pt` | BidirectionalFM, Condition mode | 100,000 | 0.1 |
| `brightness/model.pt` | Auxiliary RED3 boundary-residual brightness head | — | — |

Choose either FM checkpoint as the main model. Both support `ir2red` and `red2ir`. The brightness head is optional: the default boundary-based correction does not need it.

Both main checkpoints include model weights, EMA weights, optimizer state, learning-rate scheduler state, and model/training settings. Each file is approximately 2.05 GB. The brightness head is approximately 32 KB.

## Installation

Use a HiPredict checkout containing `hipredict.diffusion` and install its diffusion dependencies from the checkout root:

```bash
pip install ".[diffusion]"
```

For evaluation with HiPredict's shared metrics, install `.[diffusion,postprocess]` instead.

## Download and load

```python
from huggingface_hub import hf_hub_download
from hipredict.diffusion import load_checkpoint

checkpoint = hf_hub_download(
    repo_id="syding9/HiPredict_Diffusion",
    filename="FM_Condition/latest.pt",
)
model, model_config, training_config, step = load_checkpoint(
    checkpoint, device="cuda"
)
```

Select `FM_Condition_gradient/latest.pt` for the gradient-loss model.