rex_xai.input_data ================== .. py:module:: rex_xai.input_data Attributes ---------- .. autoapisummary:: rex_xai.input_data.Setup Classes ------- .. autoapisummary:: rex_xai.input_data.Data Functions --------- .. autoapisummary:: rex_xai.input_data._guess_mode Module Contents --------------- .. py:data:: Setup .. py:function:: _guess_mode(input) .. py:class:: Data(input, model_shape, device, mode=None, process=True) .. py:attribute:: input .. py:attribute:: mode :value: None .. py:attribute:: target :type: Optional[rex_xai.prediction.Prediction] :value: None .. py:attribute:: device .. py:attribute:: setup :type: Optional[Setup] :value: None .. 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: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(means, stds, astype, norm) .. 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)