Skip to content

Commit

Permalink
Make doc formatting more consistent, update copy
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbo committed Aug 19, 2020
1 parent 907a68c commit 6a26a3c
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions docs/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ Here is the full list of configuration parameters you can specify in a ``config.

**imagery**: string
Label Maker expects to receive imagery tiles that are 256 x 256 pixels. You can specific the source of the imagery with one of:

- A template string for a tiled imagery service. Note that you will generally need an API key to obtain images and there may be associated costs. The above example requires a `Mapbox access token <https://www.mapbox.com/help/how-access-tokens-work/>`_. Also see `OpenAerialMap <https://openaerialmap.org/>`_ for open imagery. The access token for TMS image formats can be read from an environment variable ``'https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.jpg?access_token={ACCESS_TOKEN}'`` or added directly the imagery string.
- A GeoTIFF file location. Works with local files: ``'http://oin-hotosm.s3.amazonaws.com/593ede5ee407d70011386139/0/3041615b-2bdb-40c5-b834-36f580baca29.tif'``
- Remote files like a `WMS endpoint <http://www.opengeospatial.org/standards/wms>`_ ``GetMap`` request. Fill out all necessary parameters except ``bbox`` which should be set as ``{bbox}``. Ex:

.. code-block:: none
A template string for a tiled imagery service. Note that you will generally need an API key to obtain images and there may be associated costs. The above example requires a `Mapbox access token <https://www.mapbox.com/help/how-access-tokens-work/>`_. Also see `OpenAerialMap <https://openaerialmap.org/>`_ for open imagery.
The access token for TMS image formats can be read from an environment variable https://api.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.jpg?access_token={ACCESS_TOKEN}" or added directly the imagery string.
'https://basemap.nationalmap.gov/arcgis/services/USGSImageryOnly/MapServer/WMSServer?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&LAYERS=0&STYLES=&FORMAT=image%2Fjpeg&TRANSPARENT=false&HEIGHT=256&WIDTH=256&SRS=EPSG%3A3857&BBOX={bbox}'
A GeoTIFF file location. Works with local files: ``'http://oin-hotosm.s3.amazonaws.com/593ede5ee407d70011386139/0/3041615b-2bdb-40c5-b834-36f580baca29.tif'``

Remote files like a `WMS endpoint <http://www.opengeospatial.org/standards/wms>`_ ``GetMap`` request. Fill out all necessary parameters except ``bbox`` which should be set as ``{bbox}``. Ex: ``'https://basemap.nationalmap.gov/arcgis/services/USGSImageryOnly/MapServer/WMSServer?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&LAYERS=0&STYLES=&FORMAT=image%2Fjpeg&TRANSPARENT=false&HEIGHT=256&WIDTH=256&SRS=EPSG%3A3857&BBOX={bbox}'``
**http_auth**: list
Optional parameter to specify a username and password for restricted WMS services. For example, ``['my_username', 'my_password']``.
Expand All @@ -45,7 +47,7 @@ Here is the full list of configuration parameters you can specify in a ``config.
One of ``'classification'``, ``'object-detection'``, or ``'segmentation'``. This defines the output format for the final label numpy arrays (``y_train`` and ``y_test``).

``'classification'``
Output is an array of ``len(classes) + 1``. Each array value will be either `1` or `0` based on whether it matches the class at the same index. The additional array element belongs to the background class, which will always be the first element.
Output is an array of ``len(classes) + 1``. Each array value will be either 1 or 0 based on whether it matches the class at the same index. The additional array element belongs to the background class, which will always be the first element.

``'object-detection'``
Output is an array of bounding boxes of the form ``[xmin, ymin, width, height, class_index]``. In this case, the values are pixel values measured from the upper left-hand corner (not latitude and longitude values). Each feature is tested against each class, so if a feature matches two or more classes, it will have the corresponding number of bounding boxes created.
Expand All @@ -57,22 +59,25 @@ Here is the full list of configuration parameters you can specify in a ``config.
Random generator seed. Optional, use to make results reproducible.

**split_vals**: list
Default: `[0.8, 0.2]`
Percentage of data to put in each category listed in split_names. Must be a list of floats that sum to one and match the length of `split-names`. For train, validate, and test data, a list like `[0.7, 0.2, 0.1]` is suggested.
Default: ``[0.8, 0.2]``

Percentage of data to put in each category listed in split_names. Must be a list of floats that sum to one and match the length of ``split-names``. For train, validate, and test data, a list like ``[0.7, 0.2, 0.1]`` is suggested.

**split_names**: list
Default: `['train', 'test']`
List of names for each subset of the data. Length of list must match length of `split_vals`.
Default: ``['train', 'test']``

List of names for each subset of the data. Length of list must match length of ``split_vals``.

**imagery_offset**: list of ints
An optional list of integers representing the number of pixels to offset imagery. For example ``[15, -5]`` will move the images 15 pixels right and 5 pixels up relative to the requested tile bounds.

**tms_image_format**: string
An option string that has the downloaded imagery's format such as `.jpg` or `.png` when it isn't provided by the endpoint
An option string that has the downloaded imagery's format such as ``.jpg`` or ``.png`` when it isn't provided by the endpoint

**over_zoom**: int
An integer greater than 0. If set for XYZ tiles, it will fetch tiles from `zoom` + `over_zoom`, to create higher resolution tiles which fill out the bounds of the original zoom level.
An integer greater than 0. If set for XYZ tiles, it will fetch tiles from ``zoom`` + ``over_zoom``, to create higher resolution tiles which fill out the bounds of the original zoom level.

**band_indices**: list
A list of band indices to pull from a tiff. Defaults to (1, 2, 3) if not specified. For using non-RGB tifs, ie MultiSpectral tifs this should be over-written
for example to [5, 3, 2, 7] to extract Red, Green, Blue, and NIR bands from the MultiSpectral spacenet challenge imagery.
Default: ``[1, 2, 3]``

A list of band indices to pull from a TIF. Using the `SpaceNet Roads Challenge Data <https://spacenet.ai/spacenet-roads-dataset/>`_ as an example, you can use ``[5, 3, 2, 7]`` to extract the Red, Green, Blue, and NIR bands respectively.

0 comments on commit 6a26a3c

Please sign in to comment.