Open source Python implementation of the HDR+ photography pipeline

Overview

hdrplus-python

Open source Python implementation of the HDR+ photography pipeline, originally developped by Google and presented in a 2016 article. The finishing pipeline is simplified and of lesser quality than the one described in the original publication.

For an interactive demo and the associated article, An Analysis and Implementation of the HDR+ Burst Denoising Method, check out Image Processing On Line

Note: A C++ / Halide implementation by different authors is available here.

Installation Instructions

All the libraries necessary to run the code are listed in the hdrplus.yml Conda environment file. Simply run

conda env create -f hdrplus.yml

from a command window to install a functional environment.

File Contents and Provided Files

All source code containing algorithm functions is located within the package/algorithm folder, except some optional visualization functions located in package/visualization/vis.py

Scripts to run the algorithm are located at the root of the repo.

Running the Code

Two scripts are provided to either run the algorithm on a single burst (runHdrplus.py) or on a series of bursts all within the same parent folder (runHdrplus_multiple.py).

Examples of use:

python runHdrplus.py -i ./test_data/33TJ_20150606_224837_294 -o ./results_test1 -m full -v 2
python runHdrplus_multiple.py -i ./test_data -o ./results_test2 -m full

You can run the algorithm in three modes (-m command argument):

  • full:
    • required inputs (per burst folder): all raw .dng burst files and a single reference_frame.txt file
    • outputs (per burst folder): 3 .jpg images: final image X_final.jpg + minimally processed versions of the reference and merged image X_reference_gamma.jpg X_merged_gamma.jpg
  • align:
    • required inputs: all raw .dng burst files and a single reference_frame.txt files
    • outputs: a .dng file (copy of the reference image) + 2 numpy files: X_aligned_tiles.npy and X_padding.npy
  • merge:
    • required inputs: (obtained from align mode) a single .dng file (for metadata of the reference image) + 2 numpy files X_aligned_tiles.npy and X_padding.npy
    • outputs: a .dng file (copy of the reference image) + 1 numpy file: X_merged_bayer.npy
  • finish:
    • required inputs: (obtained from merge mode) a single .dng file (for metadata of the reference image) + 1 numpy file (for actual pixel values) X_merged_bayer.npy
    • outputs: final image X_final.jpg You can also change the values of the 'write___' dictionary items in params.py to change the kind of files dumped in each mode (at your own risk).

A helper script for the minimal processing of raw .dng files into .png/.jpg files (e.g. for the visualization of input images) is also included in the code: all_dngs_to_png.py

Test Data

