mirror of
https://github.com/open-mmlab/mmsegmentation.git
synced 2025-06-03 22:03:48 +08:00
[Typo] Change indexes to indices (#2747)
## Modification I just replaced the `indexes` variable name with `indices` for naming consistency.
This commit is contained in:
parent
6ba4696648
commit
447a398c24
@ -106,11 +106,11 @@ class MultiImageMixDataset:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if hasattr(transform, 'get_indices'):
|
if hasattr(transform, 'get_indices'):
|
||||||
indexes = transform.get_indices(self.dataset)
|
indices = transform.get_indices(self.dataset)
|
||||||
if not isinstance(indexes, collections.abc.Sequence):
|
if not isinstance(indices, collections.abc.Sequence):
|
||||||
indexes = [indexes]
|
indices = [indices]
|
||||||
mix_results = [
|
mix_results = [
|
||||||
copy.deepcopy(self.dataset[index]) for index in indexes
|
copy.deepcopy(self.dataset[index]) for index in indices
|
||||||
]
|
]
|
||||||
results['mix_results'] = mix_results
|
results['mix_results'] = mix_results
|
||||||
|
|
||||||
|
@ -1029,17 +1029,17 @@ class RandomMosaic(BaseTransform):
|
|||||||
return results
|
return results
|
||||||
|
|
||||||
def get_indices(self, dataset: MultiImageMixDataset) -> list:
|
def get_indices(self, dataset: MultiImageMixDataset) -> list:
|
||||||
"""Call function to collect indexes.
|
"""Call function to collect indices.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
dataset (:obj:`MultiImageMixDataset`): The dataset.
|
dataset (:obj:`MultiImageMixDataset`): The dataset.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
list: indexes.
|
list: indices.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
indexes = [random.randint(0, len(dataset)) for _ in range(3)]
|
indices = [random.randint(0, len(dataset)) for _ in range(3)]
|
||||||
return indexes
|
return indices
|
||||||
|
|
||||||
@cache_randomness
|
@cache_randomness
|
||||||
def generate_mosaic_center(self):
|
def generate_mosaic_center(self):
|
||||||
|
@ -106,7 +106,7 @@ def mapillary_colormap2label(colormap: np.ndarray) -> list:
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
list: values are mask labels,
|
list: values are mask labels,
|
||||||
indexes are palette's convert results.、
|
indices are palette's convert results.
|
||||||
"""
|
"""
|
||||||
colormap2label = np.zeros(256**3, dtype=np.longlong)
|
colormap2label = np.zeros(256**3, dtype=np.longlong)
|
||||||
for i, colormap_ in enumerate(colormap):
|
for i, colormap_ in enumerate(colormap):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user