mapreader.spot_text.dptext_detr_runner

Classes

DPTextDETRRunner

Module Contents

class mapreader.spot_text.dptext_detr_runner.DPTextDETRRunner(patch_df, parent_df=None, cfg_file='./DPText-DETR/configs/DPText_DETR/ArT/R_50_poly.yaml', weights_file='./art_final.pth', device='default', delimiter=',')

Bases: mapreader.spot_text.runner_base.Runner

Parameters:
  • patch_df (pandas.DataFrame | str)

  • parent_df (pandas.DataFrame | str)

  • cfg_file (str | pathlib.Path)

  • weights_file (str | pathlib.Path)

  • device (str)

  • delimiter (str)

patch_predictions
parent_predictions
geo_predictions
cfg
WEIGHTS
DEVICE
predictor
get_patch_predictions(outputs, return_dataframe=False, min_ioa=0.7)

Post process the model outputs to get patch predictions.

Parameters:
  • outputs (dict) – The outputs from the model.

  • return_dataframe (bool, optional) – Whether to return the predictions as a pandas DataFrame, by default False

  • min_ioa (float, optional) – The minimum intersection over area to consider two polygons the same, by default 0.7

Returns:

A dictionary containing the patch predictions or a DataFrame if as_dataframe is True.

Return type:

dict or pd.DataFrame