Решение, которое я придумал, состоит в том, чтобы извлечь отдельные столбцы и записать их в массив. массив, отображенный в памяти, например:
Код: Выделить всё
for i in tqdm(range(len(start_indices))):
ix = start_indices[i]
width = image_widths[i]
col = slide.read_region(location=(0, ix),
level=0,
size=(shape[1], width)) # a function from OpenSlide, it takes almost no time to read, so this is not the problem for sure
col = col.convert("RGB")
col = np.array(col)
memmap[ix] = col.squeeze()
Подробнее здесь: https://stackoverflow.com/questions/791 ... pped-array