-
Notifications
You must be signed in to change notification settings - Fork 17
multiple preprocessing using bioimageio spec #669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I can only give answers to the general spec related aspects of your question... This repo is not deepimagej specific, but maybe @carlosuc3m can chime in on this here, too. Otherwise please open another issue in https://github.com/deepimagej/deepimagej-plugin/issues
The spec does not distinguish between an image and an RGB stack, for it all n-dimensional data are tensors. An input tensor can have a channel dimension with channel names determining the number of channels. (Python developer docs, non Python (JSON Schema docs))
Conversion to float32 before and after preprocessing is the default when specifying
The spec looks good in the example you gave 👍 |
Thanks for that. I forgot to add, there is an extra normalization step, i.e., divide by 255, so the procedure is:
It looks like other steps are fine, so is the normalization part of preprocessing or do I need to add it as an extra step before 'zero mean unit variance'? Cheers |
Hello @pr4deepr , Also as @FynnBe says, no need to worry about composite images, rgb stacks or data type! All that is handled by deepimagej |
Thanks @carlosuc3m. I am attaching the preprocessing macro that worked for me in deepimagej 3.0.3. fixed_zero_mean_unit_variance.txt
Cheers |
@carlosuc3m , just following up on this |
Hello @pr4deepr and sorry for the delay in the response!! HEre note that in By the way, in the macro you provided, you first divide teh channels by 255, but multiply the mean and std by 255... REgards,
|
Thanks. I get an error with
When looking at the spec, I couldn't fine an entry for |
Hello @pr4deepr It should work now. You can also remove the parameters For compatibility with other softwares also add offset: 0
REgards, |
Thanks. So, it runs fine, but the prediction is not accurate in my case. Maybe this could be something to do with how I've performed normalization in my code during training I checked my code and during training in pytorch, following preprocessing happens:
Perhaps I could modify the mean and std.. Or maybe there is another fix? Cheers |
Hi
I am duplicating an imagesc forum post as I think its better to ask the question here.
I am trying to use preprocessing in the new version of deepimageJ. Can I chain multiple preprocessing steps in the bioimageio model spec?
I have a pytorch model that worked on deepimagej v3.0.3. I used the preprocessing macro for fixed_zero_mean_unit_variance, but modified it to use
This was working well until the new update where I cannot use a custom macro anymore.
I can use the zero_mean_unit_variance preprocessing in the rdf.yaml file like:
but the model prediction is wrong.
Using the deepimagej v3.1.0, if I use the above configuration, I get the prediction in the middle (wrong). However, if I remove preprocessing config, run the fixed_zero_mean_unit_variance.ijm macro first and then predict with deepimagej, I get the image on the right (correct).
So, my question is, without needing to use a macro, how can I leverage the model spec to:
Cheers
Pradeep
The text was updated successfully, but these errors were encountered: