diff --git a/datasets/raise/benchmark_load_part_of_images.py b/datasets/raise/benchmark_load_part_of_images.py index d4e8c37..c5a39b0 100755 --- a/datasets/raise/benchmark_load_part_of_images.py +++ b/datasets/raise/benchmark_load_part_of_images.py @@ -16,7 +16,10 @@ class Operation(Enum): SAVE = auto() LOAD_NPY = auto() -OPERATION = Operation.LOAD_RAW + def __str__(self): + return self.name + +OPERATION = Operation.LOAD_NPY RESOLUTION = 100 print(f'{OPERATION = }') if OPERATION == Operation.LOAD_NPY: @@ -37,7 +40,7 @@ for camera in tqdm(IMAGES_CAMERAS_FOLDER, 'Camera'): if OPERATION == Operation.SAVE: np.save(numpyFilePath, rawColorChannels) if OPERATION == Operation.LOAD_NPY: - rawColorChannels = np.load(numpyFilePath, allow_pickle = True) + rawColorChannels = np.load(numpyFilePath, mmap_mode = 'r', allow_pickle = True) rawColorChannelsItem = rawColorChannels.item() for color in Color: - print(color, rawColorChannelsItem[color].mean()) \ No newline at end of file + print(color, rawColorChannelsItem[color][:RESOLUTION].mean()) \ No newline at end of file