Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Typo] Change indexes to indices #2747

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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