Closed FrickTobias closed 1 month ago
You are correct, we scale dP (the output of the model) by a factor of 5 for the dynamics -- but a cellpose model cannot take as input flows, that seems to be your issue. The cellpose model will mess with the flows and filter them in strange ways
Okay thank you for the confirmation! It helps a lot!
TL;DR
How should I compute flows from a manually corrected labeled mask correctly?
My current approach produces floats in range (-1, 1), which is different from when I just load and print a non-corrected file.
Code for how I concluded ranges are different between recomputed and loaded flows:
Context of why I want to recompute the flows
I'm trying out some segmentation repairing by adjusting cellprob and flows with my own downstream models. However, I'm having issues with doing the post processing, more specifically when calculating the labeled masks, where I get no cells as output.
I think this is because CellPose somehow scales cellprob and flows, but I'm not able to find it in the source code.
PS. Possibly this is because I'm not fully understanding the difference between dP and flows, which I currently understand as being the same. Or maybe I'm using the wrong dynamics function to go from cellprob and flow to labeled masks.
Manually modifying the range to (-5, 5) helps but doesn't solve everything
Repaired flows visually looks fine