Skip to content

Commit

Permalink
[Typo] Change indexes to indices (open-mmlab#2747)
Browse files Browse the repository at this point in the history
## Modification

I just replaced the `indexes` variable name with `indices` for naming
consistency.
  • Loading branch information
KKIEEK authored Mar 14, 2023
1 parent 6ba4696 commit 447a398
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions mmseg/datasets/dataset_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ def __getitem__(self, idx):
continue

if hasattr(transform, 'get_indices'):
indexes = transform.get_indices(self.dataset)
if not isinstance(indexes, collections.abc.Sequence):
indexes = [indexes]
indices = transform.get_indices(self.dataset)
if not isinstance(indices, collections.abc.Sequence):
indices = [indices]
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

Expand Down
8 changes: 4 additions & 4 deletions mmseg/datasets/transforms/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,17 +1029,17 @@ def transform(self, results: dict) -> dict:
return results

def get_indices(self, dataset: MultiImageMixDataset) -> list:
"""Call function to collect indexes.
"""Call function to collect indices.
Args:
dataset (:obj:`MultiImageMixDataset`): The dataset.
Returns:
list: indexes.
list: indices.
"""

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

@cache_randomness
def generate_mosaic_center(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def mapillary_colormap2label(colormap: np.ndarray) -> list:
Returns:
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)
for i, colormap_ in enumerate(colormap):
Expand Down

0 comments on commit 447a398

Please sign in to comment.