pandora.state_machine
This module contains class associated to the pandora state machine
Module Contents
Classes
PandoraMachine class to create and use a state machine |
Attributes
- class pandora.state_machine.PandoraMachine[source]
Bases:
transitions.extensions.GraphMachine
PandoraMachine class to create and use a state machine
- matching_cost_prepare(cfg: Dict[str, dict], input_step: str) None [source]
Matching cost computation :param cfg: user configuration :type cfg: dict :param input_step: step to trigger :type input_step: str :return: None
- matching_cost_run(_: Dict[str, dict], __: str) None [source]
Matching cost computation :return: None
- aggregation_run(cfg: Dict[str, dict], input_step: str) None [source]
Cost (support) aggregation :param cfg: pipeline configuration :type cfg: dict :param input_step: step to trigger :type input_step: str :return: None
- semantic_segmentation_run(cfg: Dict[str, dict], input_step: str) None [source]
Building semantic segmentation computation :param cfg: pipeline configuration :type cfg: dict :param input_step: step to trigger :type input_step: str :return: None
- optimization_run(cfg: Dict[str, dict], input_step: str) None [source]
Cost optimization :param cfg: pipeline configuration :type cfg: dict :param input_step: step to trigger :type input_step: str :return: None
- disparity_run(cfg: Dict[str, dict], input_step: str) None [source]
Disparity computation and validity mask :param cfg: pipeline configuration :type cfg: dict :param input_step: step to trigger :type input_step: str :return: None
- filter_run(cfg: Dict[str, dict], input_step: str) None [source]
Disparity filter :param cfg: pipeline configuration :type cfg: dict :param input_step: step to trigger :type input_step: str :return: None
- refinement_run(cfg: Dict[str, dict], input_step: str) None [source]
Subpixel disparity refinement :param cfg: pipeline configuration :type cfg: dict :param input_step: step to trigger :type input_step: str :return: None
- validation_run(cfg: Dict[str, dict], input_step: str) None [source]
Validation of disparity map :param cfg: pipeline configuration :type cfg: dict :param input_step: step to trigger :type input_step: str :return: None
- run_multiscale(cfg: Dict[str, dict], input_step: str) None [source]
Compute the disparity range for the next scale :param cfg: pipeline configuration :type cfg: dict :param input_step: step to trigger :type input_step: str :return: None
- cost_volume_confidence_run(cfg: Dict[str, dict], input_step: str) None [source]
Confidence prediction :param cfg: pipeline configuration :type cfg: dict :param input_step: step to trigger :type input_step: str :return: None
- run_prepare(cfg: Dict[str, dict], left_img: xarray.Dataset, right_img: xarray.Dataset, scale_factor: None | int = None, num_scales: None | int = None) None [source]
Prepare the machine before running
- Parameters:
cfg (dict) – configuration
left_img (xarray.Dataset) –
left Dataset image containing :
im: 2D (row, col) or 3D (band_im, row, col) xarray.DataArray float32
disparity (optional): 3D (disp, row, col) xarray.DataArray float32
msk (optional): 2D (row, col) xarray.DataArray int16
classif (optional): 3D (band_classif, row, col) xarray.DataArray int16
segm (optional): 2D (row, col) xarray.DataArray int16
right_img (xarray.Dataset) –
right Dataset image containing :
im: 2D (row, col) or 3D (band_im, row, col) xarray.DataArray float32
disparity (optional): 3D (disp, row, col) xarray.DataArray float32
msk (optional): 2D (row, col) xarray.DataArray int16
classif (optional): 3D (band_classif, row, col) xarray.DataArray int16
segm (optional): 2D (row, col) xarray.DataArray int16
scale_factor (int or None) – scale factor for multiscale
num_scales (int or None) – scales number for multiscale
- Returns:
None
- run(input_step: str, cfg: Dict[str, dict]) None [source]
Run pandora step by triggering the corresponding machine transition
- Parameters:
input_step (str) – step to trigger
cfg (dict) – pipeline configuration
- Returns:
None
- matching_cost_check_conf(cfg: Dict[str, dict], input_step: str) None [source]
Check the matching cost configuration
- Parameters:
cfg (dict) – configuration
input_step (string) – current step
- Returns:
None
- disparity_check_conf(cfg: Dict[str, dict], input_step: str) None [source]
Check the disparity computation configuration
- Parameters:
cfg (dict) – configuration
input_step (string) – current step
- Returns:
None
- filter_check_conf(cfg: Dict[str, dict], input_step: str) None [source]
Check the filter configuration
- Parameters:
cfg (dict) – configuration
input_step (string) – current step
- Returns:
None
- refinement_check_conf(cfg: Dict[str, dict], input_step: str) None [source]
Check the refinement configuration
- Parameters:
cfg (dict) – configuration
input_step (string) – current step
- Returns:
None
- aggregation_check_conf(cfg: Dict[str, dict], input_step: str) None [source]
Check the aggregation configuration
- Parameters:
cfg (dict) – configuration
input_step (string) – current step
- Returns:
None
- semantic_segmentation_check_conf(cfg: Dict[str, dict], input_step: str) None [source]
Check the semantic_segmentation configuration
- Parameters:
cfg (dict) – configuration
input_step (string) – current step
- Returns:
None
- optimization_check_conf(cfg: Dict[str, dict], input_step: str) None [source]
Check the optimization configuration
- Parameters:
cfg (dict) – configuration
input_step (string) – current step
- Returns:
None
- validation_check_conf(cfg: Dict[str, dict], input_step: str) None [source]
Check the validation configuration
- Parameters:
cfg (dict) – configuration
input_step (string) – current step
- Returns:
None
- multiscale_check_conf(cfg: Dict[str, dict], input_step: str) None [source]
Check the disparity computation configuration
- Parameters:
cfg (dict) – disparity computation configuration
input_step (string) – current step
- Returns:
None
- cost_volume_confidence_check_conf(cfg: Dict[str, dict], input_step: str) None [source]
Check the confidence configuration
- Parameters:
cfg (dict) – configuration
input_step (string) – current step
- Returns:
None
- check_conf(cfg: Dict[str, dict], img_left: xarray.Dataset, img_right: xarray.Dataset, right_left_img_check: bool = False) None [source]
Check configuration and transitions
- Parameters:
cfg (dict) – pipeline configuration
img_left (xarray.Dataset) – image left with metadata
img_right (xarray.Dataset) – image right with metadata
right_left_img_check (bool) – if right image has been checked
- Returns:
None
- remove_transitions(transition_list: List[Dict[str, str]]) None [source]
Delete all transitions defined in the input list
- Parameters:
transition_list (dict) – list of transitions
- Returns:
None
- is_not_last_scale(_: str, __: Dict[str, dict]) bool [source]
Check if the current scale is the last scale :param cfg: configuration :type cfg: dict :param input_step: current step :type input_step: string :return: boolean
- static check_band_pipeline(band_list: numpy.ndarray, step: str, band_used: None | str | List[str] | Dict) None [source]
Check coherence band parameter between pipeline step and image dataset
- Parameters:
band_list (numpy.ndarray with bands) – band names of image
step (str) – pipeline step
band_used (None, str, List[str] or Dict) – band names for pipeline step
- Returns:
None