Open z1186464862 opened 6 months ago
Hi @z1186464862,
tile = self.wsi.crop(x, y, self.patch_size, self.patch_size).numpy()[..., :3]
This will be very slow -- it's much better to pass the rgb
flag to openslideload
and then not drop the alpha.
How large are your tiles? If they are small (eg. 32x32 pixels), then fetch
can be much faster than crop
.
You can get much better performance if you sort the coordinate list, perhaps you do this.
It's hard to comment on code fragments in detail without being able to run then or see the context. It's best to post a complete runnable program I can test.
Hi, recently, I tried to use pyvips to generate WSI patches, but I encountered a problem. Given a coordinate list shaped like N × 2, where N is the number of patches. How to generate patches by a multiprocessing way? I have tried using PyTorch's Dataloader to implement it.
However, when num_workers>0, CPU utilization reduced to 0 and the program is constantly running but no error reported. When num_workers=0, it works. I don't know what caused this problem. Can you tell me the reason or provide me with a better method?