input_data¶
Attributes¶
Classes¶
Functions¶
|
Module Contents¶
- input_data.Setup¶
- input_data._guess_mode(input)¶
- class input_data.Data(input, model_shape, device='cpu', mode=None, process=False)¶
- Parameters:
model_shape (Tuple | List)
device (str | torch.device)
- input¶
- target: rex_xai.responsibility.prediction.Prediction | List[rex_xai.responsibility.prediction.Prediction] | None = None¶
- device = 'cpu'¶
- transposed = False¶
- model_shape¶
- model_order = None¶
- mask_value = None¶
- background = None¶
- context = None¶
- context_noise = 0.4¶
- set_channels(c=None)¶
- set_classification(cl)¶
- match_data_to_model_shape()¶
a PIL image has the from H * W * C, so if the model takes C * H * W we need to transpose self.data to get it into the correct form for the model to consume This function does not add in the batch channel at the beginning
- generic_tab_preprocess()¶
- load_data(astype='float32')¶
- _normalise_rgb_data(means, stds, norm)¶
used for onnx input data only
- try_unsqueeze()¶
- generic_image_preprocess(means=None, stds=None, astype='float32', norm=255.0)¶
- Parameters:
norm (Optional[float])
- __get_shape()¶
returns height, width, channels, order, depth for the model
- set_mask_value(m)¶