CLI for using Detectron2 models for inference


source

predict_bboxes

 predict_bboxes (path_to_model_files:str, path_to_image:str, outfile:str,
                 processing_dir:str='temp', tile_size:int=400,
                 tile_overlap:int=100, coco_set:str=None,
                 use_tta:bool=True, postproc_results:bool=True)

Detect bounding boxes from a new image using a pretrained model


source

predict_bboxes_detectron2

 predict_bboxes_detectron2 (path_to_model_files:str, path_to_image:str,
                            outfile:str, processing_dir:str='temp',
                            tile_size:int=400, tile_overlap:int=100,
                            coco_set:str=None, use_tta:bool=False,
                            postproc_results:bool=False)

CLI for bbox prediction with detectron2

Type Default Details
path_to_model_files str Path to the folder containing config and weights
path_to_image str Path to image to annotate
outfile str Path and filename for output raster
processing_dir str temp Directory to save the intermediate tiles. Deleted after use.
tile_size int 400 Tile size to use. Default 400x400px tiles
tile_overlap int 100 Tile overlap to use. Default 100px
coco_set str None Path to json file for the coco dataset the model was trained on. None defaults to dummy classes
use_tta bool False Use test-time augmentation?
postproc_results bool False Filter predicted masks

source

predict_instance_masks

 predict_instance_masks (path_to_model_files:str, path_to_image:str,
                         outfile:str, processing_dir:str='temp',
                         tile_size:int=400, tile_overlap:int=100,
                         coco_set:str=None, use_tta:bool=False,
                         postproc_results:bool=False,
                         smooth_preds:bool=False)

Segment instance masks from a new image using a pretrained model


source

predict_instance_masks_detectron2

 predict_instance_masks_detectron2 (path_to_model_files:str,
                                    path_to_image:str, outfile:str,
                                    processing_dir:str='temp',
                                    tile_size:int=400,
                                    tile_overlap:int=100,
                                    coco_set:str=None, use_tta:bool=False,
                                    postproc_results:bool=False,
                                    smooth_preds:bool=False)

CLI for instance segmentation with detectron2

Type Default Details
path_to_model_files str Path to the folder containing config and weights
path_to_image str Path to image to annotate
outfile str Path and filename for output raster
processing_dir str temp Directory to save the intermediate tiles. Deleted after use
tile_size int 400 Tile size to use. Default 400x400px tiles
tile_overlap int 100 Tile overlap to use. Default 100px
coco_set str None Path to json file for the coco dataset the model was trained on. None defaults to dummy classes
use_tta bool False Use test-time augmentation?
postproc_results bool False Filter predicted masks
smooth_preds bool False Run fill_holes and dilate_erode to masks. Not implemented yet