File size: 1,755 Bytes
f19f18b
 
 
 
 
 
 
 
 
f849e12
f19f18b
 
dbd1ab1
 
 
 
 
 
 
 
 
f849e12
 
 
 
 
dbd1ab1
 
 
 
f849e12
 
dbd1ab1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
54
55
56
57
---
title: DeepONet FPO Demo
colorFrom: green
colorTo: green
sdk: gradio
sdk_version: 6.1.0
app_file: app.py
pinned: false
license: mit
short_description: 'Demo of unsteady flow around varied geometries'
---

# DeepONet FPO Demo (FlowBench)

This Space runs **time-dependent DeepONet** checkpoints (s ∈ {1,4,8,16}) to generate **auto-regressive rollouts** of 2D velocity fields **(u, v)** around complex geometries (FPO / FlowBench).

You have two runnable apps:

- **`app_v1.py` (GT + metrics)**
  - Uses `sample_cases/` containing the **full target sequence**.
  - Produces:
    - Ground truth vs prediction **GIFs** for u and v
    - Relative L2 error vs time **plot** + **CSV**, where
      \[
      \mathrm{rel}\_L_2(t) = \frac{\lVert \hat{y}(t) - y(t) \rVert_2}{\lVert y(t) \rVert_2}.
      \]

- **`app_v2.py` (prediction-only, arbitrary rollout length)**
  - Uses `sample_cases/few_timesteps/` containing **only the first 16 GT frames** (enough to seed any checkpoint).
  - Produces:
    - Prediction **GIFs** for u and v for any number of rollout steps
  - User chooses rollout length **N** (seeding uses only the first `s` frames).

## Sample format

Each sample uses two files:

- `sample_{id}_input.npy` → SDF geometry: **[1, H, W]**
- `sample_{id}_output.npy` → velocity sequence: **[T, 2, H, W]** (channels are u, v)

For **v2**, `T = 16` and files must be located in:
- `sample_cases/few_timesteps/`

## Checkpoints

Checkpoints are downloaded from the Hub at runtime:

- `checkpoints/time-dependent-deeponet_1in.ckpt`
- `checkpoints/time-dependent-deeponet_4in.ckpt`
- `checkpoints/time-dependent-deeponet_8in.ckpt`
- `checkpoints/time-dependent-deeponet_16in.ckpt`

Repo ID used by both apps:
```text
arabeh/DeepONet-FlowBench-FPO