1 burst can be found in the test_data folder (each burst being in its own subfolder) Feel free to add your own data. The structure of a burst folder must be the following:

  • the burst name is specified by the name of the folder itself
  • burst images must be stored as .dng files (most proprietary raw images formats can be turned to DNG using Adobe DNG Converter
  • image files must be named the following way: commonpart<X>.dng, where <X> gives an indication of the frame number (eg payload_N000.dng, payload_N001.dng / G0140178.dng, G0140179.dng)
  • you can specify the reference frame by putting a zero-indexed number inside a reference_frame.txt file (i.e. 0 for the 1st frame)

Additional data can be downloaded via the following links:

COPYRIGHT AND LICENSE INFORMATION

Copyright (c) 2021 Antoine Monod

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

This file implements an algorithm possibly linked to the patent US9077913B2. This file is made available for the exclusive aim of serving as scientific tool to verify the soundness and completeness of the algorithm description. Compilation, execution and redistribution of this file may violate patents rights in certain countries. The situation being different for every country and changing over time, it is your responsibility to determine which patent rights restrictions apply to you before you compile, use, modify, or redistribute this file. A patent lawyer is qualified to make this determination. If and only if they don't conflict with any patent terms, you can benefit from the following license terms attached to this file.

Owner
PhD Student in applied mathematics (image processing, deep learning)
3rd Place Solution of the Traffic4Cast Core Challenge @ NeurIPS 2021

3rd Place Solution of Traffic4Cast 2021 Core Challenge This is the code for our solution to the NeurIPS 2021 Traffic4Cast Core Challenge. Paper Our so

7 Jul 25, 2022
Code for Blind Image Decomposition (BID) and Blind Image Decomposition network (BIDeN).

arXiv, porject page, paper Blind Image Decomposition (BID) Blind Image Decomposition is a novel task. The task requires separating a superimposed imag

64 Dec 20, 2022
LinkNet - This repository contains our Torch7 implementation of the network developed by us at e-Lab.

LinkNet This repository contains our Torch7 implementation of the network developed by us at e-Lab. You can go to our blogpost or read the article Lin

e-Lab 158 Nov 11, 2022
Recovering Brain Structure Network Using Functional Connectivity

Recovering-Brain-Structure-Network-Using-Functional-Connectivity Framework: Papers: This repository provides a PyTorch implementation of the models ad

5 Nov 30, 2022
A self-supervised 3D representation learning framework named viewpoint bottleneck.

Pointly-supervised 3D Scene Parsing with Viewpoint Bottleneck Paper Created by Liyi Luo, Beiwen Tian, Hao Zhao and Guyue Zhou from Institute for AI In

63 Aug 11, 2022
Mscp jamf - Build compliance in jamf

mscp_jamf Build compliance in Jamf. This will build the following xml pieces to

Bob Gendler 3 Jul 25, 2022
g9.py - Torch interactive graphics

g9.py - Torch interactive graphics A Torch toy in the browser. Demo at https://srush.github.io/g9py/ This is a shameless copy of g9.js, written in Pyt

Sasha Rush 13 Nov 16, 2022
Weakly Supervised Segmentation by Tensorflow.

Weakly Supervised Segmentation by Tensorflow. Implements semantic segmentation in Simple Does It: Weakly Supervised Instance and Semantic Segmentation, by Khoreva et al. (CVPR 2017).

CHENG-YOU LU 52 Dec 27, 2022
An implementation of the WHATWG URL Standard in JavaScript

whatwg-url whatwg-url is a full implementation of the WHATWG URL Standard. It can be used standalone, but it also exposes a lot of the internal algori

314 Dec 28, 2022
CRISCE: Automatically Generating Critical Driving Scenarios From Car Accident Sketches

CRISCE: Automatically Generating Critical Driving Scenarios From Car Accident Sketches This document describes how to install and use CRISCE (CRItical

Chair of Software Engineering II, Uni Passau 2 Feb 09, 2022
ComputerVision - This repository aims at realized easy network architecture

ComputerVision This repository aims at realized easy network architecture Colori

DongDong 4 Dec 14, 2022
Making a music video with Wav2CLIP and VQGAN-CLIP

music2video Overview A repo for making a music video with Wav2CLIP and VQGAN-CLIP. The base code was derived from VQGAN-CLIP The CLIP embedding for au

Joel Jang | 장요엘 163 Dec 26, 2022
This is an official implementation for "PlaneRecNet".

PlaneRecNet This is an official implementation for PlaneRecNet: A multi-task convolutional neural network provides instance segmentation for piece-wis

yaxu 50 Nov 17, 2022
Code for the paper "Training GANs with Stronger Augmentations via Contrastive Discriminator" (ICLR 2021)

Training GANs with Stronger Augmentations via Contrastive Discriminator (ICLR 2021) This repository contains the code for reproducing the paper: Train

Jongheon Jeong 174 Dec 29, 2022
Parallel and High-Fidelity Text-to-Lip Generation; AAAI 2022 ; Official code

Parallel and High-Fidelity Text-to-Lip Generation This repository is the official PyTorch implementation of our AAAI-2022 paper, in which we propose P

Zhying 77 Dec 21, 2022
quantize aware training package for NCNN on pytorch

ncnnqat ncnnqat is a quantize aware training package for NCNN on pytorch. Table of Contents ncnnqat Table of Contents Installation Usage Code Examples

62 Nov 23, 2022
KIDA: Knowledge Inheritance in Data Aggregation

KIDA: Knowledge Inheritance in Data Aggregation This project releases our 1st place solution on NeurIPS2021 ML4CO Dual Task. Slide and model weights a

24 Sep 08, 2022
Implementation of ResMLP, an all MLP solution to image classification, in Pytorch

ResMLP - Pytorch Implementation of ResMLP, an all MLP solution to image classification out of Facebook AI, in Pytorch Install $ pip install res-mlp-py

Phil Wang 178 Dec 02, 2022
TensorFlow Ranking is a library for Learning-to-Rank (LTR) techniques on the TensorFlow platform

TensorFlow Ranking is a library for Learning-to-Rank (LTR) techniques on the TensorFlow platform

2.6k Jan 04, 2023
TaCL: Improving BERT Pre-training with Token-aware Contrastive Learning

TaCL: Improving BERT Pre-training with Token-aware Contrastive Learning Authors: Yixuan Su, Fangyu Liu, Zaiqiao Meng, Lei Shu, Ehsan Shareghi, and Nig

Yixuan Su 79 Nov 04, 2022