File size: 5,788 Bytes
38754b5 ed77638 38754b5 ed77638 38754b5 4214287 0a4293a 4214287 ed77638 4214287 0a4293a 4214287 0a4293a 4214287 ed77638 4214287 ed77638 4214287 ed77638 4214287 ed77638 4214287 38754b5 ed77638 38754b5 ed77638 38754b5 ed77638 38754b5 ed77638 38754b5 ed77638 | 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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | ---
license: cc-by-sa-4.0
task_categories:
- image-to-image
- image-classification
tags:
- image-restoration
- super-resolution
- blind-image-super-resolution
- clip
- degradation
- lpips
size_categories:
- 100K<n<1M
pretty_name: OD-CLIP Training Dataset
---
# OD-CLIP Training Dataset
Training data for **OD-CLIP**: a degradation-aware CLIP variant that jointly
predicts degradation type and LPIPS-calibrated perceptual severity, used for
blind image super-resolution.
The dataset provides paired ground-truth (GT) and low-quality (LQ) image
crops together with per-image degradation metadata, covering four synthetic
degradation types (Gaussian blur, Gaussian noise, JPEG compression, and
downsampling) at a dense grid of physical severity levels.
## Download and Setup
The dataset is distributed as **six tar archives** (blur / jpeg_part1 /
jpeg_part2 / resize / noisy for the single-degradation set, and one tar for
the mixed-degradation set) plus two CSV manifests.
JPEG is split into two parts because its combined size exceeds Hugging Face's
per-file limit of 50 GB.
### 1. Install the CLI (once)
```bash
pip install --upgrade huggingface_hub
```
### 2. Download the dataset
```bash
# Download the whole dataset
huggingface-cli download yeeecheng/OD-CLIP \
--repo-type dataset --local-dir OD-CLIP
```
Or download **only the parts you need**:
```bash
# Only single-degradation set (blur/jpeg/resize/noisy)
huggingface-cli download yeeecheng/OD-CLIP --repo-type dataset \
--include "DIV2K_HR_train_crop/*" --local-dir OD-CLIP
# Only mixed-degradation set (stage-2 fine-tuning)
huggingface-cli download yeeecheng/OD-CLIP --repo-type dataset \
--include "DIV2K_train_HR_random/*" --local-dir OD-CLIP
# Only one degradation type (e.g. blur)
huggingface-cli download yeeecheng/OD-CLIP --repo-type dataset \
--include "DIV2K_HR_train_crop/blur.tar" \
--include "DIV2K_HR_train_crop/merged_daclip_train_all.csv" \
--local-dir OD-CLIP
# For JPEG, remember to grab both parts
huggingface-cli download yeeecheng/OD-CLIP --repo-type dataset \
--include "DIV2K_HR_train_crop/jpeg_part*.tar" \
--include "DIV2K_HR_train_crop/merged_daclip_train_all.csv" \
--local-dir OD-CLIP
```
### 3. Extract the tar archives
```bash
cd OD-CLIP
# Extract the four type tars (single-degradation set)
cd DIV2K_HR_train_crop
for f in *.tar; do
echo "Extracting $f ..."
tar xf "$f"
rm "$f" # optional: free disk after extraction
done
cd ..
# Note: jpeg_part1.tar and jpeg_part2.tar both extract into the same
# top level (each holds a disjoint set of jpeg{XX}.0/ subdirs), so no
# special handling is needed — the two archives merge cleanly.
# Extract the mixed-degradation tar
cd DIV2K_train_HR_random
mkdir -p train_crop
tar xf random0.tar -C train_crop/
rm random0.tar # optional
cd ..
```
### 4. Resulting directory layout
```
OD-CLIP/
├── DIV2K_HR_train_crop/
│ ├── merged_daclip_train_all.csv # top-level manifest
│ ├── blur0.1/ blur0.2/ ... blur4.0/ # 40 subdirs
│ ├── jpeg31/ jpeg32/ ... jpeg95/ # 65 subdirs
│ ├── resize1.1/ ... resize7.0/ # 60 subdirs
│ ├── noisy1/ ... noisy40/ # 40 subdirs
│ └── (each subdir contains: GT/, LQ/, daclip_val.csv, degraded_prompts_0.json)
└── DIV2K_train_HR_random/
├── merged_daclip_train_all_updated.csv # stage-2 manifest
└── train_crop/random0/
├── GT/ # 4000 clean crops
└── LQ/ # 4000 mixed-degradation crops
```
### 5. Verify
Each single-degradation subdirectory should contain **800 GT crops and 800 LQ
crops**; the mixed-degradation `random0/{GT,LQ}` should each contain **4000**.
A quick check:
```bash
ls OD-CLIP/DIV2K_HR_train_crop/blur0.1/LQ | wc -l # → 800
ls OD-CLIP/DIV2K_HR_train_crop/blur0.1/GT | wc -l # → 800
ls OD-CLIP/DIV2K_train_HR_random/train_crop/random0/LQ | wc -l # → 4000
```
---
## Contents
### 1. `DIV2K_HR_train_crop/`
Single-degradation training set. Contains 208 subdirectories, one per
`(degradation_type, level)` pair:
| Type | Physical parameter | Range | Step | # subdirs |
|:-----------|:-------------------|:---------------|:------|----------:|
| Blur | Gaussian sigma | 0.1 → 4.0 | 0.1 | 40 |
| JPEG | Quality factor | 31 → 95 | 1 | 65 |
| Downsample | Scale factor | 1.1 → 7.0 | 0.1 | 60 |
| Noise | Gaussian sigma | 1.0 → 40.0 | 1.0 | 40 |
| | | **Total** | | **205** |
*(Additional 3 clean-reference subdirs bring the total to 208.)*
Each subdirectory contains:
- `GT/` — 800 clean crops (256×256 px, PNG)
- `LQ/` — 800 degraded crops (256×256 px, PNG), paired one-to-one with `GT/`
- `daclip_val.csv` — per-image manifest (filepath, degradation label, physical
parameter value)
- `degraded_prompts_0.json` — text prompt used for the degradation
### 2. `DIV2K_train_HR_random/`
Mixed-degradation training set. All four degradations are applied to each
image with per-image randomized parameters, used for stage-2 fine-tuning on
composite degradations.
- `train_crop/random0/GT/` — 4000 clean crops
- `train_crop/random0/LQ/` — 4000 mixed-degradation crops
- `merged_daclip_train_all_updated.csv` — top-level manifest for stage-2 training
## Source and License
Ground-truth crops are derived from the DIV2K training set
(https://data.vision.ee.ethz.ch/cvl/DIV2K/), licensed under **CC BY-SA 4.0**.
This release inherits the same license.
## Contact
For questions, please open an issue on this dataset repository.
|