From cca81927dd15e575841a1514ab49fb4e1d136eac Mon Sep 17 00:00:00 2001 From: Benjamin Loison <12752145+Benjamin-Loison@users.noreply.github.com> Date: Thu, 18 Apr 2024 00:19:01 +0200 Subject: [PATCH] Move `Color` `Enum` to `utils.py` --- datasets/raise/extract_noise.py | 11 +---------- datasets/raise/utils.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 datasets/raise/utils.py diff --git a/datasets/raise/extract_noise.py b/datasets/raise/extract_noise.py index cef5d8a..824abd6 100755 --- a/datasets/raise/extract_noise.py +++ b/datasets/raise/extract_noise.py @@ -8,7 +8,7 @@ import os from tqdm import tqdm import csv import rawpy -from enum import Enum, auto +from utils import Color imagesFolderPath = '/mnt/HDD0/raise' imagesFolderPathFileName = imagesFolderPath.replace('/', '_') @@ -38,15 +38,6 @@ WALL = range(2_807, 2_912) minColor = None maxColor = None -class Color(Enum): - RED = auto() - GREEN_RIGHT = auto() - GREEN_BOTTOM = auto() - BLUE = auto() - - def __str__(self): - return self.name.lower() - # `color` is the actual color to estimate PRNU with. def treatImage(imageFileName, computeExtremes = False, color = None): global mean, numberOfImagesInMean, minColor, maxColor diff --git a/datasets/raise/utils.py b/datasets/raise/utils.py new file mode 100644 index 0000000..7fca4ab --- /dev/null +++ b/datasets/raise/utils.py @@ -0,0 +1,10 @@ +from enum import Enum, auto + +class Color(Enum): + RED = auto() + GREEN_RIGHT = auto() + GREEN_BOTTOM = auto() + BLUE = auto() + + def __str__(self): + return self.name.lower()