Skip to content
Open
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import numpy as np


def linear_rgb2srgb(image):
def srgb2linear_rgb(image):
"""
convert linear rgb image to srgb image
Args:
Expand All @@ -14,7 +14,7 @@ def linear_rgb2srgb(image):
return np.where(image <= 0.04045, image / 12.92, ((image + 0.055) / 1.055) ** 2.4)


def srgb2linear_rgb(image):
def linear_rgb2srgb(image):
"""
convert srgb image to linear rgb image
Args:
Expand All @@ -36,7 +36,7 @@ def preprocessing_image(image):
"""
np_image = np.array(image) / 255
clipped_image = np.clip(np_image, 0, 1)
srgb_image = linear_rgb2srgb(clipped_image)
srgb_image = srgb2linear_rgb(clipped_image)
h, w, c = srgb_image.shape
linear_image = srgb_image.reshape(h * w, c)
for pixel in linear_image:
Expand Down