Skip to content
Snippets Groups Projects
Commit 239f3e57 authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Implemented a check on the scene identifier

parent 4217fe22
No related branches found
No related tags found
No related merge requests found
......@@ -38,17 +38,30 @@ def _get_scene_tiles(ds, scene_id):
Parameters
----------
ds : `pysegcnn.core.dataset.ImageDataset`
An instance of `~pysegcnn.core.dataset.ImageDataset`.
ds : `pysegcnn.core.split.RandomSubset` or
`pysegcnn.core.split.SceneSubset`
An instance of `~pysegcnn.core.split.RandomSubset` or
`~pysegcnn.core.split.SceneSubset`.
scene_id : `str`
A valid scene identifier.
Raises
------
ValueError
Raised if ``scene_id`` is not a valid scene identifier for the dataset
``ds``.
Returns
-------
indices : `list` [`int`]
List of indices of the tiles from scene with id ``scene_id`` in ``ds``.
"""
# check if the scene id is valid
scene_meta = ds.dataset.parse_scene_id(scene_id)
if scene_meta is None:
raise ValueError('{} is not a valid scene identifier'.format(scene_id))
# iterate over the scenes of the dataset
indices = []
for i, scene in enumerate(ds.scenes):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment