Transforms need to handle list of channel-first data
See original GitHub issueIs your feature request related to a problem? Please describe.
Currently, if using the default collate_fn, the interted
data is a list of channel-first Tensor or numpy array, if we want to apply transforms on the data, most of the MONAI transforms can’t support it.
For example, users want to use CopyItemsd
, AsDiscreted
, KeepLargestConnectedComponentd
, etc.
All these transforms can only support a batch-first Tensor or a channel-first numpy array.
Thanks.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (16 by maintainers)
Top Results From Across the Web
Transforms — MONAI 1.1.0 Documentation
Return a Composition with a simple list of transforms, as opposed to any ... img ( Tensor ) – data to be transformed,...
Read more >A Gentle Introduction to Channels-First and Channels-Last ...
Color images have height, width, and color channel dimensions. ... Deep learning neural networks require that image data be provided as ...
Read more >Using Oracle Data Transforms
In a web browser that has network access to the Oracle Data Transforms ... These options display the list of data entities based...
Read more >How do I display a single image in PyTorch? - Stack Overflow
Given a Tensor representing the image, use .permute() to put the channels as the last dimension: plt.imshow( tensor_image.permute(1, 2, 0) ).
Read more >transforms.conf - Splunk Documentation
This setting specifies the format of the event, including any field names or values you want to add. * FORMAT is required for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @vfdev-5 ,
You are right, no need to totally change ignite metrics, but may need your help to add some wrapper layer in ignite to support a list of channel-first tensors or support 1 channel-first tensor. We usually use ignite metrics in MONAI workflows directly, like this
Accuracy
: https://github.com/Project-MONAI/tutorials/blob/master/modules/engines/unet_evaluation_dict.py#L111 Actually, I already added support for list of channel-first tensors in MONAI metrics: https://github.com/Project-MONAI/MONAI/blob/dev/monai/handlers/iteration_metric.py#L91Thanks.
Hi @Nic-Ma ,
In our practice it is the most common format for the models output and targets:
(B, C, ...)
and(B, ...)
. Also it helps to accelerate internal computations.As I understand you would like to handle additionally two lists instead of tensors ?
where ypredX and yX have shapes
[C, ...]
and[...]
or yX can be even a scalar. I thinks this could be a feature for ignite…