Lumawb

Lumawb predicts 42 Adobe Camera Raw settings for a photo: white balance, tone, presence, detail and the color mixer. You get slider values a photographer would set by hand, which a Camera Raw renderer can apply to the full-resolution image.

The model was trained on a private dataset of photos edited by people. The dataset and training work will be published later.

Quick start

pip install onnxruntime numpy pillow opencv-python-headless
huggingface-cli download vietserve/lumawb --local-dir lumawb
python lumawb/lumawb_infer.py photo.jpg
{
  "IncrementalTemperature": 0.0,
  "IncrementalTint": ...,
  "Exposure2012": 0.82,
  ...
}

Files

File Purpose
lumawb.onnx Model, opset 17, 5.1 MB
lumawb.onnx.json Checksums and signature that the Lumawb service uses to validate the model
config.json Input/output signature, the 42 settings in order, their ranges and output scaling
lumawb_infer.py Preprocessing, inference and conversion to Camera Raw values

Input and output

  • Input image: float32 [1, 3, 448, 448], RGB in [0, 1]. Apply EXIF rotation, then resize with OpenCV bicubic (cv2.INTER_CUBIC).
  • Output acr: float32 [1, 42], normalized. lumawb_infer.py converts it into Camera Raw values using config.json.

Use the script's preprocessing as is; a different resize changes the results.

Speed

Model time for one image (CPU: two threads, ONNX Runtime 1.31; GPU: ONNX Runtime 1.20):

Hardware PyTorch ONNX
AMD Ryzen 9 7950X3D 6.5 s 3.3 s
Apple M1 Pro (Docker, ARM64) 7.6 s 7.3 s
NVIDIA RTX 4090 132 ms 66 ms

ONNX output matches the PyTorch model to within 3.1e-4 before rounding, and the final Camera Raw values were identical on every test image.

Limitations

  • The model sees a 448 x 448 copy, so it judges global look rather than fine detail.
  • It predicts global sliders only: no masks, curves or local adjustments.
  • Values sitting exactly on a rounding step may differ by one step between CPUs or runtimes.

Credits and license

The backbone is adapted from HAT (Apache-2.0). Adobe and Camera Raw are trademarks of Adobe Inc.; Lumawb is not affiliated with Adobe.

The model is released under the Apache License 2.0: free to use, modify and redistribute, including commercially.

SHA-256 of lumawb.onnx: d84ac8d42752428d46b8d67ccc6f4113f184d6ec1c2ddba419b13650f840361e

Downloads last month
24
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support