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

unify progress bar for datasets #1625

Merged
merged 2 commits into from
Feb 23, 2021

Conversation

rijobro
Copy link
Contributor

@rijobro rijobro commented Feb 23, 2021

unify arguments for progress bar in datasets.

Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@rijobro rijobro mentioned this pull request Feb 23, 2021
Signed-off-by: Richard Brown <33289025+rijobro@users.noreply.github.com>
@rijobro rijobro enabled auto-merge (squash) February 23, 2021 21:44
@rijobro rijobro merged commit db2dbb0 into Project-MONAI:master Feb 23, 2021
@rijobro rijobro deleted the unify_progress_bar branch February 24, 2021 09:32
@@ -51,14 +51,16 @@ class Dataset(_TorchDataset):
}, }, }]
"""

def __init__(self, data: Sequence, transform: Optional[Callable] = None) -> None:
def __init__(self, data: Sequence, transform: Optional[Callable] = None, progress: bool = True) -> None:
Copy link
Contributor

@wyli wyli Feb 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps the progress is not a fundamental property of a Dataset, so it shouldn't be in this base class, what do you think? for a user of the Dataset API, it's difficult to understand this option without looking at the cache dataset and some of the concrete implementations... (progress is not needed in all subclasses)

@Nic-Ma @rijobro sorry I should have had this discussion earlier during my review, somehow I missed it...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right, sorry about that. A couple of choices:

  1. New middleman class. DatasetWithProgress. PersistentDataset and CacheDataset would inherit from it.
  2. Update current documentation for base class: progress: whether to display a progress bar **(if relevant)**.
  3. Revert this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I vote for option 1... @Nic-Ma thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you guys, progress should not be in the base class.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants