Skip to content
Snippets Groups Projects
Unverified Commit 5d441563 authored by Tao Gong's avatar Tao Gong Committed by GitHub
Browse files

[Refactor]: Change _prepare_data() to prepare_data() in BaseDataset (#108)

parent ed8dcb4c
No related branches found
No related tags found
No related merge requests found
...@@ -350,10 +350,10 @@ class BaseDataset(Dataset): ...@@ -350,10 +350,10 @@ class BaseDataset(Dataset):
self.full_init() self.full_init()
if self.test_mode: if self.test_mode:
return self._prepare_data(idx) return self.prepare_data(idx)
for _ in range(self.max_refetch): for _ in range(self.max_refetch):
data_sample = self._prepare_data(idx) data_sample = self.prepare_data(idx)
if data_sample is None: if data_sample is None:
idx = self._rand_another() idx = self._rand_another()
continue continue
...@@ -527,7 +527,7 @@ class BaseDataset(Dataset): ...@@ -527,7 +527,7 @@ class BaseDataset(Dataset):
""" """
return np.random.randint(0, len(self)) return np.random.randint(0, len(self))
def _prepare_data(self, idx) -> Any: def prepare_data(self, idx) -> Any:
"""Get data processed by ``self.pipeline``. """Get data processed by ``self.pipeline``.
Args: Args:
......
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