dipta007 commited on
Commit
43dd849
·
verified ·
1 Parent(s): 9c1761b

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +32 -30
README.md CHANGED
@@ -16,46 +16,49 @@ tags:
16
  # OracleZoom
17
 
18
  **Privileged-Latent Distillation for faithful extreme super-resolution.**
19
- OracleZoom drives Chain-of-Zoom's recursive 4x super-resolution out to 256x while staying *faithful*, adding real detail instead of hallucinating. This repo ships one ready-to-use file: the **merged super-resolution transformer**.
20
 
21
- [![Code](https://img.shields.io/badge/Code-OPD--Zoom-black?logo=github)](https://github.com/dipta007/OPD-Zoom)
22
- [![Base](https://img.shields.io/badge/Backbone-OSEDiff%20/%20SD3-blue)](https://huggingface.co/stabilityai/stable-diffusion-3-medium-diffusers)
23
- [![Paper](https://img.shields.io/badge/Paper-WACV%202027%20(in%20submission)-red)](https://github.com/dipta007/OPD-Zoom)
24
  [![License](https://img.shields.io/badge/License-CC--BY--NC--4.0-lightgrey)](https://creativecommons.org/licenses/by-nc/4.0/)
25
 
26
- ## What's in this repo
27
- - **`merged_transformer.safetensors`** (fp32, ~8.35 GB): the complete OracleZoom super-resolution transformer, Stable Diffusion 3 + Chain-of-Zoom's SR module + our distilled adapter, all merged into one set of weights. This is all you need.
28
 
29
- ## Quickstart (one command)
30
- Zooms your images 4x -> 16x -> 64x -> 256x with the merged transformer. Needs one NVIDIA GPU (~16 GB).
31
 
32
  ```bash
33
- # 1. Get the pipeline (Chain-of-Zoom is included as a submodule)
34
- git clone --recursive https://github.com/dipta007/OPD-Zoom
35
- cd OPD-Zoom
36
-
37
- # 2. Install dependencies (Python 3.10)
38
- pip install -r ref/coz/requirements.txt
39
  pip install -U "huggingface_hub[cli]"
 
 
 
 
 
40
 
41
- # 3. Download the merged model into the pipeline
42
- hf download dipta007/OracleZoom merged_transformer.safetensors --local-dir ckpt/OracleZoom
43
 
44
- # 4. Put your images in ./inputs, then run the 4-step zoom
45
- python -m opd_zoom.teacher.oracle_infer \
46
- --mode student \
47
- --full_transformer ckpt/OracleZoom/merged_transformer.safetensors \
48
- --gt_dir ./inputs --out ./outputs --rec_num 4
49
  ```
50
 
51
- **Results:** `outputs/per-scale/scale1/<name>.png` ... `scale4/<name>.png` are your image at **4x / 16x / 64x / 256x**.
52
 
53
- > Notes: Stable Diffusion 3-medium and the Qwen2.5-VL prompter download automatically on first run (a HuggingFace login may be needed for SD3). Chain-of-Zoom's own SR and VLM checkpoints must sit under `ref/coz/ckpt/` (`SR_LoRA`, `SR_VAE`, `VLM_LoRA`); see the [Chain-of-Zoom](https://github.com/bryanswkim/Chain-of-Zoom) repo to fetch them. That is the only extra download.
 
 
 
 
 
 
 
54
 
55
  ## Method
56
  Recursive SR (Chain-of-Zoom) reuses a 4x backbone step after step to reach 16x-256x. Each step is **blind**: it sees only a blurred crop of its own previous output and must invent the missing detail, so errors compound and the invention may be hallucinated.
57
 
58
- **Privileged-latent distillation.** A *privileged teacher* is shown the ground-truth high-resolution patch **at training time only** and distills its real detail into the blind student, in **decode space**. Only a small adapter is trained; the backbone, VAE, and prompter stay frozen. **A KL leash** to the deployed backbone keeps a deep sharpness reward from drifting into a metric-gaming texture, so detail stays faithful. (Trained: rank-16 adapter, 7.1M params, 1,000 curated 4K images; beta_reward 0.4, beta_kl 8.0. The released weights above have this adapter already merged in.)
59
 
60
  ## Results
61
  Under Chain-of-Zoom's exact protocol on a curated 4K benchmark and six test sets:
@@ -73,17 +76,16 @@ Sharpness is the axis prior methods are built for; the decisive gap is **faithfu
73
  - **In-scope:** research on faithful extreme (recursive) super-resolution of natural photographs.
74
  - **Out-of-scope:** forensic/evidentiary use (detail past 4x is generated, not recovered); real-camera-zoom claims (the benchmark uses synthetic center-crop zoom).
75
 
 
 
 
76
  ## Citation
77
  ```bibtex
78
  @inproceedings{dipta2027oraclezoom,
79
  title={OracleZoom: Privileged-Latent Distillation for Faithful Extreme Super-Resolution},
80
  author={Shubhashis Roy Dipta},
81
  year={2027},
82
- note={In submission, WACV 2027},
83
- url={https://github.com/dipta007/OPD-Zoom}
84
  }
85
  ```
86
- Please also cite Chain-of-Zoom and OSEDiff, whose components this builds on.
87
-
88
- ## License
89
- Released for **research, non-commercial** use (CC-BY-NC-4.0). Built on OSEDiff / Stable Diffusion 3 and used with a Qwen2.5-VL prompter inside Chain-of-Zoom; the respective upstream licenses apply to those components.
 
16
  # OracleZoom
17
 
18
  **Privileged-Latent Distillation for faithful extreme super-resolution.**
19
+ OracleZoom drives Chain-of-Zoom's recursive 4x super-resolution out to 256x while staying *faithful*, adding real detail instead of hallucinating. **This repo is self-contained**: the merged model, the inference code, and the required checkpoints are all here. You only download two public base models (Stable Diffusion 3-medium, Qwen2.5-VL-3B) automatically.
20
 
21
+ [![Base](https://img.shields.io/badge/Base-SD3%20%2B%20Qwen2.5--VL-blue)](https://huggingface.co/stabilityai/stable-diffusion-3-medium-diffusers)
22
+ [![Method](https://img.shields.io/badge/Method-Chain--of--Zoom-orange)](https://github.com/bryanswkim/Chain-of-Zoom)
23
+ [![Paper](https://img.shields.io/badge/Paper-WACV%202027%20(in%20submission)-red)](#)
24
  [![License](https://img.shields.io/badge/License-CC--BY--NC--4.0-lightgrey)](https://creativecommons.org/licenses/by-nc/4.0/)
25
 
26
+ ## Quickstart (no repo to clone)
 
27
 
28
+ Needs one NVIDIA GPU (~16 GB) and Python 3.10.
 
29
 
30
  ```bash
31
+ # 0. One-time: Stable Diffusion 3 is gated, so accept its license on HF, then log in
 
 
 
 
 
32
  pip install -U "huggingface_hub[cli]"
33
+ hf auth login
34
+
35
+ # 1. Download this repo (merged model + code + checkpoints)
36
+ hf download dipta007/OracleZoom --local-dir OracleZoom
37
+ cd OracleZoom
38
 
39
+ # 2. Install dependencies
40
+ pip install -r requirements.txt
41
 
42
+ # 3. Put your photos in ./inputs, then zoom 4x -> 16x -> 64x -> 256x
43
+ mkdir -p inputs && cp /path/to/photo.jpg inputs/
44
+ python inference.py --input ./inputs --output ./outputs
 
 
45
  ```
46
 
47
+ **Results:** `outputs/per-scale/scale1/<name>.png` ... `scale4/<name>.png` are your image at **4x / 16x / 64x / 256x** (`scale0` is the 512x512 input crop). Stable Diffusion 3-medium and Qwen2.5-VL-3B download automatically on first run.
48
 
49
+ ## What's in this repo
50
+ | Path | What it is |
51
+ |---|---|
52
+ | `merged_transformer.safetensors` | The OracleZoom super-resolution transformer (SD3 + Chain-of-Zoom's SR module + our distilled adapter, merged), fp32, ~8.35 GB. |
53
+ | `inference.py` | Self-contained runner: loads the pipeline, does the 4-step recursive zoom with VLM prompting. |
54
+ | `coz/` | Vendored Chain-of-Zoom inference code (the one-step SR wrapper + helpers). |
55
+ | `ckpt/` | Chain-of-Zoom's SR-VAE and VLM-prompt (Qwen LoRA) checkpoints needed by the pipeline. |
56
+ | `requirements.txt` | Python dependencies. |
57
 
58
  ## Method
59
  Recursive SR (Chain-of-Zoom) reuses a 4x backbone step after step to reach 16x-256x. Each step is **blind**: it sees only a blurred crop of its own previous output and must invent the missing detail, so errors compound and the invention may be hallucinated.
60
 
61
+ **Privileged-latent distillation.** A *privileged teacher* is shown the ground-truth high-resolution patch **at training time only** and distills its real detail into the blind student, in **decode space**. Only a small adapter is trained; the backbone, VAE, and prompter stay frozen. **A KL leash** to the deployed backbone keeps a deep sharpness reward from drifting into a metric-gaming texture, so detail stays faithful. Trained: rank-16 adapter (7.1M params), 1,000 curated 4K images; beta_reward 0.4, beta_kl 8.0. The released weights have this adapter already merged in.
62
 
63
  ## Results
64
  Under Chain-of-Zoom's exact protocol on a curated 4K benchmark and six test sets:
 
76
  - **In-scope:** research on faithful extreme (recursive) super-resolution of natural photographs.
77
  - **Out-of-scope:** forensic/evidentiary use (detail past 4x is generated, not recovered); real-camera-zoom claims (the benchmark uses synthetic center-crop zoom).
78
 
79
+ ## Acknowledgements & Licensing
80
+ The `coz/` code and the checkpoints in `ckpt/` are from [Chain-of-Zoom](https://github.com/bryanswkim/Chain-of-Zoom) and are redistributed here for convenience; please respect their original license and cite them. The pipeline uses Stable Diffusion 3-medium and Qwen2.5-VL-3B under their respective licenses. OracleZoom's own contribution (the distilled adapter, merged into `merged_transformer.safetensors`) is released for **research, non-commercial** use (CC-BY-NC-4.0).
81
+
82
  ## Citation
83
  ```bibtex
84
  @inproceedings{dipta2027oraclezoom,
85
  title={OracleZoom: Privileged-Latent Distillation for Faithful Extreme Super-Resolution},
86
  author={Shubhashis Roy Dipta},
87
  year={2027},
88
+ note={In submission, WACV 2027}
 
89
  }
90
  ```
91
+ Please also cite Chain-of-Zoom and OSEDiff.