utils/dash_utils.py
def predict_action(
    config: CfgNode, selected_polygon_pred: str
) -> 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 = []
    input_files_dir = os.path.join(config.DATA_DIR, selected_polygon_pred)
    for input_file in glob.glob(os.path.join(input_files_dir, "*.npy")):
        tile_name = os.path.splitext(os.path.split(input_file)[1])[0]
        ai_engine_infer(
            config,
            tile_path=input_file,
            checkpoint=config.INFER.WEIGHTS_PATH,
            destination=os.path.join(input_files_dir, tile_name),
        )

        savedir = os.path.join(input_files_dir, f"{tile_name}_pred.png")
        merge_preds(selected_polygon_pred, 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 predict_action(
    config: CfgNode, selected_polygon_pred: str
) -> Tuple[List[str], List[float]]:
    paths = []
    coords_collected = []
    input_files_dir = os.path.join(config.DATA_DIR, selected_polygon_pred)
    for input_file in glob.glob(os.path.join(input_files_dir, "*.npy")):
        tile_name = os.path.splitext(os.path.split(input_file)[1])[0]
        ai_engine_infer(
            config,
            tile_path=input_file,
            checkpoint=config.INFER.WEIGHTS_PATH,
            destination=os.path.join(input_files_dir, tile_name),
        )
        savedir = os.path.join(input_files_dir, f"{tile_name}_pred.png")
        merge_preds(selected_polygon_pred, 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 predict_action ( config : CfgNode , selected_polygon_pred : str ) -> Tuple [ List [ str ] , List [ float ] ] : paths = [ ] coords_collected = [ ] input_files_dir = os . path . join ( config . DATA_DIR , selected_polygon_pred ) for input_file in glob . glob ( os . path . join ( input_files_dir , "*.npy" ) ) : tile_name = os . path . splitext ( os . path . split ( input_file ) [ 1 ] ) [ 0 ] ai_engine_infer ( config , tile_path = input_file , checkpoint = config . INFER . WEIGHTS_PATH , destination = os . path . join ( input_files_dir , tile_name ) , ) savedir = os . path . join ( input_files_dir , f"{tile_name}_pred.png" ) merge_preds ( selected_polygon_pred , 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_pred
str
Id of selected area, corresponds to folder name
Id of selected area corresponds to folder name