Add files using upload-large-folder tool
Browse files
README.md
CHANGED
|
@@ -11,6 +11,8 @@ tags:
|
|
| 11 |
- checkpoint
|
| 12 |
---
|
| 13 |
|
|
|
|
|
|
|
| 14 |
# BiliSakura/StegoGAN-ckpt
|
| 15 |
|
| 16 |
Packaged StegoGAN checkpoints from `models/raw/StegoGAN`.
|
|
@@ -38,6 +40,29 @@ StegoGAN-ckpt/
|
|
| 38 |
diffusion_pytorch_model.safetensors
|
| 39 |
```
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
## Notes
|
| 42 |
|
| 43 |
- `generator_A/` and `generator_B/` safetensors exports are included for each variant.
|
|
|
|
| 11 |
- checkpoint
|
| 12 |
---
|
| 13 |
|
| 14 |
+
> [!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
|
| 15 |
+
|
| 16 |
# BiliSakura/StegoGAN-ckpt
|
| 17 |
|
| 18 |
Packaged StegoGAN checkpoints from `models/raw/StegoGAN`.
|
|
|
|
| 40 |
diffusion_pytorch_model.safetensors
|
| 41 |
```
|
| 42 |
|
| 43 |
+
## Usage (Inference)
|
| 44 |
+
|
| 45 |
+
```python
|
| 46 |
+
import numpy as np
|
| 47 |
+
import torch
|
| 48 |
+
from PIL import Image
|
| 49 |
+
|
| 50 |
+
from src.pipelines.stegogan import StegoGANPipeline
|
| 51 |
+
|
| 52 |
+
pipe = StegoGANPipeline.from_pretrained(
|
| 53 |
+
"/path/to/StegoGAN-ckpt/google_mismatch_0.25",
|
| 54 |
+
device="cuda",
|
| 55 |
+
)
|
| 56 |
+
|
| 57 |
+
img = Image.open("/path/to/input.png").convert("RGB")
|
| 58 |
+
x = torch.from_numpy(np.array(img)).float().permute(2, 0, 1).unsqueeze(0) / 255.0
|
| 59 |
+
x = x * 2 - 1
|
| 60 |
+
x = x.to("cuda")
|
| 61 |
+
|
| 62 |
+
out = pipe(source=x, direction="a2b", output_type="pil")
|
| 63 |
+
out.images[0].save("stegogan_output.png")
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
## Notes
|
| 67 |
|
| 68 |
- `generator_A/` and `generator_B/` safetensors exports are included for each variant.
|