utils/dash_utils.py
def new_alpha_action(
    config: CfgNode, selected_polygon_analyze: str, alpha
) -> Tuple[List[str], List[float]]:
    """Performs prediction on selected downloaded are

    Args:
        config (CfgNode): App config
        selected_polygon_pred (str): Id of selected area, corresponds to folder name

    Returns:
        Tuple[List[str], List[float]]: A Tuple containing
            * List of paths to downloaded image
            * List of corresponding coordinates, in format:
                [[south, west], [north, east]]
    """

    paths = []
    coords_collected = []
    mask_config = load_yaml(config.DATASET.MASK.CONFIG)
    polygon_root = os.path.join(config.DATA_DIR, selected_polygon_analyze)
    for input_file in glob.glob(os.path.join(polygon_root, "*.npy")):
        tile_name = os.path.splitext(os.path.split(input_file)[1])[0]
        save_filename = f"{tile_name}_pred_" + f"{alpha:.02f}".replace(".", "") + ".png"
        savedir = os.path.join(polygon_root, save_filename)

        if not os.path.isfile(savedir):
            tile_masks_dir = os.path.join(polygon_root, tile_name, "mask_np")
            tile_masks = glob.glob(os.path.join(tile_masks_dir, "*.npy"))
            for mask_file in tile_masks:
                generate_alpha_for_tile(mask_file, mask_config, alpha)

            merge_preds(selected_polygon_analyze, tile_name, savedir, config)

        paths.append(savedir)

        converted_coords = get_converted_coords(config, input_file)
        coords_collected.append(converted_coords)

    return paths, coords_collected
Performs prediction on selected downloaded are

    Args:
        config (CfgNode): App config
        selected_polygon_pred (str): Id of selected area, corresponds to folder name

    Returns:
        Tuple[List[str], List[float]]: A Tuple containing
            * List of paths to downloaded image
            * List of corresponding coordinates, in format:
                [[south, west], [north, east]]
    
Performs prediction on selected downloaded are
Performs prediction on selected downloaded are
def new_alpha_action(
    config: CfgNode, selected_polygon_analyze: str, alpha
) -> Tuple[List[str], List[float]]:
    paths = []
    coords_collected = []
    mask_config = load_yaml(config.DATASET.MASK.CONFIG)
    polygon_root = os.path.join(config.DATA_DIR, selected_polygon_analyze)
    for input_file in glob.glob(os.path.join(polygon_root, "*.npy")):
        tile_name = os.path.splitext(os.path.split(input_file)[1])[0]
        save_filename = f"{tile_name}_pred_" + f"{alpha:.02f}".replace(".", "") + ".png"
        savedir = os.path.join(polygon_root, save_filename)
        if not os.path.isfile(savedir):
            tile_masks_dir = os.path.join(polygon_root, tile_name, "mask_np")
            tile_masks = glob.glob(os.path.join(tile_masks_dir, "*.npy"))
            for mask_file in tile_masks:
                generate_alpha_for_tile(mask_file, mask_config, alpha)
            merge_preds(selected_polygon_analyze, tile_name, savedir, config)
        paths.append(savedir)
        converted_coords = get_converted_coords(config, input_file)
        coords_collected.append(converted_coords)
    return paths, coords_collected
def new_alpha_action ( config : CfgNode , selected_polygon_analyze : str , alpha ) -> Tuple [ List [ str ] , List [ float ] ] : paths = [ ] coords_collected = [ ] mask_config = load_yaml ( config . DATASET . MASK . CONFIG ) polygon_root = os . path . join ( config . DATA_DIR , selected_polygon_analyze ) for input_file in glob . glob ( os . path . join ( polygon_root , "*.npy" ) ) : tile_name = os . path . splitext ( os . path . split ( input_file ) [ 1 ] ) [ 0 ] save_filename = f"{tile_name}_pred_" + f"{alpha:.02f}" . replace ( "." , "" ) + ".png" savedir = os . path . join ( polygon_root , save_filename ) if not os . path . isfile ( savedir ) : tile_masks_dir = os . path . join ( polygon_root , tile_name , "mask_np" ) tile_masks = glob . glob ( os . path . join ( tile_masks_dir , "*.npy" ) ) for mask_file in tile_masks : generate_alpha_for_tile ( mask_file , mask_config , alpha ) merge_preds ( selected_polygon_analyze , tile_name , savedir , config ) paths . append ( savedir ) converted_coords = get_converted_coords ( config , input_file ) coords_collected . append ( converted_coords ) return paths , coords_collected
Performs prediction on selected downloaded are
Performs prediction on selected downloaded are
"""Performs prediction on selected downloaded are

    Args:
        config (CfgNode): App config
        selected_polygon_pred (str): Id of selected area, corresponds to folder name

    Returns:
        Tuple[List[str], List[float]]: A Tuple containing
            * List of paths to downloaded image
            * List of corresponding coordinates, in format:
                [[south, west], [north, east]]
    """
A Tuple containing
List of paths to downloaded image
List of corresponding coordinates, in format:
[[south, west], [north, east]]
A Tuple containing List of paths to downloaded image List of corresponding coordinates in format : [[ south west ] [ north east ]]
Tuple[List[str], List[float]]
config
CfgNode
None
selected_polygon_analyze
str
alpha
selected_polygon_pred
Id of selected area, corresponds to folder name
Id of selected area corresponds to folder name