YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
markdown
license: apache-2.0 library_name: onnxruntime tags: - image-enhancement - color-correction - 3d-lut - bilateral-grid - onnx
LUTwithBGrid (ONNX Export)
ONNX export of LUTwithBGrid β Image-Adaptive 3D Lookup Tables for Real-time Image Enhancement with Bilateral Grids (ECCV 2024).
Original
- Paper: Image-Adaptive 3D Lookup Tables for Real-time Image Enhancement with Bilateral Grids
- Authors: Wontae Kim, Nam Ik Cho (Seoul National University)
- Original Repo: WontaeaeKim/LUTwithBGrid
- License: Apache 2.0
What is this
This is a cross-platform ONNX export of the original PyTorch model. The original implementation requires custom CUDA kernels (lut_transform, bilateral_slicing) which must be compiled manually β this can be a barrier for users without CUDA Toolkit or Visual Studio Build Tools.
The ONNX version removes that barrier: it runs on CPU via onnxruntime, no CUDA, no compilation, no PyTorch required.
Changes from Original
- Rewritten CUDA kernels in pure PyTorch (
F.grid_sample+gather) β for ONNX compatibility - Exported to ONNX (opset 17) β runs on CPU
- Hybrid mode β takes brightness from the model, keeps original color (prevents color cast on PBR textures)
Files
| File | Description |
|---|---|
lutwithbgrid_fivek.onnx |
ONNX model (FiveK sRGB weights), 1.9 MB |
export_script.py |
Script used to export the ONNX model |
test_inference.py |
Minimal example: load ONNX and run inference |
requirements.txt |
Python dependencies |
Usage
import onnxruntime as ort
import numpy as np
from PIL import Image
# Load model
session = ort.InferenceSession("lutwithbgrid_fivek.onnx")
# Preprocess
img = Image.open("input.png").convert("RGB").resize((512, 512))
arr = np.array(img).astype(np.float32) / 255.0
arr = np.transpose(arr, (2, 0, 1))[None, ...]
# Inference
result = session.run(None, {"input": arr})[0]
# Postprocess
result = np.transpose(result[0], (1, 2, 0))
result = np.clip(result * 255, 0, 255).astype(np.uint8)
Image.fromarray(result).save("output.png")
Intended Use
Image color enhancement / retouching
PBR texture albedo correction
Any workflow where a lightweight, CPU-friendly image enhancement model is needed
Limitations
Trained on FiveK (photographs, not PBR textures) β may produce color casts on synthetic textures
Input size is fixed at 512Γ512 for training; larger images should be tiled or resized
Hybrid mode (brightness only) is recommended for PBR albedo to avoid color shifts
Citation
bibtex
@inproceedings{kim2024LUTwithBGrid,
title={Image-adaptive 3D Lookup Tables for Real-time Image Enhancement with Bilateral Grids},
author={Kim, Wontae and Cho, Nam Ik},
booktitle={European Conference on Computer Vision},
year={2024}
}
Acknowledgments
Original model by Wontae Kim and Nam Ik Cho (Seoul National University), licensed under Apache 2.0.
## Used in
This ONNX export powers the **LUTwithBGrid** AI mode in [**Albedolizer**](https://github.com/invisiblelevel/Albedolizer) β a free PBR texture checker & optimizer for 3D artists.
- π Website: [invisiblelevel.github.io/Albedolizer](https://invisiblelevel.github.io/Albedolizer/)
- πΎ Download: [invisiblelevel.itch.io/albedolizer](https://invisiblelevel.itch.io/albedolizer)
- π Source: [github.com/invisiblelevel/Albedolizer](https://github.com/invisiblelevel/Albedolizer)
If you use this ONNX model, feel free to also check out Albedolizer for a complete PBR texture workflow.
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support