Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
583875c
Minor fix in python/flip/main.cpp
pandersson94 Oct 16, 2024
56fbb84
Merge branch 'NVlabs:main' into main
pandersson94 Oct 30, 2024
c9d0dd1
Update to FLIP v1.5.
pandersson94 Oct 30, 2024
4dbc2f4
Update flip_ci.yml
pandersson94 Oct 30, 2024
218e9dc
Update flip_ci.yml
pandersson94 Oct 30, 2024
7d4831d
Update flip_ci.yml
pandersson94 Oct 30, 2024
30710e4
Major bugfix and couple of small changes
pandersson94 Oct 31, 2024
7d4b7e9
Minor notes added to README and other information files
pandersson94 Oct 31, 2024
aa88bb6
Re-added lost code and improved README
pandersson94 Oct 31, 2024
bd2f1ad
Added FLIP error/exposure map locations to output string
pandersson94 Oct 31, 2024
032d51a
Added PyPI URL to versionList.md
pandersson94 Oct 31, 2024
86eb71f
Updated Python and C++ READMEs based on new expected FLIP tool output
pandersson94 Oct 31, 2024
0a252db
Updated README links
pandersson94 Oct 31, 2024
8144bd5
Switch to nanobind and add cibuildwheel action
pandersson94 Nov 8, 2024
12cee38
Merge branch 'main' of https://github.com/nvlabs/flip
pandersson94 Nov 8, 2024
1f4f67f
Minor fix
pandersson94 Nov 8, 2024
2d51b0a
More workflow fixes
pandersson94 Nov 8, 2024
eaeefbd
Check APPLE before UNIX
pandersson94 Nov 8, 2024
5d8e663
Test only Windows
pandersson94 Nov 8, 2024
0775587
Fixed case issue. Now builds on Linux
pandersson94 Nov 11, 2024
3b654bb
Fixed some broken links and re-added Unix/macOS wheels
pandersson94 Nov 11, 2024
ae785ba
Added manylinux_x86_64 to wheels
pandersson94 Nov 11, 2024
b635250
No more manylinux
pandersson94 Nov 11, 2024
36c08c0
Final version update
pandersson94 Nov 11, 2024
8c317c5
Minor fix
pandersson94 Nov 11, 2024
1bf3fe7
Changed to 1.6 due to PyPI naming conflict
pandersson94 Nov 11, 2024
07aa5d4
Updated GitHub workflow
pandersson94 Sep 1, 2025
38bf8e7
Fixed memory leak
pandersson94 Nov 7, 2025
75471e2
Fixed HDR-FLIP crash when median lum. is 0
pandersson94 Nov 7, 2025
cd18082
Merge branch 'main' of https://github.com/pandersson94/flip
pandersson94 Nov 7, 2025
2e40cc6
Update to FLIP v1.7
pandersson94 Nov 7, 2025
c700f27
Update git workflows
pandersson94 Nov 7, 2025
614be6e
Fixed merge conflict
pandersson94 Nov 7, 2025
323fcc1
Fix merge conflict bug
pandersson94 Nov 7, 2025
63c4dcf
Fixed more merge conflict bugs
pandersson94 Nov 7, 2025
51c0eef
[PyTorch] Updated float eps value in median computation
pandersson94 Nov 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/flip-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ jobs:
build_wheels:
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
os: [ubuntu-latest, windows-latest, macos-latest]
python: [cp38, cp39, cp310, cp311, cp312, cp312_stable, cp313]
exclude:
# The first Python version to target Apple arm64 architectures is 3.9.
- os: macos-14
- os: [macos-latest]
python: cp38
name: >
${{ matrix.python }} wheel for ${{ matrix.os }}
Expand Down
22 changes: 22 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,29 @@
# SPDX-License-Identifier: BSD-3-Clause
#################################################################################

<<<<<<<< HEAD:src/CMakeLists.txt
cmake_minimum_required(VERSION 3.9)

set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_BUILD_TYPE_INIT "Release")

project(flip LANGUAGES CXX)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
include(GNUInstallDirs)

option(FLIP_ENABLE_CUDA "Include CUDA version of flip" OFF)

add_subdirectory(cpp)
========
module(
name = "flip",
compatibility_level = 1,
)
>>>>>>>> upstream/main:MODULE.bazel
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Teaser image](images/teaser.png "Teaser image")

# FLIP: A Tool for Visualizing and Communicating Errors in Rendered Images (v1.6)
# FLIP: A Tool for Visualizing and Communicating Errors in Rendered Images (v1.7)

