GRASS logo

NAME

i.ann.maskrcnn.detect - Detect features in images using a Mask R-CNN model

KEYWORDS

ann, vector, raster

SYNOPSIS

i.ann.maskrcnn.detect
i.ann.maskrcnn.detect --help
i.ann.maskrcnn.detect [-e] [band1=string] [band2=string] [band3=string] [images_directory=name] [images_format=string] model=string classes=string[,string,...] [output_type=string] [--help] [--verbose] [--quiet] [--ui]

Flags:

-e
External georeferencing in the images folder (when using images_directory)
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

band1=string
Name of raster maps to use for detection as the first band (divided by ",")
band2=string
Name of raster maps to use for detection as the second band (divided by ",")
band3=string
Name of raster maps to use for detection as the third band (divided by ",")
images_directory=name
Path to a directory with external images to detect
Name of input directory
images_format=string
Format suffix of images
.jpg, .tiff, .png, etc.
model=string [required]
Path to the .h5 file containing the model
classes=string[,string,...] [required]
Names of classes separated with ","
output_type=string
Type of output
Options: area, point
Default: area

Table of contents

DESCRIPTION

i.ann.maskrcnn.detect allows the user to use a Mask R-CNN model to detect features in GRASS GIS raster maps or georeferenced files and extract them either as areas or points. The module creates a separate map for each class.

NOTES

The detection may be used for raster maps imported in GRASS GIS or for external files (or using both). To use raster maps in GRASS GIS, you need to pass them in three bands following the order used during the training, e.g. if the training has been made on RGB images, use band1=*.red, band1=*.green and band3=*.blue. To pass multiple images, put more maps into band* parameters, divided by ",".

The detection may be used also for multiple external files. However, all files for the detection must be in one directory specified in the images_directory parameter. Even when using only one image, the module finds it through this parameter.

When detecting, you can use new names of classes. Classes in the model are not referenced by their name, but by their order. It means that if the model was trained with classes corn,rice and you use i.ann.maskrcnn.detect with classes zea,oryza, zea areas will present areas detected as corn and oryza areas will present areas detected as rice.

If the external file is georeferenced externally (by a worldfile or an .aux.xml file), please use -e flag.

EXAMPLES

Detect buildings and lakes and import them as areas

One map imported in GRASS GIS:

i.ann.maskrcnn.detect band1=map1.red band2=map1.green band3=map1.blue classes=buildings,lakes model=/home/user/Documents/logs/mask_rcnn_buildings_lakes_0100.h5

Two maps (map1, map2) imported in GRASS GIS:

i.ann.maskrcnn.detect band1=map1.red,map2.red band2=map1.green,map2.green band3=map1.blue,map2.blue classes=buildings,lakes model=/home/user/Documents/logs/mask_rcnn_buildings_lakes_0100.h5

External files, the georeferencing is internal (GeoTIFF):

i.ann.maskrcnn.detect images_directory=/home/user/Documents/georeferenced_images classes=buildings,lakes model=/home/user/Documents/logs/mask_rcnn_buildings_lakes_0100.h5 images_format=tif

External files, the georeferencing is external:

i.ann.maskrcnn.detect images_directory=/home/user/Documents/georeferenced_images classes=buildings,lakes model=/home/user/Documents/logs/mask_rcnn_buildings_lakes_0100.h5 images_format=png -e

Detect cottages and plattenbaus and import them as points

i.ann.maskrcnn.detect band1=map1.red band2=map1.green band3=map1.blue classes=buildings,lakes model=/home/user/Documents/logs/mask_rcnn_buildings_lakes_0100.h5 output_type=point

SEE ALSO

Mask R-CNN in GRASS GIS, i.ann.maskrcnn.train

AUTHOR

Ondrej Pesek

SOURCE CODE

Available at: i.ann.maskrcnn.detect source code (history)

Accessed: Thursday Dec 26 07:03:40 2024


Main index | Imagery index | Topics index | Keywords index | Graphical index | Full index

© 2003-2024 GRASS Development Team, GRASS GIS 8.4.1dev Reference Manual