Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #1963

Merged
merged 4 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ Raster Vision 0.11
Features
~~~~~~~~

- Added the possibility for chip classification to use data augmentors from the albumentations libary to enhance the training data. `#859 <https://github.com/azavea/raster-vision/pull/859>`__
- Added the possibility for chip classification to use data augmentors from the albumentations library to enhance the training data. `#859 <https://github.com/azavea/raster-vision/pull/859>`__
- Updated the Quickstart doc with pytorch docker image and model `#863 <https://github.com/azavea/raster-vision/pull/863>`__
- Added the possibility to deal with class imbalances through oversampling. `#868 <https://github.com/azavea/raster-vision/pull/868>`__

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def setup(app: 'Sphinx') -> None:

# The name of the Pygments (syntax highlighting) style to use.
#
# To see all availabel values:
# To see all available values:
# >>> from pygments.styles import get_all_styles
# >>> styles = list(get_all_styles())
#
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/gpu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ or use the ``--gpu`` option with the ``docker/run`` script.
Running on AWS EC2
------------------

The simplest way to run Raster Vision on an AWS GPU is by starting a GPU-enabled EC2 instance such as a p3.2xlarge using the `Deep Learning AMI <https://aws.amazon.com/machine-learning/amis/>`_. We have tested this using the "Deep Learning AMI GPU PyTorch 1.11.0 (Ubuntu 20.04)" with id ``ami-0c968d7ef8a4b0c34``. After SSH'ing into the instance, Raster Vision can be installed with ``pip``, and code can be transfered to this instance with a tool such as ``rsync``.
The simplest way to run Raster Vision on an AWS GPU is by starting a GPU-enabled EC2 instance such as a p3.2xlarge using the `Deep Learning AMI <https://aws.amazon.com/machine-learning/amis/>`_. We have tested this using the "Deep Learning AMI GPU PyTorch 1.11.0 (Ubuntu 20.04)" with id ``ami-0c968d7ef8a4b0c34``. After SSH'ing into the instance, Raster Vision can be installed with ``pip``, and code can be transferred to this instance with a tool such as ``rsync``.

.. _aws batch setup:

