-
Notifications
You must be signed in to change notification settings - Fork 17
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
Enhance axes in 0.5.0
#290
Comments
For workflows I implemented this slightly adapted to comply with the NGFF draft (https://ngff.openmicroscopy.org/latest/#axes-md) as @constantinpape suggested: spec-bioimage-io/bioimageio/spec/workflow/v0_2/raw_nodes.py Lines 107 to 112 in b66798a
Of course it would make a lot of sense if we can use the same axes/input definition for models and workflows |
After recent discussion with @constantinpape it became clear that we also want to support ragged tensors (at least when an 'index' dimension is present). There is some support in PyTorch for this: torch.nested However, xarray/numpy do not support ragged arrays. (see pydata/xarray#1482)
|
Hi @FynnBe Thanks for the summary. I have two doubts. (1) What do you mean by resizing? (2) how do yo establish the relationship between the axes role list and the actual shape? For example, how do you know that the batch corresponds to the first dimension (value 1), time to the second (value 5) and so on? |
Chainging the shape/size for variable shapes/sizes defined by
The |
From the discussion in the Ai4Life hackathon, it seems it would be very useful to have each output channel labeled with its precise semantics instead of the arbitrary strings in "labels" (e.g. 'size' and 'age' in the sample code above). As it stands, a consumer of models (e.g.: ilastik, knime, apeer)can't really tell which models are compatible with the task that the users is trying to accomplish; Even if a model has outputs whose shape and data-type match the expectations of the application, there is no guarantee that the semantics of the output match the expectations of the consuming app. For example, if the application is expecting a model that produces a probability map, where each channel is the probability of a pixel being in one particular class, it could be fooled into thinking that a model that produces an RGB image is actually producing a probability map with 3 classes. Alternatively, an application that can execute arbitrary models might not know how to render the outputs if the semantics are not clear. Therefore, it seems we need a way to precisely specify the semantics of each channel of the output tensor, which would represent something equivalent to the following, with more types added as needed to the ChannelSemantics = Union[
IntanceSegmentationInstanceMask,
InstanceSegmentationObjectId,
ProbabilityOfBelongingToAClassAddingUpToOne,
ProbabilityOfBelongingToOneOfPotentiallyMultipleClasses,
ProbabiltyOfBeingACenter,
]
class IntanceSegmentationInstanceMask:
pass
class ProbabilityOfBelongingToAClassAddingUpToOne:
classification_class_name: str # e.g. "foreground", "background", "cat", "dog"
group_name: str # other channels with the same group should add up to one
class ProbabilityOfBelongingToOneOfPotentiallyMultipleClasses:
classification_class_name: str
group_name: str # pixels in this group can belong to multiple classes and add up to more than 1.0
class InstanceSegmentationObjectId:
"""A channel labeled with this represents the an object ID as an uint32 (as opposed to e.g. an integer quantity) """
pass
class ProbabiltyOfBeingACenter:
pass |
#12 relates to adding semantic labels |
looking at this again I thought of another (better :-)) option 4: it's like option 2, but simpler: |
Finalizing the
0.4.00.5.0
:Originally posted by @FynnBe in #70 (comment)
The text was updated successfully, but these errors were encountered: