fiftyone.utils.geotiff¶
GeoTIFF utilities.
Classes:
|
Importer for a directory of GeoTIFF images with geolocation data. |
Functions:
|
Retrieves the geolocation information from the given GeoTIFF image. |
-
fiftyone.utils.geotiff.
get_geolocation
(image_path)¶ Retrieves the geolocation information from the given GeoTIFF image.
The returned
fiftyone.core.labels.GeoLocation
will contain the lon/lat coordinates of the center of the image in itspoint
attribute and the coordinates of its corners (clockwise, starting from the top-left) in itspolygon
attribute.- Parameters
image_path – the path to the GeoTIFF image
- Returns
-
class
fiftyone.utils.geotiff.
GeoTIFFDatasetImporter
(dataset_dir=None, image_path=None, recursive=True, compute_metadata=False, shuffle=False, seed=None, max_samples=None)¶ Bases:
fiftyone.utils.data.importers.LabeledImageDatasetImporter
,fiftyone.utils.data.importers.ImportPathsMixin
Importer for a directory of GeoTIFF images with geolocation data.
See this page for format details.
- Parameters
dataset_dir (None) – the dataset directory. If omitted,
image_path
must be providedimage_path (None) –
an optional parameter that enables explicit control over the location of the GeoTIFF images. Can be any of the following:
a list of paths to GeoTIFF images. In this case,
dataset_dir
has no effecta glob pattern like
"*.tif"
specifying the location of the images indataset_dir
an absolute glob pattern of GeoTIFF images. In this case,
dataset_dir
has no effect
recursive (True) – whether to recursively traverse subdirectories. Not applicable when
image_path
is providedcompute_metadata (False) – whether to produce
fiftyone.core.metadata.ImageMetadata
instances for each image when importingshuffle (False) – whether to randomly shuffle the order in which the samples are imported
seed (None) – a random seed to use when shuffling
max_samples (None) – a maximum number of samples to import. By default, all samples are imported
Methods:
close
(*args)Performs any necessary actions after the last sample has been imported.
Returns the dataset info for the dataset.
setup
()Performs any necessary setup before importing the first sample in the dataset.
Attributes:
Whether this importer produces a dataset info dictionary.
Whether this importer produces
fiftyone.core.metadata.ImageMetadata
instances for each image.The
fiftyone.core.labels.Label
class(es) returned by this importer.-
property
has_image_metadata
¶ Whether this importer produces
fiftyone.core.metadata.ImageMetadata
instances for each image.
-
property
has_dataset_info
¶ Whether this importer produces a dataset info dictionary.
-
property
label_cls
¶ The
fiftyone.core.labels.Label
class(es) returned by this importer.This can be any of the following:
a
fiftyone.core.labels.Label
class. In this case, the importer is guaranteed to return labels of this typea list or tuple of
fiftyone.core.labels.Label
classes. In this case, the importer can produce a single label field of any of these typesa dict mapping keys to
fiftyone.core.labels.Label
classes. In this case, the importer will return label dictionaries with keys and value-types specified by this dictionary. Not all keys need be present in the imported labelsNone
. In this case, the importer makes no guarantees about the labels that it may return
-
setup
()¶ Performs any necessary setup before importing the first sample in the dataset.
This method is called when the importer’s context manager interface is entered,
DatasetImporter.__enter__()
.
-
close
(*args)¶ Performs any necessary actions after the last sample has been imported.
This method is called when the importer’s context manager interface is exited,
DatasetImporter.__exit__()
.- Parameters
*args – the arguments to
DatasetImporter.__exit__()
-
get_dataset_info
()¶ Returns the dataset info for the dataset.
By convention, this method should be called after all samples in the dataset have been imported.
- Returns
a dict of dataset info