Load lazily images (#62)
This commit is contained in:
@@ -90,11 +90,9 @@ def isARawImage(imageFilePath):
|
||||
|
||||
def getColorChannel(imageFilePath, color):
|
||||
if isARawImage(imageFilePath):
|
||||
numpyFilePath = f'{imageFilePath}.npy'
|
||||
numpyFilePath = f'{imageFilePath}.{color}.npy'
|
||||
if os.path.isfile(numpyFilePath):
|
||||
imageNpArray = np.load(numpyFilePath, allow_pickle = True).item()#[color]
|
||||
print(imageNpArray)
|
||||
#exit(1)
|
||||
imageNpArray = np.load(numpyFilePath)
|
||||
else:
|
||||
with rawpy.imread(imageFilePath) as raw:
|
||||
imageNpArray = getRawColorChannel(raw, color)
|
||||
|
||||
Reference in New Issue
Block a user