Add and use escapeFilePath
This commit is contained in:
parent
b50f013234
commit
561ec9d1e0
@ -7,12 +7,12 @@ import os
|
||||
from tqdm import tqdm
|
||||
import csv
|
||||
import rawpy
|
||||
from utils import Color, denoise, iterativeMean, isARawImage
|
||||
from utils import Color, denoise, iterativeMean, isARawImage, escapeFilePath
|
||||
import matplotlib.pyplot as plt
|
||||
from scipy.ndimage import gaussian_filter
|
||||
|
||||
imagesFolderPath = 'rafael/arw'
|
||||
imagesFolderPathFileName = imagesFolderPath.replace('/', '_')
|
||||
imagesFolderPathFileName = escapeFilePath(imagesFolderPath)
|
||||
# Among:
|
||||
# `denoise` possible denoisers and `mean`.
|
||||
denoiser = 'mean'
|
||||
|
@ -4,7 +4,7 @@ from PIL import Image
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
from tqdm import tqdm
|
||||
from utils import denoise, iterativeMean
|
||||
from utils import denoise, iterativeMean, escapeFilePath
|
||||
from skimage import img_as_float
|
||||
import sys
|
||||
import os
|
||||
@ -18,7 +18,7 @@ NUMBER_OF_SUBGROUPS = 2
|
||||
DENOISER = 'wavelet'
|
||||
IMAGES_FOLDER = 'flat-field/TIF'
|
||||
|
||||
setting = IMAGES_FOLDER.replace('/', '_') + f'_{DENOISER}'
|
||||
setting = escapeFilePath(IMAGES_FOLDER) + f'_{DENOISER}'
|
||||
|
||||
imagesFileNames = os.listdir(IMAGES_FOLDER)
|
||||
# To not have a bias (chronological for instance) when split to make subgroups.
|
||||
|
@ -69,4 +69,7 @@ def getRawColorChannel(raw, color):
|
||||
return imageNpArray
|
||||
|
||||
def isARawImage(imageFilePath):
|
||||
return any([imageFileName.lower().endswith(f'.{rawImageFileExtension}') for rawImageFileExtension in RAW_IMAGE_FILE_EXTENSIONS])
|
||||
return any([imageFileName.lower().endswith(f'.{rawImageFileExtension}') for rawImageFileExtension in RAW_IMAGE_FILE_EXTENSIONS])
|
||||
|
||||
def escapeFilePath(filePath):
|
||||
return filePath.replace('/', '_')
|
Loading…
x
Reference in New Issue
Block a user