You can use these functions to add noise, blur, and downsample RAW images.
See the demo in generate_lq.ipynb
. You can find datasets at: https://huggingface.co/datasets/marcosv/rawir , and more tips and samples!
This code is designed for the NTIRE Challenges:
- NTIRE 2024 RAW Image Super Resolution Challenge
- NTIRE 2025 RAW Restoration Challenge: Track1) Super-Resolution
- NTIRE 2025 RAW Restoration Challenge: Track2) Restoration
This code was used in our papers:
- BSRAW: Improving Blind RAW Image Super-Resolution, WACV 2024
- Deep RAW Image Super-Resolution. A NTIRE 2024 Challenge Survey, CVPRW 2024
- Toward Efficient Deep Blind Raw Image Restoration, ICIP 2024
This dataset includes images different smartphones: iPhoneX, SamsungS9, Samsung21, Google Pixel 7-9, Oppo vivo x90.
How are the RAW images?
-
All the RAW images in this dataset have been standarized to follow a Bayer Pattern
RGGB
, and already white-black level corrected. -
Each RAW image was split into several crops of size 512x512x4 (1024x1024x3 for the corresponding RGBs). You see the filename
{raw_id}_{patch_number}.npy
. -
For each RAW image, you can find the associated metadata
{raw_id}.pkl
. -
RGB images are the corresponding captures from the phone i.e., the phone imaging pipeline (ISP) output. The images are saved as lossless PNG 8bits.
-
Scenes include indoor/outdoor, day/night, different ISO levels, different shutter speed levels.
-
How can I load these RAW images?
import numpy as np
raw = np.load("raw.npy")
max_val = 2**12 -1
raw = (raw / max_val).astype(np.float32)
- How do we save them?
import numpy as np
max_val = 2**12 -1
raw = (raw * max_val).astype(np.uint16)
np.save(os.path.join(SAVE_PATH, f"raw.npy"), raw_patch)