-
Notifications
You must be signed in to change notification settings - Fork 2
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
Working cellpose-python and stardist tests #11
Conversation
Hey @oeway - I think this looks mostly reasonable now (though let me know if you want me to remove imjoy.io from the server list). |
decode_json=True | ||
) | ||
mask = ret['mask'][0] | ||
print("Model test passed: ", "Cellpose using cellpose-python") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some assert statements here to check the mask shape etc.? There should be a success
key, and if it's false, there should be an error
key to get the stack trace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the mask access fail if the process failed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But yeah, can check for a success key and get it's value too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no success field... the return value is:
{
'mask': array([[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
...,
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0],
[0, 0, 0, ..., 0, 0, 0]], dtype=int32),
'__info__': {
'model_name': 'stardist',
'model_version': '1',
'outputs': [
{'name': 'mask',
'datatype': 'INT32',
'shape': [349, 467],
'parameters': {'binary_data_size': 651932}
}
]
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So checking that the mask exists and contains a 2d array is probably about as good a check as we can do. Presumably it should have the same shape as the input?
NB: this is stardist
not the bioengine-model-runner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added shape tests... stardist
was fine, but cellpose-python
returns a stupid rolled-dimension array 🙄 :
(1, 349, 467) != (349, 467, 3)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, ignore that. Upon closer paying attention, I get it 🤣 . The input is RGB, output is binary mask (and for some reason has to have the singleton dimension added).
Looks good! I just added a comment. and we can keep ai.imjoy.io there. |
NOTE: This is not ready to merge