Skip to content

Commit 447a398

Browse files
authored
[Typo] Change indexes to indices (#2747)
## Modification I just replaced the `indexes` variable name with `indices` for naming consistency.
1 parent 6ba4696 commit 447a398

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

mmseg/datasets/dataset_wrappers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ def __getitem__(self, idx):
106106
continue
107107

108108
if hasattr(transform, 'get_indices'):
109-
indexes = transform.get_indices(self.dataset)
110-
if not isinstance(indexes, collections.abc.Sequence):
111-
indexes = [indexes]
109+
indices = transform.get_indices(self.dataset)
110+
if not isinstance(indices, collections.abc.Sequence):
111+
indices = [indices]
112112
mix_results = [
113-
copy.deepcopy(self.dataset[index]) for index in indexes
113+
copy.deepcopy(self.dataset[index]) for index in indices
114114
]
115115
results['mix_results'] = mix_results
116116

mmseg/datasets/transforms/transforms.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,17 +1029,17 @@ def transform(self, results: dict) -> dict:
10291029
return results
10301030

10311031
def get_indices(self, dataset: MultiImageMixDataset) -> list:
1032-
"""Call function to collect indexes.
1032+
"""Call function to collect indices.
10331033
10341034
Args:
10351035
dataset (:obj:`MultiImageMixDataset`): The dataset.
10361036
10371037
Returns:
1038-
list: indexes.
1038+
list: indices.
10391039
"""
10401040

1041-
indexes = [random.randint(0, len(dataset)) for _ in range(3)]
1042-
return indexes
1041+
indices = [random.randint(0, len(dataset)) for _ in range(3)]
1042+
return indices
10431043

10441044
@cache_randomness
10451045
def generate_mosaic_center(self):

projects/mapillary_dataset/tools/dataset_converters/mapillary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def mapillary_colormap2label(colormap: np.ndarray) -> list:
106106
107107
Returns:
108108
list: values are mask labels,
109-
indexes are palette's convert results.
109+
indices are palette's convert results.
110110
"""
111111
colormap2label = np.zeros(256**3, dtype=np.longlong)
112112
for i, colormap_ in enumerate(colormap):

0 commit comments

Comments
 (0)