By
[Pontus Ebelin](https://research.nvidia.com/person/pontus-ebelin)
Expand All @@ -27,6 +27,8 @@ The changes made for the different versions of FLIP are summarized in the [versi
[An image gallery](https://research.nvidia.com/node/3525) displaying a large quantity of reference/test images and corresponding error maps from
different metrics.

**Note**: since v1.7, the automatic stop exposure in HDR-FLIP is able to handle reference images whose median luminance is 0.

**Note**: since v1.6, the Python version of FLIP can now be installed via `pip install flip-evaluator`.

**Note**: in v1.3, we switched to a *single header* ([FLIP.h](src/cpp/FLIP.h)) for C++/CUDA for easier integration.
Expand Down Expand Up @@ -136,4 +138,4 @@ Should your work use the FLIP tool in a more general fashion, please cite the Ra

# Acknowledgements
We appreciate the following peoples' contributions to this repository:
Jonathan Granskog, Jacob Munkberg, Jon Hasselgren, Jefferson Amstutz, Alan Wolfe, Killian Herveau, Vinh Truong, Philippe Dagobert, Hannes Hergeth, Matt Pharr, Tizian Zeltner, Jan Honsbrok, Chris Zhang, Wenzel Jakob, and Julian Amann.
Jonathan Granskog, Jacob Munkberg, Jon Hasselgren, Jefferson Amstutz, Alan Wolfe, Killian Herveau, Vinh Truong, Philippe Dagobert, Hannes Hergeth, Matt Pharr, Tizian Zeltner, Jan Honsbrok, Chris Zhang, Wenzel Jakob, Julian Amann, and Xijie Yang.
5 changes: 5 additions & 0 deletions misc/versionList.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
In addition to various minor changes, the following was
changed for the different versions of FLIP:

# Version 1.7 (commit ?)
- Fixed memory leaks in the C++/CUDA/Python versions of FLIP.
- HDR-FLIP: Fixed crashes that followed from the reference's median being 0.
- Automatic start and stop exposures in HDR-FLIP are computed using statistics of the reference image. For the stop exposure, we use the median luminance of the reference. When that is 0, we used to get undefined behavior or a crash. Version 1.7 fixes this by clamping the median to have a minimum value of [FLT_EPSILON](https://learn.microsoft.com/en-us/cpp/c-language/limits-on-floating-point-constants?view=msvc-170).

# Version 1.6 (commit 7967578)
- Flipped the ꟻ in ꟻLIP. The entire name (FLIP) should now be readable on all devices.
- Published Python version of FLIP to PyPI (URL: https://pypi.org/project/flip-evaluator/).
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#################################################################################
# Copyright (c) 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) 2020-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
Expand All @@ -26,7 +26,7 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES
# SPDX-FileCopyrightText: Copyright (c) 2020-2025 NVIDIA CORPORATION & AFFILIATES
# SPDX-License-Identifier: BSD-3-Clause
#################################################################################

Expand All @@ -36,7 +36,7 @@ build-backend = "scikit_build_core.build"

[project]
name = "flip_evaluator"
version = "1.6.0.1"
version = "1.7"
description = "A Difference Evaluator for Alternating Images"
readme = "README.md"
requires-python = ">=3.8"
Expand Down
1 change: 1 addition & 0 deletions src/cpp/FLIP.h
Original file line number Diff line number Diff line change
Expand Up @@ -2227,6 +2227,7 @@ namespace FLIP
size_t medianLocation = luminances.size() / 2;
std::nth_element(luminances.begin(), luminances.begin() + medianLocation, luminances.end());
float Ymedian = luminances[medianLocation];
Ymedian = std::max(Ymedian, std::numeric_limits<float>::epsilon()); // Avoid median = 0 when more than half of the image's pixels are black.

startExposure = log2(xMax / Ymax);
stopExposure = log2(xMax / Ymedian);
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FLIP: A Tool for Visualizing and Communicating Errors in Rendered Images (v1.6)
# FLIP: A Tool for Visualizing and Communicating Errors in Rendered Images (v1.7)

By
[Pontus Ebelin](https://research.nvidia.com/person/pontus-ebelin)
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/tool/FLIPToolHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ namespace FLIPTool

std::string FLIPString = "FLIP";
int MajorVersion = 1;
int MinorVersion = 6;
int MinorVersion = 7;

if (commandLine.optionSet("help"))
{
Expand Down
8 changes: 4 additions & 4 deletions src/cpp/tool/imagehelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ namespace ImageHelpers
if (loadImage(fileName, imgWidth, imgHeight, pixels))
{
dstImage.setPixels(pixels, imgWidth, imgHeight);
delete[] pixels;
return true;
}
return false;
Expand Down Expand Up @@ -343,16 +344,15 @@ namespace ImageHelpers

const char* error;
int ret = SaveEXRImageToFile(&exrImage, &exrHeader, fileName.c_str(), &error);
free(exrHeader.channels);
free(exrHeader.pixel_types);
free(exrHeader.requested_pixel_types);
if (ret != TINYEXR_SUCCESS)
{
std::cerr << "Failed to save EXR file <" << fileName << ">: " << error << "\n";
return false;
}

free(exrHeader.channels);
free(exrHeader.pixel_types);
free(exrHeader.requested_pixel_types);

return true;
}
}
2 changes: 1 addition & 1 deletion src/python/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FLIP: A Tool for Visualizing and Communicating Errors in Rendered Images (v1.6)
# FLIP: A Tool for Visualizing and Communicating Errors in Rendered Images (v1.7)

By
[Pontus Ebelin](https://research.nvidia.com/person/pontus-ebelin)
Expand Down
2 changes: 1 addition & 1 deletion src/pytorch/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FLIP: A Tool for Visualizing and Communicating Errors in Rendered Images (v1.6)
# FLIP: A Tool for Visualizing and Communicating Errors in Rendered Images (v1.7)

By
[Pontus Ebelin](https://research.nvidia.com/person/pontus-ebelin)
Expand Down
1 change: 1 addition & 0 deletions src/pytorch/flip_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ def compute_start_stop_exposures(reference, tone_mapper, tmax, tmin):
dim = Y_reference.size()
Y_ref = Y_reference.view(dim[0], dim[1], dim[2]*dim[3])
Y_lo = torch.median(Y_ref, dim=2).values.unsqueeze(2).unsqueeze(3)
Y_lo = torch.clamp(Y_lo, min=torch.finfo(torch.float32).eps) # Avoid median = 0 when more than half of the image's pixels are black.
stop_exposure = torch.log2(x_min / Y_lo)

return start_exposure, stop_exposure
Expand Down
Loading