satsense.generators¶
Module providing a generator to iterate over the image.
- class
satsense.generators.
BalancedGenerator
(image: satsense.image.Image, masks, p=None, samples=None, offset=(0, 0), shape=None)[source]¶Bases:
object
Balanced window generator.
Parameters:
- image (Image) – Satellite image
- masks (1-D array-like) – List of masks, one for each class, to use for generating patches A mask should have a positive value for the array positions that are included in the class
- p (1-D array-like, optional) – The probabilities associated with each entry in masks. If not given the sample assumes a uniform distribution over all entries in a.
- samples (int, optional) – The maximum number of samples to generate, otherwise infinite
Examples
Using BalancedGenerator
>>> from satsense.generators import BalancedGenerator >>> BalancedGenerator(image, [class1_mask, class2_mask, class3_mask], [0.33, 0.33, 0.33])
- class
satsense.generators.
FullGenerator
(image: satsense.image.Image, step_size: tuple, offset=(0, 0), shape=None)[source]¶Bases:
object
Window generator that covers the full image.
Parameters: