load_orig_and_masks

hybrid_learning.experimentation.fuzzy_exp.fuzzy_exp_eval.load_orig_and_masks(img_fn, orig_size=None, imgs_dir=None, pedestrian_cache_dir=None, gt_pedestrian_cache_dir=None, concept_cache_dirs=None, final_cache_dir=None, pedestrian_key='pedestrian', gt_pedestrian_key='gt_pedestrian', device=None, use_pretty_names=True, raise_on_missing=False)[source]

Load the original image and masks at index image_id from configured cache directories.

Parameters
  • orig_size (Optional[Tuple[int, int]]) – size in (height, width) to which to pad and resize the original image; if not given defaults to size of pedestrian mask, and no resizing if this is unknown

  • final_cache_dir (Optional[str]) – cache directory for the formula output files

  • use_pretty_names (bool) – whether to transform mask names using formula_to_display_name()

  • pedestrian_key (str) – mask key for person mask

  • gt_pedestrian_key (str) – mask key for ground truth person mask

  • device – onto which device to load the masks

  • raise_on_missing (bool) – whether to raise when a mask file is missing or just set the respective value to None

  • img_fn (str) –

  • imgs_dir (Optional[str]) –

  • pedestrian_cache_dir (Optional[str]) –

  • gt_pedestrian_cache_dir (Optional[str]) –

  • concept_cache_dirs (Optional[Dict[str, str]]) –

Returns

tuple (original_image, masks_dict) with the special mask dict keys 'formula' for the formula mask, and pedestrian_key for the DNN output.

Return type

Tuple[Tensor, Dict[str, Tensor]]