Lee-Gihun / MEDIAR

(NeurIPS 2022 CellSeg Challenge - 1st Winner) Open source code for "MEDIAR: Harmony of Data-Centric and Model-Centric for Multi-Modality Microscopy"
MIT License
141 stars 29 forks source link

Running on large jp2 WSI files #1

Closed supritimulay closed 1 year ago

supritimulay commented 1 year ago

Thank you for uploading this wonderful segmentation code. Can this be run on large tif or jp2 WSI images? How can we run this for large WSI files?

Lee-Gihun commented 1 year ago

Yes, we tested on WSIs (with .tif or .tiff extention) in the inference time, and it works well.

However, due to the memory & time efficiency, MEDIAR conducts the inference greedily using the 2000*2000 RoI size. If you have enough computational resources, you can comment out the related part below: https://github.com/Lee-Gihun/MEDIAR/blob/916434faebdc155e07f0db81af1a51cb899cfad5/core/MEDIAR/Predictor.py#L103-L156

FYI, it didn't work well when I tested the currently trained model on H&E-stained WSIs. It could be due to those images not being in the trained datasets, which indicates you need to fine-tune the model with few labeled images in such cases.

supritimulay commented 1 year ago

Thank you, I am having enough computational resource, and tried to segment ~4GB *.tiff file with the above code commenting but program is getting killed and no error is shown. Can you please help me on how I can proceed further?

Lee-Gihun commented 1 year ago

I guess it might be the internal python, which usually due to the bad memory allocation. You can check the followings:

supritimulay commented 1 year ago

Thank you. For smaller tiles algorithm is working absolutely fine. I am trying to make tile and run this algo but it requires all argument with input path and other more. Are you having any version of this program for WSI which will create tile run MEDIAR and again stitch it back. Thank you.

Lee-Gihun commented 1 year ago

We currently do not support such function yet. However, I think that tiled inference and stitching back is an interesting and very useful extension. Let us include the function at the next version. We're planning to improve some usability of MEDIAR, maybe late this month.

supritimulay commented 1 year ago

Thank you!