bioimage-io / collection-bioimage-io

(deprecated in favor of bioimage-io/collection) RDF collection for BioImage.IO
5 stars 9 forks source link

CebraNET Cellular Membranes in Volume SEM #506

Closed utterances-bot closed 9 months ago

utterances-bot commented 1 year ago

CebraNET Cellular Membranes in Volume SEM

Bioimage.io -- an AI model repository for deep learning.

https://bioimage.io/?tags=electron-microscopy&id=10.5281%2Fzenodo.7274275&type=model

ved-sharma commented 1 year ago

Hello, I tried this model in ilastik on a JPEG image and it is giving following error:

Model incompatible, reasons: Model expects data to have a minimum size along the following axes {'z':64}.

Does this mean that the model works on a Z-stack and not on a single X-Y image?

constantinpape commented 1 year ago

Does this mean that the model works on a Z-stack and not on a single X-Y image?

Yes, it means that the network expects a z-stack with at least 64 z-slices.

ved-sharma commented 1 year ago

Thanks for your reply! I do not have a Z-stack. Is there a way for it to work on a single slice? Or, could you recommend any other model for a single slice?

constantinpape commented 1 year ago

What task exactly do you want to solve?

ved-sharma commented 1 year ago

I want to outline the mitochondria and its internal membranes (cristae), then calculate the mitochondria area and cristae lengths.

constantinpape commented 1 year ago

I want to outline the mitochondria and its internal membranes (cristae), then calculate the mitochondria area and cristae lengths.

I see. We have a few mitochondria models: https://bioimage.io/#/?tags=mitochondria. And some of them work for 2d data. But we don't have anything for cristate directly. I think there are a few options:

jhennies commented 1 year ago

Hi Ved, I would second Constantin's suggestions, in principle you could copy your 2d data to make a stack of 64 images (which would then be all equal). Then you could test the model to see if it in principle gives you what you would require. I would only do this for a proof of principle though.

ved-sharma commented 1 year ago

Thanks @constantinpape and @jhennies for your suggestions. I'll give it a try.

carlosuc3m commented 1 year ago

Hello @jhennies would it be possible to include the torchscript weights in this model so it would be runnable in both deepImageJ and Icy

jhennies commented 1 year ago

Hi @carlosuc3m, thanks for your question! I would forward to @constantinpape and @FynnBe, have you done this before? Do you know if it's feasible to convert the pytorch model accordingly and where I could find information on how to do it properly?

ivan-ea commented 1 year ago

Hi @jhennies, there is an example notebook in the bioimage-io repo that shows how to add torchscript weights to an existing model with pytorch state dictionary weights. It is the very last section of the notebook "Create model compatible with deepImageJ".

After that, the new version of the model can be uploaded to the zoo.

jhennies commented 1 year ago

Thanks, that seems doable!

carlosuc3m commented 1 year ago

Thanks to the two of you! @jhennies @ivan-ea

jhennies commented 1 year ago

@ivan-ea, thanks again for pointing out the example notebook. However, I am having trouble with uploading the updated model.

I tried the following:

  1. While being logged in the zenodo account I clicked on 'edit' on the CebraEM model bringing me to the 'Edit' tab of the upload process with the previous CebraEM info already filled in the form.

  2. Using 'Load a local RDF file', I updated the info and dropped the new relevant files at "Drop additional files here". I made sure I replaced the rdf.yaml such that everything is up to date.

  3. Clicking "VALIDATE" then passes successfully.

  4. Now, clicking "OK" does not do anything. No error, no nothing.

I noticed that when I change the name of the model (field "Name") then validate and clicking OK brings me to the Review & Upload tab. But I want to update the existing model so not change the name. Am I misunderstanding the update feature and I have to give a new name?

FynnBe commented 1 year ago

Am I misunderstanding the update feature and I have to give a new name?

sounds like a bug on bioimage.io, I opened https://github.com/bioimage-io/bioimage.io/issues/348 to follow that. In the meantime, you can manually edit the zenodo entry on zenodo.org. Edit the rdf.yaml and (re-)upload files...

To test before your upload you can run bioimageio test-model <your rdf.yaml>, e.g. bioimageio test-model rdf.yaml in a conda environment with the bioimageio.core (available on conda-forge) and pytorch packages installed.

FynnBe commented 11 months ago

I found some minor issues:

@jhennies, do you think you could fix these minor issues?

jhennies commented 11 months ago

@FynnBe All should be fixed here: https://zenodo.org/records/10047226