Expand Down
2 changes: 1 addition & 1 deletion docs/usage/tutorials/reading_vector_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@
"tags": []
},
"source": [
"Just like we can tansform rasters by specifying a series of :class:`RasterTransformers <raster_transformer.raster_transformer.RasterTransformer>`, we can specify :class:`VectorTransformers <vector_transformer.vector_transformer.VectorTransformer>` to transform vector data."
"Just like we can transform rasters by specifying a series of :class:`RasterTransformers <raster_transformer.raster_transformer.RasterTransformer>`, we can specify :class:`VectorTransformers <vector_transformer.vector_transformer.VectorTransformer>` to transform vector data."
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions rastervision_core/rastervision/core/box.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def get_windows(self,
padding.

Each of size, stride, and padding can be either a positive int or
a tuple `(vertical-componet, horizontal-component)` of positive ints.
a tuple `(vertical-component, horizontal-component)` of positive ints.

Padding currently only applies to the right and bottom edges.

Expand All @@ -379,14 +379,14 @@ def get_windows(self,
stride (Union[PosInt, Tuple[PosInt, PosInt]]): Step size between
windows. Can be 2-tuple (h_step, w_step) or positive int.
padding (Optional[Union[PosInt, Tuple[PosInt, PosInt]]], optional):
Optional padding to accomodate windows that overflow the
Optional padding to accommodate windows that overflow the
extent. Can be 2-tuple (h_pad, w_pad) or non-negative int.
If None, will be set to (size[0]//2, size[1]//2).
Defaults to None.
pad_direction (Literal['both', 'start', 'end']): If 'end', only pad
ymax and xmax (bottom and right). If 'start', only pad ymin and
xmin (top and left). If 'both', pad all sides. Has no effect if
paddiong is zero. Defaults to 'end'.
padding is zero. Defaults to 'end'.

Returns:
List[Box]: List of Box objects.
Expand Down
2 changes: 1 addition & 1 deletion rastervision_core/rastervision/core/data/class_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def ensure_null_class(self) -> None:
null_class_name = DEFAULT_NULL_CLASS_NAME
null_class_color = DEFAULT_NULL_CLASS_COLOR

# This might seeem redundant given the null class validator above, but
# This might seem redundant given the null class validator above, but
# is actually important. Sometimes there can be multiple ClassConfig
# instances that reference the same list objects for names and colors
# (not clear why this happens). This means that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def transform_shape(x, y, z=None):
window_aoi = transform(transform_shape, window_aoi)
window_aois.append(window_aoi)

# If window does't overlap with any AOI, then it won't be in
# If window doesn't overlap with any AOI, then it won't be in
# new_labels.
if window_aois:
# If window intersects with AOI, set pixels outside the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_coordinates(
return tuple(boxes.T)

def _is_valid_boxes(self, data: np.ndarray) -> bool:
"""Check whether data fullfills the format of N*[ymin, xmin, ymax, xmin].
"""Check whether data fulfills the format of N*[ymin, xmin, ymax, xmin].

Args:
data (np.ndarray): Box coords as a [N, 4] numpy array.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self,
bbox (Optional[Box], optional): User-specified crop of the extent.
If None, the full extent available in the source file is used.
ioa_thresh (Optional[float], optional): IOA threshold to apply when
retieving labels for a window. Defaults to None.
retrieving labels for a window. Defaults to None.
clip (bool, optional): Clip bounding boxes to window limits when
retrieving labels for a window. Defaults to False.
"""
Expand All @@ -52,7 +52,7 @@ def get_labels(self,

Returns:
ObjectDetectionLabels: Labels with sufficient overlap with the
window. The returned labels are in global coods (i.e. coords wihtin
window. The returned labels are in global coods (i.e. coords within
the full extent of the source).
"""
if window is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def save(self, labels):
"""Save.

Args:
labels - Labels to be saved, the type of which will be dependant on the type
labels - Labels to be saved, the type of which will be dependent on the type
of pipeline.
"""
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def crs_transformer(self) -> RasterioCRSTransformer:
return self._crs_transformer

def _set_info_from_chip(self):
"""Read 1x1 chip to get info not statically inferrable."""
"""Read 1x1 chip to get info not statically inferable."""
test_chip = self.get_chip(Box(0, 0, 1, 1))
self._dtype = test_chip.dtype
self._num_channels = test_chip.shape[-1]
Expand Down Expand Up @@ -183,7 +183,7 @@ def get_chip(self,
channel_order (if specified). So if this is an RGB image and
channel_order=[2, 1, 0], then using bands=[0] will return the
B-channel. Defaults to None.
out_shape (Optional[Tuple[int, ...]], optional): (hieght, width) of
out_shape (Optional[Tuple[int, ...]], optional): (height, width) of
the output chip. If None, no resizing is done.
Defaults to None.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def crs_transformer(self) -> RasterioCRSTransformer:
return self._crs_transformer

def _set_info_from_chip(self):
"""Read 1x1 chip to get info not statically inferrable."""
"""Read 1x1 chip to get info not statically inferable."""
test_chip = self.get_chip(Box(0, 0, 1, 1))
self._dtype = test_chip.dtype
self._num_channels = test_chip.shape[-1]
Expand Down Expand Up @@ -168,7 +168,7 @@ def get_chip(self,
channel_order (if specified). So if this is an RGB image and
channel_order=[2, 1, 0], then using bands=[0] will return the
B-channel. Defaults to None.
out_shape (Optional[Tuple[int, ...]], optional): (hieght, width) of
out_shape (Optional[Tuple[int, ...]], optional): (height, width) of
the output chip. If None, no resizing is done.
Defaults to None.

Expand Down
6 changes: 3 additions & 3 deletions rastervision_core/rastervision/core/data/utils/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def make_ss_scene(image_uri: Union[str, List[str]],
label_vector_default_class_id (Optional[int], optional): If using
label_vector_uri and all polygons in that file belong to the same
class and they do not contain a `class_id` property, then use this
argument to map all of the polgons to the appropriate class ID.
argument to map all of the polygons to the appropriate class ID.
See docs for ClassInferenceTransformer for more details.
Defaults to None.
image_raster_source_kw (dict, optional): Additional arguments to pass
Expand Down Expand Up @@ -152,7 +152,7 @@ def make_cc_scene(image_uri: Union[str, List[str]],
label_vector_default_class_id (Optional[int], optional): If using
label_vector_uri and all polygons in that file belong to the same
class and they do not contain a `class_id` property, then use this
argument to map all of the polgons to the appropriate class ID.
argument to map all of the polygons to the appropriate class ID.
See docs for ClassInferenceTransformer for more details.
Defaults to None.
image_raster_source_kw (dict, optional): Additional arguments to pass
Expand Down Expand Up @@ -243,7 +243,7 @@ def make_od_scene(image_uri: Union[str, List[str]],
label_vector_default_class_id (Optional[int], optional): If using
label_vector_uri and all polygons in that file belong to the same
class and they do not contain a `class_id` property, then use this
argument to map all of the polgons to the appropriate class ID.
argument to map all of the polygons to the appropriate class ID.
See docs for ClassInferenceTransformer for more details.
Defaults to None.
image_raster_source_kw (dict, optional): Additional arguments to pass
Expand Down
8 changes: 4 additions & 4 deletions rastervision_core/rastervision/core/data/utils/geojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ def geoms_to_geojson(geoms: Iterable['BaseGeometry'],

def geom_to_feature(geom: 'BaseGeometry',
properties: Optional[dict] = None) -> dict:
"""Serialize a single shapely geomety to a GeoJSON Feature."""
geomety = mapping(geom)
feature = geometry_to_feature(geomety, properties=properties)
"""Serialize a single shapely geometry to a GeoJSON Feature."""
geometry = mapping(geom)
feature = geometry_to_feature(geometry, properties=properties)
return feature


Expand Down Expand Up @@ -251,7 +251,7 @@ def pixel_to_map_coords(geojson: dict,
def simplify_polygons(geojson: dict) -> dict:
"""Simplify polygon geometries by applying ``.buffer(0)``.

For Polygon geomtries, ``.buffer(0)`` can do the following:
For Polygon geometries, ``.buffer(0)`` can do the following:

1. *Sometimes* break up a polygon with "bowties" into multiple polygons.
(See https://github.com/shapely/shapely/issues/599.)
Expand Down
2 changes: 1 addition & 1 deletion rastervision_core/rastervision/core/data/utils/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def fill_overflow(bbox: Box,
bbox (Box): Bounding box.
window (Box): Window corresponding to the ``chip``.
chip (np.ndarray): (H, W, C) array.
fill_value (int, optional): Value to set oveflowing pixels to.
fill_value (int, optional): Value to set overflowing pixels to.
Defaults to 0.

Returns:
Expand Down
4 changes: 2 additions & 2 deletions rastervision_core/rastervision/core/data/utils/rasterio.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def write_bbox(path: str, arr: np.ndarray, bbox: Box, crs_wkt: str, **kwargs):
Args:
path (str): GeoTiff path.
arr (np.ndarray): (H, W[, C]) Array to write.
bbox (Box): Bouding box in map coords to georeference the GeoTiff to.
bbox (Box): Bounding box in map coords to georeference the GeoTiff to.
crs_wkt (str): CRS in WKT format.
"""
if arr.ndim == 2:
Expand Down Expand Up @@ -182,7 +182,7 @@ def read_window(
Defaults to None.
is_masked (bool): If True, read a masked array from rasterio.
Defaults to False.
out_shape (Optional[Tuple[int, int]]): (hieght, width) of the output
out_shape (Optional[Tuple[int, int]]): (height, width) of the output
chip. If None, no resizing is done. Defaults to None.

Returns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def mask_to_polygons(mask: np.ndarray, transform: Optional[rio.Affine] = None
Args:
mask (np.ndarray): The mask containing buildings to polygonize.
transform (Optional[rio.Affine]): Affine transform to use during
polygonization. Deafults to None (i.e. identity transform).
polygonization. Defaults to None (i.e. identity transform).

Returns:
Iterator[BaseGeometry]: Generator of shapely polygons.
Expand Down Expand Up @@ -61,7 +61,7 @@ def mask_to_building_polygons(
Args:
mask (np.ndarray): The mask containing buildings to polygonize.
transform (Optional[rio.Affine]): Affine transform to use during
polygonization. Deafults to None (i.e. identity transform).
polygonization. Defaults to None (i.e. identity transform).
min_area (float): Minimum area (in pixels^2) of anything that can be
considered to be a building or cluster of buildings. The goal is to
distinguish between buildings and artifacts. Components with area
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def merge(self,
Args:
other (ClassificationEvaluation): Evaluation to merge into this one
scene_id (Optional[str], optional): ID of scene. If specified,
(a copy of) ``other`` will be saved and be availabel in
(a copy of) ``other`` will be saved and be available in
``to_json()``'s output. Defaults to None.
"""
if self.conf_mat is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def compute_metrics(
pred_labels: 'ObjectDetectionLabels',
num_classes: int,
iou_thresh: float = 0.5) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
"""Compute per-class true positves, false positives, and false negatives.
"""Compute per-class true positives, false positives, and false negatives.

Does the following:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def predict(self, split_ind=0, num_splits=1):

This uses a sliding window.
"""
# Cache backend so subsquent calls will be faster. This is useful for
# Cache backend so subsequent calls will be faster. This is useful for
# the predictor.
if self.backend is None:
self.backend = self.config.backend.build(self.config, self.tmp_dir)
Expand Down
4 changes: 2 additions & 2 deletions rastervision_core/rastervision/core/utils/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def parse_stac(stac_uri: str, item_limit: Optional[int] = None) -> List[dict]:
stac_uri (str): Path to the STAC catalog JSON file.

Returns:
List[dict]: A lsit of dicts with keys: "label_uri", "image_uris",
List[dict]: A list of dicts with keys: "label_uri", "image_uris",
"label_bbox", "image_bbox", "bboxes_intersect", and "aoi_geometry".
Each dict corresponds to one label item and its associated image
assets in the STAC catalog.
Expand Down Expand Up @@ -145,7 +145,7 @@ def read_stac(uri: str, extract_dir: Optional[str] = None,
Exception: If multiple catalog.json's are found inside the zip file.

Returns:
List[dict]: A lsit of dicts with keys: "label_uri", "image_uris",
List[dict]: A list of dicts with keys: "label_uri", "image_uris",
"label_bbox", "image_bbox", "bboxes_intersect", and "aoi_geometry".
Each dict corresponds to one label item and its associated image
assets in the STAC catalog.
Expand Down
2 changes: 1 addition & 1 deletion rastervision_pipeline/rastervision/pipeline/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""Library verison"""
"""Library version"""
__version__ = '0.21.3-dev'
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The `test.py` script provides some useful commands for running the examples and
It supports the following commands:
- `run` - run an example either remotely or locally
- `compare` - compare the outputs of the `eval` stage of two runs of the same example
- `collect` - dowload the output of one or more commands (like `train`, `eval`, `bundle`, etc.) produced by a run of an example
- `collect` - download the output of one or more commands (like `train`, `eval`, `bundle`, etc.) produced by a run of an example
- `predict` - download the model bundle produced by a run of an example and use it to make predictions on a sample image
- `upload` - upload model bundle, eval, sample image, sample predictions, and training logs to the model zoo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"source": [
"## Use the AOI to determine what images are inside the training set\n",
"\n",
"Here we compare the AOI to the image extents to deteremine which images we can use for training and validation. We're using `rasterio`'s ability to read the metadata from raster data on S3 without downloading the whole image"
"Here we compare the AOI to the image extents to determine which images we can use for training and validation. We're using `rasterio`'s ability to read the metadata from raster data on S3 without downloading the whole image"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test():
@click.option('--remote', is_flag=True, default=False)
@click.option(
'--commands',
help='Space-separated string with RV commansd to run.',
help='Space-separated string with RV command to run.',
default=None)
@click.option(
'--overrides',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def make_scene(scene_id: str, image_uri: str, label_uri: str,
ignore_crs_field=True,
# The geoms in the label GeoJSON do not have a "class_id" property, so
# classes must be inferred. Since all geoms are for the building class,
# this is easy to do: we just assing the building class ID to all of
# this is easy to do: we just assign the building class ID to all of
# them.
transformers=[
ClassInferenceTransformerConfig(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def make_cc_geodataset(cls,
label_vector_default_class_id (Optional[int], optional): If using
label_vector_uri and all polygons in that file belong to the same
class and they do not contain a `class_id` property, then use this
argument to map all of the polgons to the appropriate class ID.
argument to map all of the polygons to the appropriate class ID.
See docs for ClassInferenceTransformer for more details.
Defaults to None.
image_raster_source_kw (dict, optional): Additional arguments to pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def __getitem__(self, key) -> Tuple[torch.Tensor, torch.Tensor]:
y = torch.from_numpy(y)

if y is None:
# Ideally, y should be None to semantically convery the absence of
# any label, but PyTorch's defauult collate function doesn't handle
# Ideally, y should be None to semantically convert the absence of
giswqs marked this conversation as resolved.
Show resolved Hide resolved
# any label, but PyTorch's default collate function doesn't handle
# None values.
y = torch.tensor(np.nan)

Expand Down
Loading