5/10/2023 0 Comments Def of collatedefault won't do any collation, so the output will be a list of size batch size. collate_fn: how to collate data after inverse transformations. ![]() loader: data loader used to run `transforms` and generate the batch of data. def _init_ ( self, transform : InvertibleTransform, loader : TorchDataLoader, collate_fn : Optional = no_collation, num_workers : Optional = 0, detach : bool = True, pad_batch : bool = True, fill_value = None, ) -> None : """ Args: transform: a callable data transform on input data. inverse ( data ) def _len_ ( self ) -> int : return len ( self. warn ( "transform is not invertible, can't invert transform for the input data." ) return data return self. invertible_transform, InvertibleTransform ): warnings. inverse ( data ) if not isinstance ( self. pad_collation_used : data = PadListDataCollate. data ) # If pad collation was used, then we need to undo this first if self. pad_collation_used = pad_collation_used def _getitem_ ( self, index : int ): data = dict ( self. import warnings from typing import Any, Callable, Dict, List, Optional, Sequence, Union from import Dataset from import DataLoader as TorchDataLoader from nfig import KeysCollection from import DataLoader from import decollate_batch, no_collation, pad_list_data_collate from import PadListDataCollate from import InvertibleTransform from import MapTransform, Transform from monai.utils import first _all_ = class _BatchInverseDataset ( Dataset ): def _init_ ( self, data : Sequence, transform : InvertibleTransform, pad_collation_used : bool ) -> None : self. # See the License for the specific language governing permissions and # limitations under the License. # You may obtain a copy of the License at # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ![]() # Copyright (c) MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License.
0 Comments
Leave a Reply. |