input_data ========== .. py:module:: input_data Attributes ---------- .. autoapisummary:: input_data.Setup Classes ------- .. autoapisummary:: input_data.Data Functions --------- .. autoapisummary:: input_data._guess_mode Module Contents --------------- .. py:data:: Setup .. py:function:: _guess_mode(input) .. py:class:: Data(input, model_shape, device = 'cpu', mode=None, process=False) .. py:attribute:: input .. py:attribute:: mode :type: str | None :value: None .. py:attribute:: target :type: rex_xai.responsibility.prediction.Prediction | List[rex_xai.responsibility.prediction.Prediction] | None :value: None .. py:attribute:: device :value: 'cpu' .. py:attribute:: setup :type: Optional[Setup] :value: None .. py:attribute:: transposed :value: False .. py:attribute:: model_shape .. py:attribute:: model_height :type: Optional[int] .. py:attribute:: model_width :type: Optional[int] .. py:attribute:: model_depth :type: Optional[int] :value: None .. py:attribute:: model_channels :type: Optional[int] :value: 1 .. py:attribute:: model_order :value: None .. py:attribute:: mask_value :value: None .. py:attribute:: background :value: None .. py:attribute:: context :value: None .. py:attribute:: context_noise :value: 0.4 .. py:method:: set_height(h) .. py:method:: set_width(w) .. py:method:: set_channels(c=None) .. py:method:: __repr__() .. py:method:: set_classification(cl) .. py:method:: 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 .. py:method:: generic_tab_preprocess() .. py:method:: load_data(astype='float32') .. py:method:: _normalise_rgb_data(means, stds, norm) used for onnx input data only .. py:method:: try_unsqueeze() .. py:method:: generic_image_preprocess(means=None, stds=None, astype='float32', norm = 255.0) .. py:method:: __get_shape() returns height, width, channels, order, depth for the model .. py:method:: set_mask_value(m)